How to take map image for mini-map

Started by
4 comments, last by Machaira 12 years, 9 months ago
I'm creating a mini-map for my tile-based RTS, and I need to create a mini-map. To do this, to my knowledge, I need to take an image of the entire map from afar, and reduce the image's size (while remaining efficient in the process, because the minimap will update often). So how can I do this?
Advertisement
It depends how much dynamic detail you want.

You could make smaller versions of each tile and make a tile-based minimap.
To represent enemy buildings you could either have simple colored squares (like Warcraft 3), or you could use small images or icons representing the building type.
For units you could just use colored 'blips'.

EDIT: For performance reasons, you will want to generate the minimap to a texture. Except of course for the buildings/units and other dynamic content.

It depends how much dynamic detail you want.

You could make smaller versions of each tile and make a tile-based minimap.
To represent enemy buildings you could either have simple colored squares (like Warcraft 3), or you could use small images or icons representing the building type.
For units you could just use colored 'blips'.

EDIT: For performance reasons, you will want to generate the minimap to a texture. Except of course for the buildings/units and other dynamic content.


Nothing stated here is what I didn't know. How about at least some pseudocode?
pseudocode:at level creation time:
render level using overhead ortho camera
save as DDS

at load time:
load level DDS.

at draw time:
draw DDS to screen using ortho/hud camera.
draw building/unit icons over the top
Can you describe what kind of minimap you want? Which parts of the idea in particular are you having trouble with? There's a lot of "it depends" currently...

pseudocode:at level creation time:
render level using overhead ortho camera
save as DDS

at load time:
load level DDS.

at draw time:
draw DDS to screen using ortho/hud camera.
draw building/unit icons over the top
Can you describe what kind of minimap you want? Which parts of the idea in particular are you having trouble with? There's a lot of "it depends" currently...



The minimap will be dynamic--dynamic in the sense that for every movement on the map, the minimap will update to display that movement.

I've never heard of an "ortho camera" before, so I guess I have some research to do. But, now that I think about it, the notion of manually drawing the building/unit onto the minimap I think may not be needed. Because the RTS is rather computer-friendly (it's a 2D isometric, tile-based game), I think I might be able to get away with a picture-in-picture (PIP) type of minimap, although I would have no idea how to implement this. The general idea behind it would be that the game would contain two cameras, one camera for the main picture in standard resolution, and another camera positioned on the map in such a way that it views the whole thing; that camera would be lowered in resolution and placed in the HUD.
I think the recommendation of just using colored pixels (which can be stretched into squares) for the terrain and units would be a lot easier.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

This topic is closed to new replies.

Advertisement