Skip to content

0.44.0 — What is inside a saved game

Pre-release
Pre-release

Choose a tag to compare

@huntergdavis huntergdavis released this 18 Sep 18:27
· 221 commits to main since this release

0.44.0 — What is inside a saved game

Research, like 0.43.0: nothing in the app looks different yet. This is what the
loading, saving and converting all stand on.

The characters are in the resource fork

A saved game is an ordinary Macintosh file with two forks, about 17 KB. The
single most useful fact is where the party is kept: not in the data fork at
all.

The resource fork holds one PoRc resource per party member, in party
order, each named with the character's own name — and each one is the same
302-byte record the running game holds in memory.
Every offset this project
found by reading the game's own 68k code applies unchanged.

The confirmation came from the pair of saves on the disk, the same party healed
and injured. They differ inside a character resource at exactly the bytes the
in-memory layout predicts and at no others — current hit points at 0x12b,
attacks remaining at 0x120 — while maximum hit points, class and the ability
scores stand still. Reading a real fighter gives 18/15/14/17/16/16 with an
exceptional strength of 47, which is an 18/47 fighter and not a coincidence.

The data fork is the world

Where What
0x120c where the party is standing
0x125a the last message shown — "YOU SPY A GROUP OF SEEDY-LOOKING KOBOLDS." in one save, orcs in the other
0x1400–0x31ff the world state, 7.7 KB, dense in a played save and entirely absent from an unplayed one
last 96 bytes the six party names, sixteen apiece, ending exactly at the end of the file

Three things deliberately left open

  • The world-state block is located but not decoded. What is in it — visited
    squares, encounter flags, what has been taken — is the next question, and is
    now tracked as F84 rather than guessed at.
  • An item block is roughly but not exactly 66 bytes. Five items produce
    tails of 330, 340 and 370 bytes in different characters, so something inside
    one varies.
  • The data fork's numbers read low byte first, which is not what a 68k
    program usually does. Either they are bytes with padding, or the file kept a
    little-endian layout from the DOS line. Until that is settled, nothing here is
    written down as a 16-bit field — it matters for the converter.

Verified

507 Java tests including eight new ones against a resource fork built from the
Macintosh specification, six native probe suites, 25 render checks. The same
reader was run against all three real saved games on the owner's disk: it
reports every member's class, hit points, movement, item count and ability
scores, and correctly refuses PoRCharacters as holding no party.

Download the public APK
and install over the existing app. Bring your own ROM, Mac system and game;
none are included.