Action model and deterministic resolution #7

Open
opened 2026-08-06 21:51:49 +00:00 by icub3d · 0 comments
Owner

The core of the simulation/presentation split (CLAUDE.md). An action is submitted,
resolution computes the entire outcome immediately, and the outcome is emitted as
events. Nothing in resolution waits on an animation, a frame, or a tween.

Scope

  • Action enum: Move, Attack, Wait. Bounded and closed — this is the same
    discipline the M3 effect primitives will need.
  • Outcome events describing exactly what happened: who moved along which path, who
    took how much damage, who died.
  • A CombatRng resource carrying a seeded RNG, threaded through resolution. Resolution
    never touches an unseeded RNG.
  • Validation: an illegal action is rejected before it mutates anything.

Acceptance criteria

  • Resolution is a pure function of (state, action, seed) — the same three inputs
    always produce the same outcome. Asserted by a test that replays a sequence.
  • Resolution compiles and runs with no rendering plugins present.
  • Illegal actions (out of range, insufficient AP, dead target) are rejected with a
    reason, and leave state untouched.
  • Every number the player would need to judge the action is available before it is
    committed — pillar 4. A preview path exists even if no UI consumes it yet.

Notes

Worth an ADR on the action/outcome boundary, since netcode (M7) and replays depend on it.

The core of the simulation/presentation split (`CLAUDE.md`). An action is submitted, resolution computes the *entire* outcome immediately, and the outcome is emitted as events. Nothing in resolution waits on an animation, a frame, or a tween. ## Scope - `Action` enum: `Move`, `Attack`, `Wait`. Bounded and closed — this is the same discipline the M3 effect primitives will need. - `Outcome` events describing exactly what happened: who moved along which path, who took how much damage, who died. - A `CombatRng` resource carrying a seeded RNG, threaded through resolution. Resolution never touches an unseeded RNG. - Validation: an illegal action is rejected before it mutates anything. ## Acceptance criteria - [ ] Resolution is a pure function of (state, action, seed) — the same three inputs always produce the same outcome. Asserted by a test that replays a sequence. - [ ] Resolution compiles and runs with no rendering plugins present. - [ ] Illegal actions (out of range, insufficient AP, dead target) are rejected with a reason, and leave state untouched. - [ ] Every number the player would need to judge the action is available before it is committed — pillar 4. A preview path exists even if no UI consumes it yet. ## Notes Worth an ADR on the action/outcome boundary, since netcode (M7) and replays depend on it.
Sign in to join this conversation.
No description provided.