Skip to content

Commit b61a194

Browse files
committed
Populate game input mappings from source controls - PR_26140_122-populate-game-input-mappings-from-source-controls
1 parent 9645a6a commit b61a194

22 files changed

Lines changed: 2216 additions & 928 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# PR_26140_122 - Populate Game Input Mappings From Source Controls
2+
3+
## Summary
4+
5+
- Replaced empty/default `tools.input-mapping-v2.actions` across game manifests with source-derived actions and real input bindings.
6+
- Removed `input-mapping-v2` from `_template` because it has no confidently inferable playable controls; documented as SKIP rather than adding empty placeholders.
7+
- Added `src/engine/input/InputMappingManifest.js` so runtime and tools can normalize manifest bindings through the engine input layer instead of local hidden fallback mappings.
8+
- Wired Asteroids and Space Duel runtime entry points to consume manifest input mappings through existing engine input APIs while preserving their existing direct-launch behavior.
9+
- Updated Input Mapping V2 launch loading so Workspace Manager game manifest data hydrates real action mappings and export/copy continues to omit empty actions.
10+
- Added a minimal `_template` preview asset path so Workspace Manager V2 manifest validation can load the template manifest without asset-manager path errors.
11+
12+
## Source-Control Mapping Audit
13+
14+
- `games/Bouncing-ball`: `Start` = Space, Enter, Pad0 Button 0; `Pause` = KeyP, Pad0 Button 9; `Reset` = KeyR, Pad0 Button 1.
15+
- `games/Breakout`: paddle movement from Arrow/A-D and Pad0 directions/axis; serve, pause, and exit from the source keyboard/gamepad controls.
16+
- `games/Pong`: player/opponent movement, serve, pause, exit, and mode navigation from WASD, arrows, Tab/KeyM/KeyN, and Pad0/Pad1 controls.
17+
- `games/AITargetDummy` and `games/Pacman`: movement, start, reset, and pause from source keyboard/gamepad controls.
18+
- `games/SpaceInvaders`: movement, fire/held fire, start, pause/menu/debug, selection, and initials entry controls.
19+
- `games/GravityWell`: rotate/thrust/brake plus start/record/playback controls.
20+
- `games/SolarSystem`: pause, labels, reset clock, and time-scale hotkeys.
21+
- `games/Asteroids` and `games/vector-arcade-sample`: Asteroids start/continue, ship controls, fire, pause, and initials entry controls.
22+
- `games/SpaceDuel`: existing `ACTION_BINDINGS` plus initials entry controls.
23+
24+
## Validation
25+
26+
- `node --check` passed for changed engine input, Input Mapping V2, game runtime, and Workspace V2 test files.
27+
- Empty action audit passed: every present `tools.input-mapping-v2` action has at least one input; Bouncing-ball has 3 actions, 7 inputs, and 0 empty actions.
28+
- `node scripts/validate-json-contracts.mjs --games --no-samples --no-tools` reported `game_manifest_schema_validation: total=12 invalid=0`; the script still refreshes broader tool/sample inventories, so generated report churn was removed from this PR.
29+
- Workspace Manager V2 `buildContextFromManifest` validation passed for every `games/**/game.manifest.json`, including active tool payload loading.
30+
- Existing launch/control validators were run for AITargetDummy, Bouncing-ball, Breakout, GravityWell, Pacman, Pong, SolarSystem, SpaceDuel, and SpaceInvaders; the Asteroids boot path was separately verified to hydrate an engine `InputMap` from `game.manifest.json`.
31+
- `npm run test:workspace-v2` passed: 71 tests passed.
32+
- Playwright V8 coverage was regenerated. It is advisory only; `src/engine/input/ActionInputService.js` remains a warning because it was not collected by browser V8 coverage in this run.
33+
34+
## Notes
35+
36+
- No schemas were changed.
37+
- No sample JSON was touched.
38+
- No hidden fallback mappings were added.
39+
- Required reports and packaging were generated under `docs/dev/` and `tmp/`.

