CODEX

Making a RTS game #3: Setting up in-game resources (Unity/C#)

Further down the rabbit hole: let’s add in-game resources and building costs to our RTS!

Mina Pêcheux
CodeX
Published in
8 min readMar 25, 2021

--

⬅️ Tutorial #2: Adding a very basic UI | TOC | Interlude #1: Introducing an event system ➡️

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

In the previous articles of this series, we saw what a RTS video game is, how to program a core feature (placing buildings) and the basics of Unity’s UI system.

Another crucial part of RTS games is the management of in-game resources such as gold, wood, stone… Those resources can be collected by the player from the environment via different means (usually, using specific buildings that allow you to harvest a specific resource type) and then later re-used to produce and upgrade your units.

We won’t discuss resource collection today but rather focus on defining and using in-game resources for our building construction.

In particular, our current building placement system lets you place as many buildings as you want. In truth, we want buildings to consume resources and thus the construction to be available only if you…

--

--

Mina Pêcheux
CodeX
Writer for

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 :)