Repository navigation
Apply saved player assignments without the Mac launch window - #1268
Draft
Gonzalo-Bruna wants to merge 2 commits into
Draft
Gonzalo-Bruna wants to merge 2 commits into
Gonzalo-Bruna wants to merge 2 commits into
Conversation
Embed player assignment in the existing launcher, retain controllers through gameplay, persist confirmed routes and support standalone Joy-Cons. Include the host validation and packaging corrections verified by the CI regression tests. Front-ends: player setup is opt-in through DM_PLAYER_SETUP with the paired same-process host library; native entry points and saved-choice behavior are documented in docs/frontends.md.
A front end that bypasses the launch window cannot apply the player assignments saved by that window, so controller discovery order decides the players instead. Use the existing player setup to restore valid per-app assignments for the session when setup is enabled and no window setup was confirmed. Reserve session slots across disconnects and advertise the capability only when the packaged host supports it. Checked with native player and input tests, including sanitizer runs, Python packaging and documentation tests, and Mario Party Jamboree with an 8BitDo, Xbox controller and keyboard. Front-ends: new: DMPlayerPrefs identifies Mac apps that accept saved player assignments without a confirmed window.
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
When a game starts without the nxnative window, controller discovery order decides which player gets each controller. I am building a separate launcher where players can choose that order across games; right now, they may need to disconnect and reconnect controllers to get the desired order in each game.
This adds a way for a front end to pass its choices to the same player assignment logic introduced in #1127. With
DM_PLAYER_SETUP=1and no confirmed window setup, the host reads the app's saved assignments and uses them for that session.An unsandboxed front end can:
Info.plistcontainsDMPlayerPrefs=players.controllers.v1.players.controllers.v1layouts andlauncher.DM_PLAYER_SETUP="1"to the app's preferences domain.--no-launcher. The full format, keyboard settings and limitations are documented indocs/frontends.md.Configured slots remain reserved across disconnects, and a uniquely matched controller can return to its slot. A controller without a saved profile takes an unused session slot; existing players are not renumbered. Ambiguous saved profiles stay unassigned. Missing or malformed layouts fall back to automatic routing, while a valid empty array starts a session with no configured models. This mode does not write preferences back.
The native window's behavior stays the same. For example, when Finder opens the window, controllers that have not been assigned there remain off. The packer advertises
DMPlayerPrefsonly when the packaged host supports this handoff.Dependency: this PR is based on #1127 at
2e7df03and targetsmain. The implementation is ready for review; I am keeping this PR in draft until #1127 is integrated. Until then, both its commit and this contribution will appear here; please review our commit. Refs #878.Checked
dm/games/settings.pyanddm/tools/tests/test_split_linkdata.py.0100965017338000, game version and duration not recorded in the test report) was tested with an 8BitDo Ultimate 2, an Xbox One controller and a keyboard. The checks covered player order, reconnects, automatic mode, an unlisted controller, a separate keyboard player and the native window.Not checked
clang-tidywas unavailable locally.scripts/regress.py check --gamesrun was not performed because it launches local games; no broad multi-game regression is claimed.Front ends
Front-ends: new:
DMPlayerPrefsidentifies Mac apps that accept saved player assignments without a confirmed window.Docs
Updated the front-end handoff, settings, environment switches and service reference; regenerated the symptom index.
python3 dm/tools/docs_symptoms.pywas run.