Member-only story
Making a RTS game #32: Creating a debug console (Unity/C#)
On with our RTS! Today, we’re going to create a debug console (with some cheat codes…!) :)
⬅️ Tutorial #31: Refactoring our save/load system with binary serialisation 2/2| TOC | Tutorial #33: Using Unity’s terrain tools ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

The last two episodes were pretty dense! We talked about data serialisation and binary format, and we dived deep into C# reflection to automate fields extraction on our Scriptable Objects.
Today, let’s work on something a bit more straight-forward: an in-game debug console!
This console will allow us, as developers, to quickly reach a given state in the game without having to “replay” by hand all the required steps; but it will also be a nice feature for players who want to have fun and use cheat codes to “boost” their game ;)
Disclaimer: this tutorial is inspired by this really cool video by Matt from Game Dev Guide in which he describes a basic debug console system. I’ve added some features like help and autocomplete to make it more fun, but it relies on the same core ideas.