Post news RSS Loading and Saving

BoS now supports loading and saving. So like most other games you can load and come back later. Not exciting, but represents quite a bit of effort.

Posted by on

Loading and Saving
This was a totally ignored feature that needed to get done, so I took a week from normal development to get this nightmare feature implemented. Loading and saving requires saving and re-parsing quite a few variables and figuring out which ones I could regenerate easily and which ones had to be stored.

Is this image relevant? Not really, but it does show a game I reloaded.

Why I had to Suffer
If you have any idea how stressful fun, frustrating interesting, and tedious diverse this process was, you'd scream! It had to be done though, I mean how fun is an RTS where you can't save long games and come back to them? Not very.

Since you care so much, I have uploaded a sample of a BoS saved game! The file structure is modeled on XML and stores all the information needed to restore the game to its former glory after quitting. You can click here to download the file from skydrive. I reccomend you view it with Wordpad or a text editor that properly supports line breaks. Notepad will give you a mess.

While loading and saving is hardly an exciting news post, I want the self satisfaction of letting everyone know that I finally got it working. Now I can get back to creating siege ships to bombard planets from orbit.


Good work, mate.

I remember working on the game of my own. When I made save system no one noticed... oh I was soo proud of it... and nobody gave a damn. :D

Do you think you should keep it like that? I mean you could compress it. Because plain text is looked down upon.
Just a suggestion.
You could google some nice and simple text coding\decoding algorytms. (There should be some copy\pasteable code)
They could easily shrink your files. Mine gone from 1-2mb to 500kb each or so.

Reply Good karma Bad karma+1 vote

serialization is a useful tool for compressing this stuff, but as it's XML, it isn't entirely suitable. You can compress these files though (for instance by using an opensource library, like 7zip).

Anyways, nice work!

Reply Good karma Bad karma+1 vote

Well done. I learned to program save/load features right from the start, adding each variable you need to save as you go. Much easier that way :P

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.