Aug. 9th, 2007

davidn: (prince)
To deal with the requirement of unmodifiable saves for the online aspect of the game, I've finally got down to converting the entire save system from INIs into using the Named Variable Object. This is probably the single biggest refinement I've put into the game, but it's going surprisingly fast - the level progress loading and saving is completely finished, and even the pause menu is about halfway done. The records of picked up items needs some work, as I'm going to have to decide on a way to make sure that I can keep track of what rewards are on offer for each level.

The great advantage of using the NVO is that, in combination with global "functions" called using fastloops, I can switch easily between human-readable saves (handy for testing) and obfuscated ones (for the release). Eventually, the level data will also have to be converted to NVO rather than INI so that it can't be modified either, but if I write a fastloop to do each of them, then I can switch them all over (pulling them through a conversion tool, probably) and just change the events to point to .CT2 files instead of the .CSV that I'm using for the plaintext saves. (I did try XML at first, but the Named Variable Object seems to have huge problems loading those up reliably).

In doing this, I'm consolidating the four very obvious plaintext files (items, progress, spells, synth) into one combined save file for each player. Items and Progress are easy to do - in fact, I've no idea why I decided that these should be separate files in the first place - but the real challenge is keeping track of lists in a format that only allows keys and values. I've done this for spells in a way that is dangerously close to pointer arithmetic, with an index value being added to the key name depending on where I'm reading from.

That's fine for things like spell lists, where you put things in and never, ever take them out, but the Synth list is going to need some extra thought. For removal, I'll probably have to hack in a fastloop like what they teach you when you're beginning to learn about arrays - take one out, copy the rest down one place, obliterate the one at the end.

So I have to try and not be disappointed that all this work is going to lead me eventually to being in exactly the same place that I was before - because after things like this are done, I'll eventually get to level-building. (There's another one on the way.)

Expand Cut Tags

No cut tags

May 2020

S M T W T F S
     12
3456789
1011121314 15 16
171819 20 212223
24252627 28 2930
31      

Most Popular Tags

Style Credit

Page generated Aug. 14th, 2025 12:20 am
Powered by Dreamwidth Studios