[Solved] How do interpreters store save-games?

Maybe one day this will be important to me for writing an interpreter or tweak an existing one. But for now it is just out of curiosity, not because of practical need: How do the interpreters (Z-code, TADS, etc.) store game save files? Or more precisely: What do they store?

3 Likes

Simple answer: Z-code (and Glulx) terps store the entire memory of the virtual machine, plus the stack.

The full answer is better optimized. The interpreter doesn’t have to save read-only memory locations (because they can never change, so they are still what the original game file says they are). It also uses a simple compression scheme to skip saving memory values which could change, but have not. But that’s the idea.

TADS does something similar, but the memory store is more object-oriented so saving it is a messier problem. Same idea though.

5 Likes