Skip to content

feat: declared extra controls in GameMeta (wire revision 6)#38

Merged
BCook98 merged 1 commit into
mainfrom
add-controls-metadata
Jun 11, 2026
Merged

feat: declared extra controls in GameMeta (wire revision 6)#38
BCook98 merged 1 commit into
mainfrom
add-controls-metadata

Conversation

@BCook98

@BCook98 BCook98 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Adds a declared-controls section to the game metadata: a game whose inputs go beyond the canonical control vocabulary (letter commands like r to 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)

  • New trailing presence-guarded meta section after wireRevision: u16 count, then per control u8 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.Revision 5→6 with ledger entry.

SDKs

  • Go: GameMeta.Controls + kit.RuneControl('r', "RESIGN") / kit.KeyControl(kit.KeyBackspace, "UNDO"); validated at meta() encode time (the config-spec fail-fast posture).
  • Rust (same PR per the in-repo mirror rule): Meta::controls + ControlDecl, Key::to_wire, byte-identical encoding — pinned by a new Go-emitted controls golden, the updated meta goldens, and the regenerated scalars.txt vectors.

Docs

  • ABI.md §4.2: declared-controls section (normative rules) + revision ledger entry 6
  • GUIDE.md: "Mobile-friendly controls" authoring section under Players, input, and controls

Verification

go build/vet/test ./... green (incl. new round-trip/presence-guard/validation tests and the truncation-vector updates); cargo test green in rust/ and crossverify/; scalar golden vectors regenerated via the standard WIRE_SCALAR_GOLDEN_WRITE=1 flow.

Changeset: minor.

🤖 Generated with Claude Code

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>
@BCook98
BCook98 merged commit 11886a9 into main Jun 11, 2026
7 checks passed
@BCook98
BCook98 deleted the add-controls-metadata branch June 11, 2026 10:24
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.

1 participant