Dynamic Map and MiniMap


Author: Zak Levine

Date: 3/24/2023

A map and minimap are prominent features in many titles and would significantly improve Slimegeon. I first had to decide how to make the map to tackle this feature. I decided to create icons and place them in a canvas panel. The first issue was getting the locations of the icons from the world to the screen size and getting the correct scaling. Another problem I encountered was converting the map into the minimap and getting the minimap to follow the player icon.

Firstly, since all the dungeon floors are the same size, I used that scale for every location to convert the world location to the tiniest form. Then I attempted to multiply the location by the viewport size / (Dungeon Max - Dungeon Min). However, this worked until I changed the viewport size since it caused the scale of the icons to be changed. After some testing, I realized that the new location-scale could just be a constant and would be the same size on every screen. So I removed the equation for the new scale and used the constant 20. I then scaled the icon to .1, the size of the x and y, making the dungeon fit perfectly.

The next issue was how to alter the map to the minimap. I added a new canvas panel that clips the bounds to solve this. I attempted to make all of the map children (the icons) the children of the minimap. However, this caused many issues with separation and misplaced tiles. I realized after I could make the entire Map Canvas a child of the MiniMap Canvas. Next, I had to translate the minimap to follow the player icon. After much debugging, I figured out that setting the translation of the map to the negated translation of the player icon got the player icon to stay in the upper left corner. Then I just had to add the size of the minimap box divided by 2 to center the player icon. I also scaled the map to 2 to zoom slightly for the minimap. 

I can use these systems to have a dynamic map and minimap that changes based on the current game situation. It is also created based on the dungeon or level, making the map versatile. The map was also slightly altered for the boss levels by changing the scale for the locations and getting the floors based on tags instead of reading in an array. Overall the map improves the gameplay and allows for more features like teleporting to cleared rooms.


Leave a comment

Log in with itch.io to leave a comment.