Skip to content

feat: opt-in two-player mode (a detector per player) - #30

Merged
HichTala merged 7 commits into
HichTala:masterfrom
leiteszeke:up/05-multiplayer
Oct 13, 2026
Merged

HichTala merged 7 commits into
HichTala:masterfrom
leiteszeke:up/05-multiplayer

Conversation

@leiteszeke

@leiteszeke leiteszeke commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #29 (debug) → #28 (crop/rotation) → #27 (subprocess) → #26 (build). Review/merge in order.

Summary

Adds an opt-in "Enable two players" toggle (Draw 2 settings → Advanced features, off by default): the dock runs one detector per player, each with its own deck lists, and each Draw Display source picks which detector it reads from. Single-player setups are unaffected.

Changes

  • src/feature_flags.{h,cpp} — FEATURE_CHANNEL key (alongside the existing crop/rotate/debug flags).
  • src/DrawDock.{cpp,hpp} — when enabled, launch a second backend (player 2); dock log lines are tagged [P1] / [P2]. Off → a single detector, as before.
  • src/SettingsDialog.{cpp,hpp} — the Enable two players toggle, and a Player 2 deck-list row shown only when it's on.
  • src/draw.c — when enabled, a Detector / Player property on the Draw Display source selects which detector (shared-memory channel) it reads from; changing it re-creates the shared memory under the new channel.
  • README + all translations (es/fr/jp/pt-br) document it under a single Advanced features section.

Opt-in / default behaviour

Off by default: with it off, the source has no channel selector, no Player 2 deck row, and the dock launches a single detector — identical to single-player.

How it was tested

  • Universal plugin build succeeds (cmake --preset macos).
  • With the toggle on, the Player 2 deck row appears, the source exposes the Detector / Player property, and Start DRAW launches two detectors ([P1] + [P2]).

Screenshots

Toggle off (default) → only Player 1 decks vs toggle on → Player 1 + Player 2 decks:

Off (single player) On (two players)
toggle off toggle on

Per-source Detector / Player selector (each Draw Display chooses which detector it reads from):

channel selector

Two detectors live — both backends running ([P1] + [P2] in the dock log), each player's card detected independently:

two detectors

Add an opt-in 'Enable debug logging' toggle (Advanced features, off by
default) that surfaces diagnostics without code edits:

- DrawDock: in debug mode, log the exact backend launch to the dock
  (resolved deck paths, channel, model, confidence, screen-time
  thresholds) and stop filtering the backend's stdout (show every line).
- draw.c: in debug mode, log the resolved capture config to the OBS log
  (input source, source dimensions, crop, 180° rotation, channel).
- feature_flags: FEATURE_DEBUG key.
- SettingsDialog: the toggle. README + all translations document it.

Plugin-side only; default (off) behaviour is unchanged.
leiteszeke and others added 6 commits October 13, 2026 12:28
Three opt-in per-source detector-input aids (off by default), so the
plugin behaves like upstream until enabled:

- feature_flags.{h,cpp}: opt-in toggle infrastructure (draw_feature_enabled,
  backed by QSettings) with FEATURE_CROP / FEATURE_ROTATE.
- draw.c: when enabled, the DRAW source gains Crop (L/T/R/B px) and a 180°
  rotation, applied to the captured frame before the detector; plus a
  'Preview detector input' toggle that renders the cropped/rotated frame in
  the source itself (so the crop can be dialed in from the source's own
  preview) instead of the detected-card overlay. Detection keeps running.
- SettingsDialog: 'Enable detector input crop' / 'Enable 180° input rotation'
  toggles under 'Advanced features'.
- README + all translations and fr/ja locale strings.

Default (off) behaviour is identical to upstream.
Add an opt-in 'Enable debug logging' toggle (Advanced features, off by
default) that surfaces diagnostics without code edits:

- DrawDock: in debug mode, log the exact backend launch to the dock
  (resolved deck paths, channel, model, confidence, screen-time
  thresholds) and stop filtering the backend's stdout (show every line).
- draw.c: in debug mode, log the resolved capture config to the OBS log
  (input source, source dimensions, crop, 180° rotation, channel).
- feature_flags: FEATURE_DEBUG key.
- SettingsDialog: the toggle. README + all translations document it.

Plugin-side only; default (off) behaviour is unchanged.
…-debug-mode

# Conflicts:
#	data/locale/en-US.ini
#	data/locale/fr-FR.ini
#	data/locale/ja-JP.ini
#	src/SettingsDialog.cpp
#	src/SettingsDialog.hpp
#	src/bridge.h
- draw.c: the debug log still printed rotate_180, which no longer exists
  (build error); log crop + channel only.
- en-US.ini: restore the crop/preview labels from HichTala#28 that the master
  merge reverted.
- README_jp.md: remove the duplicated Advanced features block.
- READMEs: debug log details mention crop only (no rotation).
- DrawDock.cpp: include bridge.h.
- clang-format.
Run a detector per player so two players can be processed at once. Opt-in
(off by default) via the 'Enable two players' toggle; single-player setups
are unchanged. Stacks on the crop + debug features.

- bridge: FEATURE_CHANNEL key (alongside CROP/DEBUG).
- DrawDock: launch a second backend (player 2) only when enabled; dock log
  lines are tagged [P1]/[P2].
- SettingsDialog: 'Enable two players' toggle under Advanced features; the
  Player 2 deck-list row appears only when enabled.
- draw.c: a 'Detector / Player' property on the DRAW source selects which
  detector (shared-memory channel) it reads from.
- README + all translations document the two-player workflow.

Default (off) behaviour is identical to single-player.

@HichTala HichTala left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, still need to perform some tests on windows before merging it

@HichTala
HichTala merged commit 7e3ee89 into HichTala:master Oct 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants