Skip to content

Port: fix dungeon crashes from PC memory and map staging limits - #97

Merged
Adubbz merged 1 commit into
TheMoonPeople:masterfrom
millerscout:fix/port-memory-budgets-upstream
Oct 18, 2026
Merged

Adubbz merged 1 commit into
TheMoonPeople:masterfrom
millerscout:fix/port-memory-budgets-upstream

Conversation

@millerscout

Copy link
Copy Markdown
Contributor

Summary

Fixes PC dungeon crashes from:

  1. Character stacks — ArenaOverflow on human model stack 0 at the retail 68500 qw cap when entering dungeons with datapack JSON.
  2. Map staging — LoadMapData chains floor assets into BuffReadData with no retail bounds check; large PC floors (e.g. d04f01s) exceeded the 200k qw buffer and overwrote later MainBuffer objects (TreasureBoxMan, CMonsterMan, etc.).

Approach: port_memory_budget.hpp deltas, larger main_buffer / BuffReadData, dedicated arenas for dungeon monster/FX singletons, PortAssertDungeonReadCursor, stage rest checks, docs in docs/PC.md, and tests (CharaMemBudget, DungeonMapStaging, DungeonStageBudget, headless dungeon smoke when port/run is present).

Rebased on current master (includes #72, #78, quick loadout, etc.).

Test plan

  • ctest -R 'CharaMemBudget|DungeonMapStaging|DungeonStageBudget' with port/run data
  • CI: darkchronicle_tests
  • Manual: room that loads d04f01s via _LOAD_DUNGEON_MAP_FILE

Raise character model stack budgets and main_buffer headroom, isolate dungeon monster/FX arenas from MainBuffer, and enlarge BuffReadData with staging guards and tests so large floor maps (e.g. d04f01s) cannot overwrite later globals.
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 17, 2026
millerscout added a commit to millerscout/ChronicleTwo that referenced this pull request Oct 18, 2026
@Adubbz
Adubbz merged commit 4555368 into TheMoonPeople:master Oct 18, 2026
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.

2 participants