Sitemap
Any Programming

Practical software engineering across every stack from C# and .NET to Python, TypeScript, Go, and Rust. Hands-on tutorials, system design, design patterns, DevOps, and AI-assisted development, with working code you can actually run. By developers, for developers.

Member-only story

Making a RTS game #22: Producing some resources with our buildings (Unity/C#)

13 min readAug 5, 2021

--

⬅️ Tutorial #21: Adding players and unit ownership| TOC | Tutorial #23: Implementing behaviour trees for our units 1/3 ➡️

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

In the last tutorial, we’ve worked on our units and we’ve implemented a system of ownership. In this article, we’ll start from there and focus more on our buildings: we are going to see how to have them produce some resources based on their position in the world.

Here, what I call “resources” are the three in-game resources we talked about a long time ago, at the very beginning of this series: gold, wood and stone.

For this project, I wanted my resource production system to have three characteristics:

  • the type of resources a building can produce depend on its type
  • the amount of resources a building produces depends on where it’s placed in the world: the surroundings impact the “production efficiency” of the building
  • resources are infinite: instead of having units…

--

--

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux⁠

I’m a solo game dev & content creator. I love to make and talk about games (and also 3D and music)! Find me at: https://minapecheux.com :)

Any Programming
Any Programming

Published in Any Programming

Practical software engineering across every stack from C# and .NET to Python, TypeScript, Go, and Rust. Hands-on tutorials, system design, design patterns, DevOps, and AI-assisted development, with working code you can actually run. By developers, for developers.