feat: declared extra controls in GameMeta (wire revision 6)#38
Merged
Conversation
A trailing presence-guarded meta section listing inputs beyond the canonical control vocabulary — a printable rune or a named key, each with a short display label — so front ends on devices without the corresponding physical key (touch) can surface each declaration as a tappable affordance sending exactly the declared input. Presentation metadata only; declarations change no input interpretation. Go: GameMeta.Controls + RuneControl/KeyControl, wire.ControlDecl + ValidateControls, named key-code constants. Rust: Meta::controls + ControlDecl, Key::to_wire, byte-identical encoding (golden-pinned, incl. a new controls golden and the regenerated scalar vectors). ABI.md §4.2 declared-controls section + revision ledger entry 6; GUIDE.md mobile-friendly-controls authoring section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Adds a declared-controls section to the game metadata: a game whose inputs go beyond the canonical control vocabulary (letter commands like
rto resign, a named key like Backspace to undo) can declare each one with a short display label, so front ends on devices without the corresponding physical key — touch screens — can surface a tappable affordance that sends exactly the declared input.Declarations are presentation metadata only: they change no input interpretation, and a game fully served by
Resolve()'s vocabulary needs none.Wire (ABI-additive minor, revision 6)
wireRevision:u16 count, then per controlu8 kind · (u32 rune | u8 key) · str label. Encoders always write it (count 0); payloads ending earlier decode as older metas with no declarations. Unknown kinds fail decode (entry size depends on kind — can't be framed past).wire.ControlDecl,wire.ValidateControls(printable rune or assigned key code, non-empty label ≤16 runes, no duplicate inputs, ≤32 decls), named key-code constants,wire.Revision5→6 with ledger entry.SDKs
GameMeta.Controls+kit.RuneControl('r', "RESIGN")/kit.KeyControl(kit.KeyBackspace, "UNDO"); validated atmeta()encode time (the config-spec fail-fast posture).Meta::controls+ControlDecl,Key::to_wire, byte-identical encoding — pinned by a new Go-emitted controls golden, the updated meta goldens, and the regeneratedscalars.txtvectors.Docs
Verification
go build/vet/test ./...green (incl. new round-trip/presence-guard/validation tests and the truncation-vector updates);cargo testgreen inrust/andcrossverify/; scalar golden vectors regenerated via the standardWIRE_SCALAR_GOLDEN_WRITE=1flow.Changeset: minor.
🤖 Generated with Claude Code