Sunday, 30 May 2010

Save and load

Implementing save and load routines for the level. I want to be able to move around in the dungeon and can't do that until the level can be saved and loaded, because there  is only one level in memory at a time. Reason for that is probably just my old fashioned thinking, but then again one level of Kaduria takes surprisingly lot of memory. I want to keep the memory footprint small just in case.

Programming save and load for Kaduria is more difficult than in Teemu, but I'm actually using Tar_Ball technology I made for Teemu. It might be ugly, but it's working and I have it ready for action. Someone might argue that I should use "real" serialization, but I want to keep some kind of control in save/load so I know exactly what goes in and out, and when.

To keep things simple I really need that initialization in U_Actor's constructor I was talking about earlier. It's really easier to properly initialize the object so you can then load the values, rather than go too shallow end in the class hierarchy. U_Actor is going to keep me busy for couple of days, then there are derived classes like monster, item and the player's class.

Other than object data should be a lot easier to save and load. I'm really happy if I can make this all in let's say three days or something like that. Then I can navigate through the dungeon and see how it looks.

No comments:

Post a comment