Friday 25 May 2018

Saving (and Loading!)

Hi all - Steve here.  I’m a programmer working on Off Grid - and I’ve had the pleasure of working on save systems recently.  :)

Ha!  This is really one of the short straws of game development.  When I was at Sony, it was almost a rite of passage; these were the days that not only did you have to save and load, but you were responsible for ensuring things didn’t die when the memory card (remember those?) was pulled out mid-operation.

Prior to this month, we had the beginnings of a save system in place, but were aware that certain things didn’t seem to be working quite as they should - so I took a look.

What I discovered was that we kept a save in memory as well as writing it to disk.  This is a good thing - loading a checkpoint is faster.  But a side effect was that there were two code paths to reinstating a save - to load it from disk, or to just reference the save data as game data.  The danger with this is that the in-memory data can reference ‘live’ game data, which means the save on disk diverges with this during gameplay.  Lots of copying data later, the bits that weren’t working quite correctly now seem much happier.

The other work I’ve done was on a system level.  Saving and loading requires making a list of all the files available. Previously, we loaded all of these into memory - but as we cannot know how big they’re going to be, this will eventually cause us all sorts of problems. I’ve instead created a header at the top of each save file, containing the information we need to present to the player. Load the first 1000 bytes or so of each file, grab the header, close the file.

Saving and loading done then? Certainly not!  We will still have new data that needs to be added to our save structure, and I bet there are still some bugs in there.  But I’m confident that we are on firmer ground than we were a month ago.

Til next time!


Thursday 17 May 2018

Sprint Round Up - 17.05.18 - A different approach

Hello loyal devlog readers!

We’be been blogging about for awhile now, and think it’s time we change up the the way we’re approaching it.  There’s SO much going into each development sprint that we want to make it easier to understand what we’ve been doing.

From here on out, at the end of each sprint, we’ll be putting together a roundup of the development achievements each sprint, and then breaking the detail out into individual posts every week or two.  It means you’ll get more regular updates from us, and they should be a bit more bitesized and cover a specific theme or area across the last month of development.

Keep an eye out for Steve’s next post on save systems - coming soon!

Now for the sprint round up: