Day 12 - Ghosts and serialization
 
One more animation.

It's for the ghosts. Replaced the plain corruption number with a bunch of ghosts circling the nodes. Looks swell and doesn't really affect the UI. You don't need to know the specific number after all, "loads of big ghosts is bad" serves the same purpose.

Nearly forgot, but the other task for this week was serialization. Not a big deal, but did take the usual wrangling with the odd deserialization glitch. Didn't quite get them all out, for instance, nodes still play the corruption animation when loading the state. I'll be adding more graphics later, so those fixes can wait.

I hadn't used Json.net in a while and was surprised how eager it is. By default it serializes public variables, properties and even delegates! Those last two were too much. It kept complaining about Unity sprites... My models don't have sprites! Apparently it tried to serialize some views too via the events. Yeah... Luckily the [JsonIgnore] attribute does the trick. [JsonProperty] on the other hand can be used to add private members to the party.

I really like how Json.net handles object references. The first time around it serializes the whole object and later only writes {"$ref":"52"}, neato! Saves me a lot of hassle messing with manual object indices or something silly like that. Vector3's worked out of the box too! 

Visually the test level is looking quite clean now. The last visible number is the civilian count which will most probably stay as it is. I can live with it. Tomorrow is finally for the background then, can't put it off any longer. Will need to find some inspiration.


Cheers.