Re: Savegame editing

From: outis02 <uly_at_...>
Date: Wed, 04 Nov 2009 12:58:15 -0000


Oh, forgot to mention a few things.

First of all, sorry that the code is terribly commented. Feel free to ask any questions though. In general, all variables that start with an _underscore implies uncertainty; and ct is short for count, usually designating the number of structs that follows.

One of the most important observation you can make is that, overall, KoDP stores data in alphabetical order instead of grouping data according to functions. For example, you'll find a clan's Cattle value next to Barley and Children, instead of with Sheeps and Pigs. While it doesn't make the code very neat to read, it does help guessing the meaning of a data quite a lot.

> So, what do you typically use it for?
>
> Listing saved game inner secrets to see what affects what? Any heroquest tips?
>
> Or do you change a saved game? Any interesting or fun changes?
>
> Any signs of test code? Things like a flag that makes your battles always succeed?
>
> - Alex

I've worked at a very leisurely pace for about 6 months. I hadn't been very efficient since every time I picked it up again, I'd forgotten some of the things I'd learned. I really should have commented the whole thing better. As I explained, I don't really have any specific purpose in mind doing this; just want to see what's under the hood. The parse is complete enough to test out a variety of scenarios, though.

Here's a few interesting (at least for me) observations I've made:

The games keeps track of how many time each leader name is randomly assigned, and (probably) assigns new random names based on past usage.

In the code, the default clans are conveniently named "elmalClan", "pigClan", "prosperousClan", etc. Interestingly, the potClan (with fertile fields) is the only default Ernalda clan, and elmalClan (fine horses) is of course the only default Elmali clan. The tavernClan (careful planning) does in fact have Argan Argar as their chief deity, whereas uroxClan (hatred of chaos) and vingaClan (female chieftains), and all other clans that seem to worship a different deity are just simple Orlanthi clans.

Most groups in the game, such as the Humakti, the Elves and the Praxian are tracked as clans in their own right. But as far as I can tell the only purpose seems to be to allow for clan relation data.

The great majority of event data are stored in the Vars section: some of game constants, most of event-related variables, and some leader and clan attributes. I managed to find out what exactly variable is, but I don't remember how. Probably from peaking in the exe or the opal package file. I put that finding in the #include KoDPinc.bt file, I can post it if anyone's interested. On the other hand, some vars that you'd expect to see in here, such as _LunarWar, has its own dedicated data location for some reason.

One thing that interest me particularly is the leaders' personality traits. There are some 32 traits altogether, but I've only been able to figure out 10 or so, some of which with the help of the code snippet posted on A#'s site. More than anything else, this is something I'd like to parse completely.

I've also found that the map blocks are separated into "regions", each with their proper name, too. The region that the player starts out in, for example, is called Arfritha, with Lorthing to the east. The Colymar tribe typically occupies the Nymie, Starfire and Lismelder regions. But no, as far as I know the regions has no bearing on the gameplay and are never mentioned.

And no, I haven't found any test codes. Haven't even thought of looking, really. There are some stuff in the Vars like attackBonus that you can jack way up. Not sure how long it lasts though.

Lastly, I think I've exhausted most things that can be readily parsed tested. I'd love to hear more ideas on what other tests I could do.

Powered by hypermail