games/AITargetDummy/game.manifest.json

Lines changed: 160 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -107,95 +107,185 @@
107107
"version": 1,
108108
"engineInputModel": "src/engine/input/InputMap",
109109
"actions": [
110-
{
111-
"action": "cancel",
112-
"label": "Cancel",
113-
"inputs": []
114-
},
115-
{
116-
"action": "confirm",
117-
"label": "Confirm",
118-
"inputs": []
119-
},
120-
{
121-
"action": "fire",
122-
"label": "Fire",
123-
"inputs": []
124-
},
125-
{
126-
"action": "interact",
127-
"label": "Interact",
128-
"inputs": []
129-
},
130-
{
131-
"action": "jump",
132-
"label": "Jump",
133-
"inputs": []
134-
},
135-
{
136-
"action": "menu",
137-
"label": "Menu",
138-
"inputs": []
139-
},
140-
{
141-
"action": "moveDown",
142-
"label": "Move Down",
143-
"inputs": []
144-
},
145110
{
146111
"action": "moveLeft",
147112
"label": "Move Left",
148-
"inputs": []
113+
"inputs": [
114+
{
115+
"source": "keyboard",
116+
"binding": "ArrowLeft:KeyboardHold",
117+
"label": "Keyboard ArrowLeft Hold",
118+
"engine": "KeyboardState"
119+
},
120+
{
121+
"source": "keyboard",
122+
"binding": "KeyA:KeyboardHold",
123+
"label": "Keyboard KeyA Hold",
124+
"engine": "KeyboardState"
125+
},
126+
{
127+
"source": "gamepad",
128+
"binding": "Pad0:Button14:GameControllerDPad",
129+
"label": "Game Controller DPad Left DPad",
130+
"engine": "GamepadInputAdapter"
131+
},
132+
{
133+
"source": "gamepad",
134+
"binding": "Pad0:Axis0-:GameControllerStick",
135+
"label": "Game Controller Axis 0- Stick",
136+
"engine": "GamepadInputAdapter"
137+
}
138+
]
149139
},
150140
{
151141
"action": "moveRight",
152142
"label": "Move Right",
153-
"inputs": []
143+
"inputs": [
144+
{
145+
"source": "keyboard",
146+
"binding": "ArrowRight:KeyboardHold",
147+
"label": "Keyboard ArrowRight Hold",
148+
"engine": "KeyboardState"
149+
},
150+
{
151+
"source": "keyboard",
152+
"binding": "KeyD:KeyboardHold",
153+
"label": "Keyboard KeyD Hold",
154+
"engine": "KeyboardState"
155+
},
156+
{
157+
"source": "gamepad",
158+
"binding": "Pad0:Button15:GameControllerDPad",
159+
"label": "Game Controller DPad Right DPad",
160+
"engine": "GamepadInputAdapter"
161+
},
162+
{
163+
"source": "gamepad",
164+
"binding": "Pad0:Axis0+:GameControllerStick",
165+
"label": "Game Controller Axis 0+ Stick",
166+
"engine": "GamepadInputAdapter"
167+
}
168+
]
154169
},
155170
{
156171
"action": "moveUp",
157172
"label": "Move Up",
158-
"inputs": []
159-
},
160-
{
161-
"action": "pause",
162-
"label": "Pause",
163-
"inputs": []
164-
},
165-
{
166-
"action": "primaryAction",
167-
"label": "Primary Action",
168-
"inputs": []
169-
},
170-
{
171-
"action": "rotateLeft",
172-
"label": "Rotate Left",
173-
"inputs": []
174-
},
175-
{
176-
"action": "rotateRight",
177-
"label": "Rotate Right",
178-
"inputs": []
173+
"inputs": [
174+
{
175+
"source": "keyboard",
176+
"binding": "ArrowUp:KeyboardHold",
177+
"label": "Keyboard ArrowUp Hold",
178+
"engine": "KeyboardState"
179+
},
180+
{
181+
"source": "keyboard",
182+
"binding": "KeyW:KeyboardHold",
183+
"label": "Keyboard KeyW Hold",
184+
"engine": "KeyboardState"
185+
},
186+
{
187+
"source": "gamepad",
188+
"binding": "Pad0:Button12:GameControllerDPad",
189+
"label": "Game Controller DPad Up DPad",
190+
"engine": "GamepadInputAdapter"
191+
},
192+
{
193+
"source": "gamepad",
194+
"binding": "Pad0:Axis1-:GameControllerStick",
195+
"label": "Game Controller Axis 1- Stick",
196+
"engine": "GamepadInputAdapter"
197+
}
198+
]
179199
},
180200
{
181-
"action": "secondaryAction",
182-
"label": "Secondary Action",
183-
"inputs": []
184-
},
185-
{
186-
"action": "select",
187-
"label": "Select",
188-
"inputs": []
201+
"action": "moveDown",
202+
"label": "Move Down",
203+
"inputs": [
204+
{
205+
"source": "keyboard",
206+
"binding": "ArrowDown:KeyboardHold",
207+
"label": "Keyboard ArrowDown Hold",
208+
"engine": "KeyboardState"
209+
},
210+
{
211+
"source": "keyboard",
212+
"binding": "KeyS:KeyboardHold",
213+
"label": "Keyboard KeyS Hold",
214+
"engine": "KeyboardState"
215+
},
216+
{
217+
"source": "gamepad",
218+
"binding": "Pad0:Button13:GameControllerDPad",
219+
"label": "Game Controller DPad Down DPad",
220+
"engine": "GamepadInputAdapter"
221+
},
222+
{
223+
"source": "gamepad",
224+
"binding": "Pad0:Axis1+:GameControllerStick",
225+
"label": "Game Controller Axis 1+ Stick",
226+
"engine": "GamepadInputAdapter"
227+
}
228+
]
189229
},
190230
{
191231
"action": "start",
192232
"label": "Start",
193-
"inputs": []
233+
"inputs": [
234+
{
235+
"source": "keyboard",
236+
"binding": "Enter",
237+
"label": "Keyboard Enter Press",
238+
"engine": "KeyboardState"
239+
},
240+
{
241+
"source": "keyboard",
242+
"binding": "Space",
243+
"label": "Keyboard Space Press",
244+
"engine": "KeyboardState"
245+
},
246+
{
247+
"source": "gamepad",
248+
"binding": "Pad0:Button0:GameControllerButtonPress",
249+
"label": "Game Controller Button 0 Btn Press",
250+
"engine": "GamepadInputAdapter"
251+
},
252+
{
253+
"source": "gamepad",
254+
"binding": "Pad0:Button9:GameControllerButtonPress",
255+
"label": "Game Controller Button 9 Btn Press",
256+
"engine": "GamepadInputAdapter"
257+
}
258+
]
194259
},
195260
{
196-
"action": "thrust",
197-
"label": "Thrust",
198-
"inputs": []
261+
"action": "reset",
262+
"label": "Reset",
263+
"inputs": [
264+
{
265+
"source": "keyboard",
266+
"binding": "KeyR",
267+
"label": "Keyboard KeyR Press",
268+
"engine": "KeyboardState"
269+
},
270+
{
271+
"source": "gamepad",
272+
"binding": "Pad0:Button1:GameControllerButtonPress",
273+
"label": "Game Controller Button 1 Btn Press",
274+
"engine": "GamepadInputAdapter"
275+
}
276+
]
277+
},
278+
{
279+
"action": "pause",
280+
"label": "Pause",
281+
"inputs": [
282+
{
283+
"source": "keyboard",
284+
"binding": "KeyP",
285+
"label": "Keyboard KeyP Press",
286+
"engine": "KeyboardState"
287+
}
288+
]
199289
}
200290
]
201291
}

0 commit comments

Comments
 (0)