121 lines
5.0 KiB
Markdown
121 lines
5.0 KiB
Markdown
# P9.2 Authoritative Automatic Battle Contract
|
|
|
|
> Revision: `p9.2-contract-r1`
|
|
> Baseline: P9.1 source `cca5eae6247f37dc4ee51770819adb6ddfc51cc5`
|
|
> Scope: one deterministic post-first-session encounter
|
|
|
|
## 1. Experience Contract
|
|
|
|
- **Fantasy:** command a small Guild line through a dangerous breach without
|
|
manually firing skills.
|
|
- **Primary action:** commit the expedition and watch the selected professions
|
|
physically advance and execute their jobs.
|
|
- **Immediate result:** within one second the party and enemy lines move; first
|
|
contact visibly stops the melee line and starts authoritative attacks.
|
|
- **Automation:** movement, targeting, attacks, healing and cooldowns resolve
|
|
automatically from fixed-tick state.
|
|
- **Bottleneck:** current member HP, enemy HP, contact pressure and remaining
|
|
time are visible at all times.
|
|
- **Recurring decision:** continue for the victory or retreat after tick 50 to
|
|
avoid a worse result. Retreat value changes with the visible battle state.
|
|
- **Mastery:** learn when each profession stabilizes, accelerates or fails the
|
|
line and recognize a recoverable versus collapsing position.
|
|
- **Continuation:** the result names the cause and the exact future system that
|
|
P9.3 will add; it does not pretend persistence already exists.
|
|
|
|
## 2. Fixed Encounter Fixture
|
|
|
|
The first implementation uses one source-bound fixture named
|
|
`BREACH_WATCH_01`. It is deterministic and intentionally narrow.
|
|
|
|
### Player line
|
|
|
|
The encounter imports the current P9.1 `field_order`, stable member IDs, levels
|
|
and end-of-session HP. If a test starts the encounter directly, its fixture must
|
|
provide the same fields explicitly.
|
|
|
|
| Profession | Max HP | Automatic action |
|
|
|---|---:|---|
|
|
| Hearthguard | 130 | Contact guard strike; lowers the next incoming melee hit. |
|
|
| Wayrunner | 100 | Fast contact strike; gains a flank hit when not first. |
|
|
| Farstring | 85 | Ranged shot from behind the contact line. |
|
|
| Kindhand | 90 | Heals the lowest-ratio living ally below 80%; otherwise makes a weak ranged hit. |
|
|
|
|
### Enemy line
|
|
|
|
| Enemy | Max HP | Automatic action |
|
|
|---|---:|---|
|
|
| Rift Bulwark | 180 | Advances to contact and attacks the first living Guild member. |
|
|
| Rift Spitter | 110 | Remains behind the Bulwark and attacks the lowest-HP-ratio living member. |
|
|
|
|
Numbers are fixture authority for P9.2 only. They are not the final campaign
|
|
economy or content values.
|
|
|
|
## 3. Simulation Rules
|
|
|
|
- Fixed tick: `100 ms`.
|
|
- Encounter timeout: tick `900` (`90 s`).
|
|
- Positions are integer logical units on one horizontal axis.
|
|
- Guild starts left and advances right; enemies start right and advance left.
|
|
- Melee units stop when the distance to the opposing first living unit is at or
|
|
below their contact range.
|
|
- Ranged units never move ahead of the current Guild contact member.
|
|
- One actor may resolve at most one action per tick.
|
|
- Dead actors act zero more times and are excluded from targets immediately
|
|
after the resolving event batch.
|
|
- Victory: all enemies reach zero HP.
|
|
- Defeat: all deployed Guild members reach zero HP.
|
|
- Timeout: neither victory nor defeat at tick 900.
|
|
|
|
Each accepted tick emits an ordered event list. The outcome snapshot stores an
|
|
event hash and state hash. Rendering and audio consume events but never mutate
|
|
simulation authority.
|
|
|
|
## 4. Controls
|
|
|
|
| Control | Rule |
|
|
|---|---|
|
|
| Pause | Freezes accepted simulation ticks; UI/inspect remains responsive. |
|
|
| 1x / 2x | Changes how many fixed ticks are requested per wall-time interval; never changes event order or result. |
|
|
| Inspect | Opens recent authoritative events and current actor facts; state mutation is forbidden. |
|
|
| Retreat | Disabled before tick 50. First accepted command records one retreat-start tick. Duplicate commands return the original receipt. |
|
|
|
|
Retreat resolves at `accepted_tick + 20`. Actors may continue to resolve events
|
|
during withdrawal. If victory or defeat locks first, that outcome wins. A
|
|
completed retreat grants no Coin and applies no permanent casualty in P9.2.
|
|
|
|
## 5. Result Grammar
|
|
|
|
Every terminal page displays, in this order:
|
|
|
|
1. Outcome: victory, defeat, timeout or retreat.
|
|
2. Cause: the decisive event or unmet objective.
|
|
3. Survivors: stable member IDs and current HP.
|
|
4. Cost/reward: P9.2 victory uses one fixture receipt; other results grant zero.
|
|
5. Next: Home/Restart, plus an explicit note that persistent casualty/recovery
|
|
remains a later system.
|
|
|
|
No result may say a fallen member was permanently removed or restored.
|
|
|
|
## 6. Step Ownership
|
|
|
|
| Step | Owned paths |
|
|
|---|---|
|
|
| Contract | this file, Goal, plan, checkpoint, ledger |
|
|
| Domain | `runtime/domain/p9_2/`, `runtime/tests/p9_2/authoritative_battle_domain_test.gd` |
|
|
| Runtime UI | `runtime/main.gd`, P9.2 presentation adapters and focused UI test |
|
|
| Result/handoff | P9.2 result UI and result test only |
|
|
| Integrated gate | P9.2 runners/evidence docs and H5 delivery record |
|
|
|
|
## 7. Legal Terminal
|
|
|
|
```text
|
|
Aetherbound Guild P9.2 authoritative battle candidate ready
|
|
```
|
|
|
|
or:
|
|
|
|
```text
|
|
Aetherbound Guild P9.2 redesign required: <earliest failed product boundary>
|
|
```
|