Skip to content

inaba-vdom-0/RTA_LapWatcher

Repository files navigation

RTA LapWatcher

EN: RTA LapWatcher is an automation tool for LiveSplit that uses camera-based image recognition to automatically trigger lap (split) inputs.
JP: RTA LapWatcherLiveSplit 用の自動ラップツールです。カメラ映像からゲーム画面を認識し、自動的にスプリットキーを押下します。


🎮 Features | 機能

  • EN: Automatically detects scene changes using template matching
    JP: テンプレートマッチングでシーン変化を検出します
  • EN: Sends key press (e.g., num1) to LiveSplit
    JP: LiveSplit にキー(例:num1)を自動で送信
  • EN: Test mode with visual matching result
    JP: テストモードでは検出結果を画像で確認可能
  • EN: Runtime control via hotkeys (Ctrl+Q, Ctrl+E)
    JP: 実行中のホットキー操作に対応(Ctrl+Q, Ctrl+E

🗂️ Project Structure | プロジェクト構成


.
├── main.py                 # Entry point | メイン起動スクリプト
├── setting.py              # Load configs | 設定読み込み
├── rta_lapwatcher.py       # Core logic | メイン処理(画像認識・判定)
├── _images/                # Template images | ラップ検出用の画像フォルダ
├── lap_list.yaml           # Lap definitions | ラップの定義
├── cap_config.yaml         # Camera & test config | カメラ・テスト設定
└── README.md               # This file | 本ドキュメント


1. Prepare Template Images | 検出画像の準備

EN:
Place your scene images in the _images/ directory.
Each lap requires two images for detection:

  • image_a: The start trigger image
  • image_b: The confirmation image after detection

JP:
シーン画像を _images/ フォルダに配置してください。
各ラップごとに2枚の検出用画像が必要です:

  • image_a: ラップ開始判定用の画像
  • image_b: 確認用の画像

2. Configure Lap List | ラップ定義ファイルの設定

EN:
Define each lap and its corresponding images and threshold values in lap_list.yaml.
JP:
各ラップの画像としきい値を lap_list.yaml に設定します。

lap1:
  image_a: "scene1_start.png"
  image_b: "scene1_end.png"
  threshold: 0.85

lap2:
  image_a: "scene2_start.png"
  image_b: "scene2_end.png"
  threshold: 0.8

EN:

  • threshold: Matching threshold value (Recommended: 0.7 ~ 0.95). If set too high, matching may fail.

JP:

  • threshold: テンプレートマッチングのしきい値(推奨値:0.7~0.95)。高すぎると検出されない場合があります。

3. Configure Camera and Settings | カメラ設定とキーの設定

EN:
Define your camera source, hotkey, and test mode settings in cap_config.yaml.
JP:
カメラデバイス・ホットキー・テストモードの設定を cap_config.yaml に記述します。

obs_cam_number: 2
lap_key: num1
video:
  frame_rate: 60
  width: 1920
  height: 1080
test_mode:
  enable: false
  result_only_mode: true
  • EN: obs_cam_number: Index number of the camera device to use.
    JP: obs_cam_number: 使用するカメラのデバイス番号(例:OBS仮想カメラなど)
  • EN: lap_key: Keyboard key to send to LiveSplit for splitting laps.
    JP: lap_key: LiveSplit に送信するスプリット用のキー(例:num1space など)
  • EN: test_mode: Group of test-related flags.
    JP: test_mode: テスト用フラグのグループです。
    • EN: enable: If true, show matching result and bounding boxes.
      JP: enable: true の場合、マッチ結果と矩形を表示します。
    • EN: result_only_mode: If true, show result only when matched.
      JP: result_only_mode: true の場合、検出成功時のみ結果を表示します。

4. Run the Tool | ツールの実行

python main.py

⌨️ Hotkeys | ホットキー一覧

EN:
You can control the tool using the following keyboard shortcuts.
JP:
以下のキーボードショートカットでツールを操作できます。

Key EN: Action JP: 説明
Ctrl+R EN: Restart the tool JP: ツールを再起動(再走時に使用)
Ctrl+Q EN: Force quit the tool JP: ツールを強制終了
Ctrl+C EN: Skip the current split manually JP: 現在のスプリットを手動スキップ

🛠️ Requirements | 動作環境

EN:
Install Python and the required dependencies.
JP:
Python をインストールし、必要なライブラリを導入してください。

  • Python 3.8+
  • Install the following libraries:
    • EN: Run this command in your terminal
    • JP: 以下のコマンドをターミナルで実行してください
pip install opencv-python matplotlib pyautogui pyyaml keyboard

🧪 Test Mode Tips | テストモードの使い方

EN:
Test mode provides visual feedback for template detection.
JP:
テストモードではテンプレート検出結果を視覚的に確認できます。

  • enable: true
    • EN: Show heatmap and matching area
    • JP: ヒートマップと一致範囲を表示
  • result_only_mode: true
    • EN: Only show result when a match is found
    • JP: 一致したときだけ結果を表示

💡 Best Practices | より正確に動かすためのヒント

  • Use clean and static scenes as templates
  • Adjust threshold per scene for best results
  • JP: ゲーム内の「静止シーン」や高コントラストな画像をテンプレートに使うと精度が向上します。

📄 License | ライセンス

MIT License

This tool is community-driven and not affiliated with LiveSplit.
JP: 本ツールは LiveSplit 非公式のファンツールです。MITライセンスで公開されています。

📦 Third-Party Libraries | 外部ライブラリ情報


Document Generated with ChatGPT

EN: This document was generated using OpenAI ChatGPT (GPT-4o, June 2025).
JP: このドキュメントは OpenAI ChatGPT(GPT-4o, 2025年6月版) により出力されています。

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published