Page 1 of 1

Unbreaking save files

Posted: Mon Mar 21, 2016 3:17 am
by ibanix
I know stunt has some magic to fix broken save files, which I'd love to know.

I've crawled around in game.teag and {zonefile}.teaz. It seems like the major way to get things "back to normal" without distrupting the rest of the game details lies in the Player and Zone files.

A few questions:

d["x"] and d["y"] refer to the position of the player on the current zone, yes?
Are d["wild_x"] and d["wild_y"] for previous position on the wilderness map?
What is the function of the very large distance_map array?
What is the purpose of '__savefile_version_tokens' in main?

Thanks in advance.

Re: Unbreaking save files

Posted: Thu Mar 24, 2016 4:03 am
by Zizzo
ibanix wrote:d["x"] and d["y"] refer to the position of the player on the current zone, yes?
Are d["wild_x"] and d["wild_y"] for previous position on the wilderness
map?
Yes and yes.
ibanix wrote:What is the function of the very large distance_map array?
That's the precomputed field-of-view cache, as maintained by the methods in engine.interface.ActorFOV.
ibanix wrote:What is the purpose of '__savefile_version_tokens' in main?
[sound F/X: source diving] Something to do with checking savefile validity AFAICT. It's populated in Game:saveVersion(), which is called from a couple places in engine.SavefilePipe.