Member-only story
RTS Interlude #3: Showing our updated minimaps in the menu (Unity/C#)
Let’s continue our RTS and get up-to-date minimaps for our game session saves!
⬅️ Tutorial #47: … and loading back our game scene data! | TOC | Tutorial #48: Various fixes, improvements and clean-ups ➡️
📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

In the last two episodes of the Unity RTS tutorial, we saw how to use binary serialisation to save and reload our game scene data. We can now create new game sessions, play for a while, save the current game state and then restore it later. We’ve even added a new panel in our main menu to list all available game saves and reload a previous session.
But, for now, those game saves don’t show the proper minimap! At the moment, we are simply using the base minimap from the reference map itself, but it doesn’t take into account the game context: we don’t see the units, or the fog of war…
Luckily, we’ve already prepared a tool to quickly get a capture of our minimap a while ago — so we just need to call it at the right time, save a picture to the disk along with the rest of the game data and then reload it in the main menu’s load panel :)
Upgrading the capture tool
My minimap capture tool is almost ready, but it is still has a little limitation: it only saves images to one given directory that I hardcoded (the “Resources/MapCaptures” folder inside my application’s main data directory).
The problem is that, now, I want to store my minimaps in their respective game folders (i.e. the various directories I created based on my game session UIDs). So I have to update my MinimapCapture
class to accept an optional folderPath
:
This way, if I pass a folderPath
manually, it will override the default behaviour and save the image in this folder!