I want a minimap. This is sort of the same story as with the fog of war. The game needs a minimap, because it’s way too easy to miss a door and spend 10 minutes running around looking for that exit or that one boss room you missed. I need the player to quickly see the dungeon layout. It’s one of those features that’s not exactly easy to do and involves lots of moving parts and maintenance, so I have to justify it to myself. And players just walking around aimlessly seems like a pretty convincing argument.

Now, the minimap can be schematic and abstract with no real details. Just a square icon for a room and may be an indicator or two. The halls/tunnels are then lines and nothing more. Unopened doors are just little lines:

This is a lot of sprites though, so referencing and selecting everything is tedious as hell. And if I change something, well…

Anyway, now I need to generate a simplified version of my node layout as minimap data, where I store the info I want to show. For starters, this means the (mini)map size. This is enough for me to at least estimate where I’m going with this:

I’m testing this as if it was overlaying in-game world sprites, so I can see how that feels. Now I can store or not store the actual nodes, in other words, what “room” is there, and only draw sprites for those locations:

I can also translate the node type (hub, hall, arena, spawn, etc.) into an actual minimap-able location — room or hall; and select the appropriate sprite:

Of course, this is a mess, and doesn’t say anything about connections. So I also store the exits from each node, that is, the directions for any doors; and select a sprite with matching connections:

The rooms are still ugly and so I do the same thing for arenas, where I can store the links of each node, that is, the connected multi-node arena areas:

And this already produces a pretty decent minimap. I can add some shading to the room sprites to make them pop a little bit versus the gaps and be more readable:

For a point of reference, let me add the player’s indicator to the minimap:

Of course, I am not going to reveal the whole minimap at once. I need my world to store whether the player actually saw/visited any of the location. So I can hide everything to begin with:

Then reveal rooms and halls as the player walks around:

This follows the same logic as the tile visibility — all connected rooms are revealed at once.

I am still missing one of the main reasons I am doing the minimap — to show the player any doors they might have missed. And the current minimap doesn’t do that yet:

What I need to do is draw little exit stubs around the rooms with doors. These will extend into neighboring halls or rooms and look like hall continuations until actually revealed. I do the same with halls, though it’s not really needed: I already reveal the halls fully and they don’t have dead-ends or in-between doors (at this point), so all halls technically end in a connection anyway. So here it is working more or less:

One thing I realize however is that I don’t actually have sprites for when multiple stubs are needed, such as like this:

These are rare cases and usually just this exact combination — left/right or up/down. Most of these are avoided by the dungeon generator. But I still need to add all the sprites that could possible be needed (urgh):

And then reference and select them based on direction:

And finally this works and functionally does pretty much everything I need. The player can see all the rooms they visited. It hides unexplored areas. It reveal halls and shows where rooms likely are. If they get lost, they can quickly find any rooms or halls they have missed.

Since the minimap reveal is based on tile reveal, this works fine with destroying walls and making shortcuts:

One minimap concern from screenshot is that it is hardly legible. However, in-game everything is animating and the minimap remains static. So it’s legible even at a quick glance:

In any case, I can tweak sprites and sizes later.

I can also place the map inconspicuously in the corner and it then takes very little screen estate:

Now, the issue here is that the minimap is not centered (it starts from minimum node map’s coordinate and screen position is just a proportional offset from that):

I want it centered on the player’s spawn room:

That way the minimap is always centered the same regardless of the dungeon layout, so the player can’t make any assumptions about the actual dungeon layout (size or shape or spawn room location in relation to the rest of it) from the minimap.

A final touch is to indicate the spawn and goal rooms (blue and green) so the player can always quickly return to those:

I could eventually indicate more stuff, like bosses or treasure, just so the player has a point of reference. But I will come to that once I add them properly to the dungeon and mark the relevant rooms as such.

Also, I won’t be doing a full-screen map. I could just zoom in my current minimap, but it feels pointless. I rather make it a scaling option or something, separately or as the whole UI.

I also won’t animate the minimap reveals because I don’t see much point — it’s tiny and HUD-only.

And I think this pretty much covers this self-contained feature.

Related Posts

MicroRogue DevDiary #31 – Minimap
Tagged on:

Leave a Reply

Your email address will not be published. Required fields are marked *