Minimap and fog of war
Througout the dev process of this week, the main issue I faced with was generating a minimap based on the random map and also generate fog of war. By constantly using another camera to render the whole map again is consuming performances, which is not good.
The solution I used with this issue was render the camera's view onto a texture, and save it as the minimap in the beginning of the map generating process. This only makes the camera render once since the map is a static object. Another challange is the fog of war. To achive that, I used a sprite mask as the top layer, and I put the map as the child of the mask. In the script, I combine a circle shape as the reveal shape with the current mask based on the player's position, so that it can masked out the unexplored areas. But the biggest issue is by doing so, it is causing a huge performance issue. I can't really solve this yet, but a quick fix I used is to record the last player's position and I only reveal the fog when the player is far enough from the last position. This significantly improved the performance, but still not enough.
Right now I am considering using shader to implement this, and I am still working on it. Here is a current version of fog of war and minimap:
Author: Zeyuan Song
Posted on 04/19/2024
Get Suits of the Abyss
Suits of the Abyss
Status | In development |
Author | AstralArchitects |
Genre | Action, Platformer |
Tags | Roguelike |
More posts
- Carrying player data between scenes in Unity (Pt.3, The Finale)May 04, 2024
- Player ground detection issueMay 02, 2024
- URP sprite shader issueApr 27, 2024
- Carrying player data between scenes in Unity (Pt.2)Apr 27, 2024
- Weapon Effects and AnimationsApr 27, 2024
- Resolution issuesApr 27, 2024
- Player WeaponsApr 20, 2024
- Carrying player data between scenes in UnityApr 13, 2024
- Poker Hand DetectionApr 13, 2024
Leave a comment
Log in with itch.io to leave a comment.