Making a RTS game #20: Saving the player’s data properly (Unity/C#)

Let’s continue our RTS: we’re going to take a look at JSON serialisation!

Mina Pêcheux
.Net Programming
Published in
13 min readJul 22, 2021

--

⬅️ Tutorial #19: Displaying our in-game settings!| TOC | Tutorial #21: Adding players and unit ownership ➡️

📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

In the last episodes, we’ve talked about our game parameters and how to modify them at runtime using an in-game UI settings panel. We’ve played around with our Scriptable Objects quite a lot and we’ve even managed to display them in a custom editor… but we have missed out on one key thing: what happens when we build our game?

Currently, if we build our RTS game, you’ll see that any changes we make to our game parameters in the game are completely forgotten the next time around; the fancy Scriptable Objects updates we implemented last time seem to be totally useless for data storage here… and, in truth, they are!

So today, let’s focus on this data saving problem ;)

Why are our game parameters changes retained in the editor but not in a build?

--

--

Mina Pêcheux
.Net Programming

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)