Top-down room-based minimap. 5x5 radius/border needed

How do I…

I am creating a minimap for my topdown shooter. The minimap i’m currently using is generated by a tilemap on a seperate layer, which allows me to easily create custom tiles for seperate rooms. I’ve been trying to create a border around the map so only the rooms in a 5x5 radius are visible. The minmap itself works perfectly fine, it’s just once the player ventures out far enough the map becomes extremely large which is why i want the border. I’ve attempted many methods but find this problem unsolvable.

Current Results

After exploration where the map is too big.

Coding

The tilemap currently has 5 tiles for each room type, being:

  • An invisible tile that represent a completely undiscorvered room
  • A darkened version of the room for adjacent rooms
  • A light up room for discovered room
  • 2 invisible tiles for both the dark and light rooms that can be used for rooms outside the boundaries

The map’s layout is built while the world is generated and undiscorvered rooms are marked accordingly. While moving between rooms the adjacent rooms are at first dark, but light up once entered. My current theories are that once the tile is no longer in the 5x5 radius it is set to its corresponding invisible tile, however if it is in radius, it’s switched back to its visible counterpart.

I would heavily prefer if i could keep the tilemap format for the minimap however will change it if necessary

Instead of making invisible tiles, what you could do is have two separate tilemaps, one of them will be the entire map that has been discovered. This will be off-screen during gameplay. Then there would be another one that’s on the screen and is only 5x5 in size. When you enter a new room, copy the relevant 5x5 section from the big map, to the small map.

The object picking will be slightly annoying with instances of the same tilemap object, so what I would do is make a 5x5 array variable to be a proxy. I would read the tile numbers from the big map and populate the array. Then in a separate event, read the array and change the tiles on the small map.

thank you so much it works flawlessly

1 Like