Skip to content

Add save files for all 6 benchmark scenarios#17

Merged
jkbennitt merged 4 commits intomasterfrom
feature/scenario-save-files
Apr 12, 2026
Merged

Add save files for all 6 benchmark scenarios#17
jkbennitt merged 4 commits intomasterfrom
feature/scenario-save-files

Conversation

@jkbennitt
Copy link
Copy Markdown
Member

@jkbennitt jkbennitt commented Apr 12, 2026

Summary

  • Adds 5 missing .rws save files to docker/saves/ so all 6 benchmark scenarios can run end-to-end (local and Docker)
  • New scripts/create_scenario_saves.py generates saves programmatically from the crashlanded base via XML manipulation — no manual RimWorld dev mode needed
  • Clones colonist pawns (remapped thing IDs, hediff/gene loadIDs, cleared social relations) and inserts scenario-specific item stacks
Scenario Difficulty Colonists Items
First Winter Medium 3 (base)
Toxic Fallout Rough 4 (+Val) wood, food, steel
Raid Defense Rough 5 (+Val, Jin) weapons, armor, steel, wood, components
Plague Response Rough 5 (+Val, Jin) medicine, food
Ship Launch Hard 5 (+Val, Jin) steel, components, plasteel, gold, uranium

Test plan

Automated (no game needed):

  • CI passes (lint, mypy, pytest)
  • python scripts/run_benchmark.py --smoke-test --ticks 2 completes all 6 scenarios
  • python scripts/create_scenario_saves.py --phase b is idempotent (re-running produces identical files)

Manual (requires RimWorld + RIMAPI):

  • Load each save via RIMAPI: curl -X POST http://localhost:8765/api/v1/game/load -H "Content-Type: application/json" -d '{"file_name":"rle_first_winter_v1"}' (repeat for all 5 new saves)
  • Verify each save loads without XML corruption errors in the RimWorld log
  • Verify colonist count matches expected population (3, 4, or 5)
  • Verify cloned colonists (Val, Jin) appear in the colonist bar and are controllable
  • Verify spawned items are on the ground near colony center and unforbidden
  • Run at least 5 ticks of each scenario to confirm agents can deliberate against the game state (all 6 scenarios, OpenRouter Nemotron 120B paid, ~$0.11 total)

Stretch (Docker):

  • docker run with all 6 saves mounted via rimworld-linux + rimapi-mod volumes (port 8766)
  • Each save loads correctly inside the container (6/6 PASS, correct colonist counts)

🤖 Generated with Claude Code

jkbennitt and others added 4 commits April 12, 2026 15:13
Phase A of scenario save creation: copies the crashlanded base save
and patches the difficulty XML field for each scenario (Medium, Rough,
or Hard). Adds create_scenario_saves.py script with Phase B checklist
for manual dev-mode pawn/item spawning on scenarios needing 4-5 colonists.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase B: script now clones Thing_Human184 via XML manipulation to add
colonists for 4-5 pop scenarios. Remaps thing IDs, hediff/gene loadIDs,
clears social relations, and inserts scenario-specific item stacks.

- Toxic Fallout: 4 colonists, wood/food/steel
- Raid Defense: 5 colonists, weapons/armor/steel/wood/components
- Plague Response: 5 colonists, medicine/food
- Ship Launch: 5 colonists, steel/components/plasteel/gold/uranium

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The set-forbidden endpoint (PR #65) handles unforbidding at runtime
in run_scenario.py. No need to mutate save XML.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The RIMAPI DDD refactor wraps /api/v1/map/things in
{success, data, errors}. Our client expected a raw list,
so unforbid_all_items silently found 0 items every time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jkbennitt
Copy link
Copy Markdown
Member Author

All test plan items verified:

Live game (OpenRouter Nemotron 120B paid):

  • 6/6 scenarios ran 5 ticks each, all colonists survived
  • unforbid_all_items() fix confirmed working (55 items per scenario)
  • Scores: crashlanded 0.861, first_winter 0.895, toxic_fallout 0.862, raid_defense 0.848, plague_response 0.885, ship_launch 0.741
  • Total cost ~$0.11

Docker:

  • Container started with rimworld-linux + rimapi-mod volumes, saves mounted from docker/saves/
  • 6/6 saves loaded successfully with correct colonist counts (3/3/4/5/5/5)

@jkbennitt jkbennitt merged commit d119fd2 into master Apr 12, 2026
6 checks passed
@jkbennitt jkbennitt deleted the feature/scenario-save-files branch April 12, 2026 23:58
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