Member-only story
Making a RTS game #47: … and loading back our game scene data! (Unity/C#)
Let’s keep working on our game scene and see how to deserialise the previous session data on load!
⬅️ Tutorial #46: Saving our game scene data… | TOC | Interlude #3: Showing our updated minimaps in the menu ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

Last week, we talked about binary serialisation and we saw how to store info on our current game session in binary files. We focused on how to go from C# objects to binary-formattable data. Today, it’s time to do the reverse: we will implement our deserialisation process to load the data back and restore our previous state!
A note about the reload logic
Before we dive into the actual implementation, we just need to think for a while about execution order and dependencies.
The overall idea is obviously to:
- check the game current UID
- load the matching data file if it exists (or else ignore the load part and use the defaults)
- use this info to setup the various scene parameters