Member-only story
Making a RTS game #41: Preparing for a main menu… (Unity/C#)
Let’s continue our RTS and prepare our project for multi-scenes!
⬅️ Tutorial #40: Fixing our minimap | TOC | Tutorial #42: Designing our main menu 1/2 ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

So far, we’ve worked in just one scene: our game scene, where we have our map, and units, and day/night system and so on. In a real game, there would be other scenes so that the player first hits a main menu and then gradually “moves” to the game.
We won’t be creating our main menu in this episode, but in the next one…
However, today, we are going to prepare this scene transition and add some relevant metadata to our game scene so that the player can create or load games from the main menu with a bit of knowledge on what they’re jumping into :)
Adding metadata to our maps
Let’s say you’re in a menu and you want to choose a map to play a new game on: what sort of info would you like to have to discriminate between the maps?
The most obvious variables are its name, its size, the maximum number of players it can handle (depending on the number of spawnpoints you’ve defined) and its overall landscape. The three first parameters are pretty easy to find and store: we can pick a name ourselves, get the size from the “Terrain” object in our game scene, and count the number of spawnpoints in our scene.
Having a preview of the landscape is also pretty straight-forward thanks to the map capture utility we added a couple of tutorials ago. Thanks to this capture tool, we can quickly create screenshots as JPG images — and so we’ll be able to reload them in our menu UI pretty easily :)
Creating Scriptable Objects for the map basic metadata
But let’s leave the screenshot aside for now and focus on the basic metadata: the name, the size and the max number of players. We’ll also want to have a reference to the Unity scene to load — that’s the actual scene asset that will be loaded if we want to play on this map.