Member-only story
Making a RTS game #21: Adding players and unit ownership (Unity/C#)
Today, let’s add some players and an ownership system to our RTS!
⬅️ Tutorial #20: Saving the player’s data properly| TOC | Tutorial #22: Producing some resources with our buildings ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!
The last tutorials have been about game parameters and UI displays of our settings — we’ve been working on the metadata of our game quite a lot. But it’s been a while since we haven’t added a quick-win feature: something quick to implement but essential to the game.

In this episode, we’re going to see how to create a list of players for the current game, and how to associate units to players through an ownership system.
Prelude: simplifying our GameParametersEditor
(a lot!)
In recent episodes, we’ve seen how to create our own custom Unity UI editor. We replaced the default Inspector for our GameParameters
-derived classes assets with a tailored-made one. For the sake of this tutorial, I decided to go in deep and work with C# reflection. This allowed us to get familiar with manipulating dynamic data types and made it…