Creating a Real-Time Map

Good evening! I am a student game developer and I’m having trouble wrapping my head around something.

The game I am working on features two decks of a spaceship. These decks feature a number of twisting hallways and important systems which keep the ship running. Because of the possibility of not recognizing where you are, and wanting to be able to keep the player up to date as to what state the systems are in, we’d like to have a map.

What I am really having trouble thinking about is how to cleanly make that map. Is the best way to go about this taking a screenshot of the top of the floor, making a 2D asset that represents it, then having a 2D element move on it based on the rough ‘center’ and scale of that floor? This seems finicky to implement, on top of requiring a creating a new map if the floor is altered during development.

Thanks for any help you can give!

You can use a SceneCapture2D placed in your level, or SceneCaptureComponent2D as a component of some actor, rotate it so it’s forward vector is pointing down(pitch -90). Set it to orthographic projection. Set its ortho width to the size of the area of the level you want to capture and move it as needed. Keep the Z value of the orthographic plane in mind, as any object clipped by it will not have its backfaces rendered unless it is using a two sided material.

Create a Render Target, and set it as the Texture Target of the SceneCapture2D. Create a material, add a Texture Sample, set the Texture to the Render Target. You can then apply this minimap material to objects or your UI. As default SceneCapture2D will update every frame, but you can disable this and update it through a blueprint as needed.

The mini-map would make a good plug-in for the Marketplace.