Skip to content

Plan the golden battles from the player view and regenerate them - #220

Merged
mmacy merged 3 commits into
mainfrom
chunk/goldens
Oct 31, 2026
Merged

mmacy merged 3 commits into
mainfrom
chunk/goldens

Conversation

@mmacy

@mmacy mmacy commented Oct 31, 2026

Copy link
Copy Markdown
Owner

This finishes issue #209's golden files. The phase 4 delve's generator and the TUI crawler now plan each battle round from the player view, the way a game would. They read each group's front_rank, member_distance_feet, formation_width, and encounter_rate_feet, and they check each plan with preview_battle_round. A member who can reach attacks with move="close", a member who can't closes, and members in reach attack.

Two goldens change, both because the battle rules changed:

  • phase4_delve.json moves from seed 20260715 to 20260757, because no seed in 500 meets the delve's beats with the old driver. Monsters now close and attack in one round, so the old seed's party lost a member.
  • phase5_milestone.json moves from seed 21 to 39. Under the new rules, seed 21's party was wiped out in the vault. The script keeps every beat. Only its town lines (who is healed, who gives coin to whom) changed to fit the new run.

The phase 5 hoard and NPC goldens regenerated byte-identical. The TUI crawler walkthrough's seed and all three transcripts are re-captured from a real run. In the regenerated battles, nobody is reached through the front line, the second row waits until a place opens, and no battle runs past four rounds.

https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD

mmacy added 3 commits October 31, 2026 01:03
The phase 4 driver decided when to close and attack from the group's
distance to the party line and from a private front-rank helper. Under the
member positions of issue #209, members who close to 5' leave that line
distance above 5', so the driver kept declaring close and never attacked.

The driver now plans each round from the public encounter view and checks
each choice with preview_battle_round. A member in the target's front rank
attacks. A member who can reach the target this round, while the front rank
has a place, attacks with move="close". A member who can't closes. The
magic-user's fire ball waits while nobody is in melee with the group, and
her magic missile waits until somebody is.

The golden changed because every battle in it now plays under the new rules:
members close and attack in one round, and monsters close on the nearest
member and attack in the same round. The seed search no longer accepts
20260715, where the fighter dies in the guard room, and settles on
20260757. That run keeps every milestone beat. The keyed goblins rout in
the first round, a wandering fire ball kills eight traders, and the
magic-user's magic missile is disrupted in the crypt.

The chunk: goldens marker comes off the phase 4 golden tests.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
The crawler closed while the group's distance from the party line was above
5' and only then let the front rank attack. Under the member positions of
issue #209 that distance stays above 5' after members close, so the crawler
would close forever.

Each member now takes the first plan the round preview accepts: an attack
from the group's front rank, an attack with move="close" when the member
can reach the group and its front rank has a place, a close, or a hold.
The plan reads the view's declarers, each group's member distances and
front rank, the formation width, and each member's encounter rate.

The milestone golden and the crawler's tests stay marked. Under the new
rules, seed 21 ends the milestone script in a total party kill on level 2,
so the golden can't be regenerated from the script as it stands.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
Under the member positions of issue #209, monsters close and attack in the
same round, and seed 21 ended the milestone script in a total party kill.
The fighter died in the guard room's first round, the thief in the first
vault fight, and the cleric and magic-user in the second. The script was
fitted to seed 21's coin and casualties, so no other seed ran it clean.

Seed 39 runs the same beats with the new crawler and nobody dies: the
goblins rout after one falls, both rival parties die in the vault, the
lair hoard and the rivals' pile are looted, and the idol comes home. At the
end the fighter, the cleric, and the thief reach level 2. The script keeps
its lines and changes only its town business for this run. The temple
heals the cleric, who took the worst of the rivals' blows, and the fighter
and the cleric hand coin to the two members who carry least.

The milestone golden changed because the rules, the seed, and the town
lines all changed what it records. The hoard and NPC-party goldens came
out byte-identical. MILESTONE_SEED moves to 39 in the generator and the
crawler test, and no assertion changed. The TUI walkthrough's transcripts
are re-captured from the seed 39 run, and its prose now names the cleric
as the idol's carrier and says nobody died. The chunk: goldens markers come
off the phase 5 and crawler tests.

Claude-Session: https://claude.ai/code/session_01V7ErtnsmhaP7aLwcfmzohD
@mmacy
mmacy merged commit 667ad6a into main Oct 31, 2026
5 checks passed
@mmacy
mmacy deleted the chunk/goldens branch October 31, 2026 08:14
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