Add platformer locomotion slice

This commit is contained in:
2026-04-16 12:32:38 +02:00
parent 45181d1f78
commit 21a8b8bedb
15 changed files with 604 additions and 28 deletions

View File

@@ -20,6 +20,7 @@ The user-visible outcome is not merely “new projects were added.” The outcom
- [x] (2026-04-16 09:46Z) Implemented the first runnable simulation spine with `Simulation`, `SimulationState`, `WorldSnapshot`, `TickActionBatch`, deterministic fixed-tick movement, deterministic random advancement, and per-tick state hashes.
- [x] (2026-04-16 09:46Z) Implemented versioned save/load, replay recording, replay playback, and the `None`, `RoundTripState`, and `RoundTripAndStepClone` verification modes with deterministic unit coverage.
- [x] (2026-04-16 10:34Z) Added the first data-driven level runtime slice: world bounds clamping, hazard damage resolution, one-shot trigger activation, and serialization coverage for health plus activated triggers.
- [x] (2026-04-16 11:26Z) Added the first platformer locomotion slice: authored solid platforms, configurable platformer motion, grounded state, gravity, jump buffering, coyote-time jumps, and deterministic save/load coverage for the new runtime fields.
- [ ] Implement deterministic movement, collision, damage resolution, triggers, and the fixed tick pipeline with exhaustive simulation tests.
- [ ] Implement data-driven definitions for heroes, enemies, weapons, projectiles, pickups, modifiers, squads, encounters, and level runtime data.
- [ ] Implement Godot host adapters for input translation, fixed-step execution, interpolation, presentation mapping, sound playback, music transitions, and debug transport controls.
@@ -44,6 +45,8 @@ The user-visible outcome is not merely “new projects were added.” The outcom
Evidence: the simulation tests replay hashes successfully after round-tripping `ReplayRecordSerializer` and `Simulation.SaveState` payloads.
- Observation: the first meaningful gameplay slice can stay fully data-driven by modeling the level as world bounds plus axis-aligned hazards and triggers, while still preserving deterministic hashes and save/load behavior.
Evidence: the latest simulation tests clamp movement to authored bounds, apply hazard damage, and persist activated trigger ids through `Simulation.SaveState`.
- Observation: preserving the earlier free-move controls while introducing platformer locomotion is easier if platformer motion is explicit per player definition rather than implied for every actor immediately.
Evidence: the existing deterministic movement tests still exercise direct axis motion, while the new platformer tests author `UsesPlatformerMotion`, gravity, jump velocity, and support geometry without regressing the earlier coverage.
## Decision Log
@@ -68,12 +71,15 @@ The user-visible outcome is not merely “new projects were added.” The outcom
- Decision: start Milestone 4 with axis-aligned world bounds, hazards, and one-shot triggers before tackling richer collision geometry or combat systems.
Rationale: this delivers the first data-driven fixed-step gameplay rules with low implementation risk and keeps the deterministic test surface small enough to maintain 100 percent coverage.
Date/Author: 2026-04-16 / Codex
- Decision: introduce platformer locomotion as an authored capability on `PlayerDefinition` instead of replacing the existing free-move controls in one commit.
Rationale: that keeps earlier deterministic tests stable, lets the simulation support both bootstrap movement styles during the transition, and provides a controlled seam for later host integration.
Date/Author: 2026-04-16 / Codex
## Outcomes & Retrospective
At the moment, the outcome is a corrected planning artifact rather than finished gameplay infrastructure. The original groundwork note has been converted into a proper ExecPlan that a future contributor can execute step by step. No simulation code, tests, or host adapters have been implemented yet, so the gap between purpose and delivered software remains the actual implementation work described below.
The repository now has a real deterministic simulation foundation instead of only a planning note. The pure `SideScrollerGame.Sim` project owns the fixed-point math layer, deterministic stepping, save/load, replay, verification, world bounds, hazards, triggers, authored solid platforms, and the first configurable platformer locomotion rules. Fast .NET tests now prove state hashing, replay fidelity, state persistence, grounded transitions, coyote-time jumps, and jump buffering without starting Godot.
The main lesson from this rewrite is that the repository already contains enough concrete structure to support a precise plan. The plan therefore names real files, current commands, and migration-safe steps instead of speaking in abstract architecture terms.
The main remaining gap is breadth, not existence. Richer collision, combat, enemies, authored content compilation, and the Godot host adapters are still unfinished, but the current code already demonstrates the intended architecture: gameplay authority in pure .NET, deterministic behavior proven by tests, and Godot positioned as the host rather than the rules engine.
## Context and Orientation