feat: SaveGame party position #485

Merged
jqueuniet merged 16 commits from feat/483-party-position into main 2026-11-14 20:05:37 +01:00
Owner

Closes #483.

SaveGame.partyPosition() → {map, x, y, dir} and setPartyPosition(map, x, y, dir) (wasm, FFI, Python).

  • Facing turns the formation. Champion records hold their facing (0x1c) and formation cell (0x1d); set_party_position now turns both as an in-game turn does (skproject ROTATE_SQUAD). Fixes the flipped ranks the oracle showed; the CLI warning and the doc caveat are gone.
  • Standable tiles only. SaveDump::set_party_position checks the live dungeon (#482) and refuses walls, map exits, closed doors and trick walls, open pits (the engine's step rule), stairs, open teleporters, and any creature (the not-solid flag lives in the executable). The CLI path (SaveFileFull) keeps bounds checks only.

In-game check pending: DOS sksave0 turned west → east in place.

Known gaps: Mac dump path untested (the turn is per byte); binding args wrap when out of range, as the level_* ones do; the Python README omits these and #482's methods.

Closes #483. `SaveGame.partyPosition()` → `{map, x, y, dir}` and `setPartyPosition(map, x, y, dir)` (wasm, FFI, Python). - **Facing turns the formation.** Champion records hold their facing (`0x1c`) and formation cell (`0x1d`); `set_party_position` now turns both as an in-game turn does (skproject `ROTATE_SQUAD`). Fixes the flipped ranks the oracle showed; the CLI warning and the doc caveat are gone. - **Standable tiles only.** `SaveDump::set_party_position` checks the live dungeon (#482) and refuses walls, map exits, closed doors and trick walls, open pits (the engine's step rule), stairs, open teleporters, and any creature (the not-solid flag lives in the executable). The CLI path (`SaveFileFull`) keeps bounds checks only. In-game check pending: DOS `sksave0` turned west → east in place. Known gaps: Mac dump path untested (the turn is per byte); binding args wrap when out of range, as the `level_*` ones do; the Python README omits these and #482's methods.
feat(bindings): SaveGame.partyPosition and setPartyPosition
All checks were successful
CI / msrv (1.90) (pull_request) Successful in 30s
CI / audit (pull_request) Successful in 19s
CI / stable (pull_request) Successful in 58s
CI / python bindings (3.11) (pull_request) Successful in 27s
70ef5cf812
docs: note champion raw validation in #483 changelog entry
All checks were successful
CI / msrv (1.90) (pull_request) Successful in 28s
CI / audit (pull_request) Successful in 20s
CI / stable (pull_request) Successful in 59s
CI / python bindings (3.11) (pull_request) Successful in 27s
CI / msrv (1.90) (push) Successful in 59s
CI / audit (push) Successful in 26s
CI / python bindings (3.11) (push) Successful in 51s
CI / stable (push) Successful in 2m28s
2f25819c9c
jqueuniet deleted branch feat/483-party-position 2026-11-14 20:05:37 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools!485
No description provided.