How to create a mini map in a RPG game


I’m currently working on a dungeon crawler type of game using SpriteKit and the game map is created using SKTileMapNode. Each tile is 32x32pixel, and each game level is around 100x100 tiles. Since the game levels are quite big, I’d like to implement a mini map on the screen to let players keep tracking of their whereabouts.
I tried to look for solutions but came up short. Could someone please let me know how it is done or point me to the right direction.

Thanks in advance for any input.

Hi Steven, (@luckybob )
I am not an expert in SpriteKit, so cannot provide you code to your problem. However, I can attempt to help you with the concept of how to get your mini map up and running.

First, it all depends on how detailed a map do you want to provide. Which also hints at the solution, a mini-map is a low-res map of the larger one, which means you need to down sample. The size of the tile does not matter unless each pixel on the tile is an element that can change. So your level is 100x100 tiles, take each tile as a quad of 2x2 pixels and render them if the player has visited that tile or not (for example), you can also implement the fog-of-war which hides the other tiles and previews them as you get closer to them.

If you have more details of your level, it is irregular with thin bridges and connectors, etc it would help to suggest more detailed solutions, directions.

Hope this helps, for all it is worth, you might already know this too. So, till someone gets you the code snip that you are after.



Thanks Jayant for the insight. That should help me to get started. One more thing I need help with is that although the map is created by with tiles, the player character in the scene moves freely not tile by tile, how can I track its movement on the mini map?

Hi @luckybob,
Here you will have to help me first understand how your character moves, because the character will move on a predefined/generated map which should have some co-ordinates, which ultimately do translate to a tile. However if you mean that the character could be on any pixel on a 100x100 tile, then for simplicity you can treat the character to be on that tile where ever they are.

If the game mechanics you employ are different, please let me know,



This topic was automatically closed after 166 days. New replies are no longer allowed.