• Register

The game you are trying to view has ceased development and consequently been archived. If you are a member of this game, can demonstrate that it is being actively developed and will be able to keep this profile up to date with the latest news, images, videos and downloads, please contact us with all details and we will consider its re-activation.

Chronus is a futuristic action shooter currently in development. You'll be able to design your own ship and fight it in online multiplayer battles against other players. It's merely a project I work on for fun, commercial release isn't intended.

Post news Report RSS Serialization in Chronus

Introduction to serialization in Chronus, release of build 0.1 and work on patch 0.1.x

Posted by on

Introduction
Today I released version 0.1 of Chronus on IndieDB, which was quite exciting. I fixed the last really major issues regarding serialization, and thus I thought it would be a pretty good idea to release.

So first thing first, I should probably exactly what serialization is.
In layman's terms, serialization is the process of taking some data from your game, and storing it in a file. Deserialization is what happens when you, for instance, load up a saved game (i.e. taking data from a file, and putting it into the game). In Chronus I use serialization for a bunch of stuff, most importantly though, for saving ships in an XML file. I've done several iterations of this system, and at the moment I believe I've found the very best solution to one of my main problems being...

How does one create easily manageable files
This is something that I've thought about quite a lot. What's the best way to actually store these ships. At first what I did was I created an XML file per profile, containing data for each ship attached to said profile, but that created another issue - what if you wanted to share your ship with your friends? Then they'd have to get the data from your entire profile. That wasn't any good.

Instead I ended up with the current system. Each profile has a folder and inside each folder you will find two types of files. A .profile file and a .ship file. The profile file is kind of boring (Currently stores time played, shots fired and blocks placed, basically it just stores stats), however, the .ship files are quite interesting. Whenever you save a ship in-game, it will create a new .ship file, which makes it quite easy for you to share you creations. Simply send the ship file to one of your friends, and have them place it in their profile folder

Nicely named ships in a profile folder
Profile Folder














How does all of this work?
I don't think it's a secret that I didn't write the entire serializer from scratch. After all, it's a project I'd like to have fun with, and writing a custom serializer would simply take up too much of time I'd rather spend on writing game mechanics.

I'm using Unity Serializer, which is a free Unity extension created by Mike Talbot. It's incredibly easy to work with, and has allowed me to go from no serialization to everything described above in a matter of a week or two. All I've had to write is the XML serializer, alongside the functions I use to maintain profiles, ships and so forth. I can highly recommend it to anyone looking to serializing anything in Unity.

Update on a patch for 0.1
In a day or two I'm going to release a patch for 0.1 which will be the first stable build of Chronus. At the moment it's quite unstable, and includes a few pretty large bugs. I've already fixed the worst of them (Loading large ships crashes game), and hopefully the rest will come along quite easily. In the meantime I hope people will try out the game and have some fun with it.

- Daniel Everland

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: