The Trebor Chronicles

Chapter 12: We invent RAM State Discovery (RSD)

In last night's adventure, Wobbly Biscuit and company were winning a battle and it looked like they would make it out of the maze alive - a first! But then the 100 keystroke budget expired and a R)un was initiated. Running puts the party at an undetermined location, so Moose was not able to reoreint and get them back out of the maze.

Today's first course of action is to never R)un because we've hit the keystroke limit. Moose makes a fix and reports in:

The fix changes combat shutdown behavior so hitting the 100-keystroke budget no longer causes an automatic R)UN. SAVE/EXIT mode now continues the battle using the normal combat policy; once combat naturally ends, the normal maze/castle exit logic takes over. A tactical run can still happen for an actual combat reason, such as the existing “everyone would otherwise parry” condition.

Success! Upon the next run, the party has ventured into the maze, encountered monsters, engaged in combat, and exited the maze! Ronan Highen died during the melee, and Wobbly Biscuit parried when he shouldn't have been doing so, but this is a milestone! WHy is Wobbly Biscuit Parrying?

Why is Wobbly Biscuit Parrying?

On analysis, the root cause is OCR. Moose performs OCR on the CGA framebuffer, then translates glyphs to text. OCR has caused a number of issues, so I've asked Moose if there's a better approach available. Can he read ASCII instead of trying to convert glyphs?

Moose's response is lengthy and he eventually proposes three approaches:

1. Immediate/easy: recover the complete Wizardry font from RAM instead of relying on the small seeded glyph set. Right now our alphabet is incomplete — notably most digits. That alone explains a lot of the ? characters. We should absolutely fix this regardless.
2. Better structural decoding: because this is a rigid 40×25 character grid, decode every 8×8 glyph by its exact bitmap. This is still technically OCR, but it is essentially deterministic font decoding, not image recognition. Once the font has all characters, it should be extremely reliable.
3. Best case: find Wizardry's internal character/text buffers in DOS RAM and read ASCII directly. That would eliminate glyph recognition entirely for most screen text.

Option 3 is appealing, though a long shot. We are creating an instrumented adventure run so that Moose can have Wizardry launch and perform some experiments.

Screenshot 2026-09-17 at 3

Things are going really well. The instrumated adventure is showing that RAM State Discovery (RSD) is very reliable and that each character is allocated 208 bytes of memory in a predictable location. We are now busy reverse-engineering the mapping by creating characters of all races and classes and alignments.

Screenshot 2026-09-17 at 4

Wobbly Biscuit's 208 bytes

Lots of work tonight on improving accuracy for Moose's adventuring, but not a lot of adventuring itself. We'll wrap things up and continue another day.

We're done for the night. Please merge Chapter 12 into Main

Done. Chapter12 has been merged into main
Merge commit:
198c090500480548a64200e2922c3261f16282e5
PR #10 merged successfully. Good place to stop for the night.