Sign in to follow this  
mccalljohn90

How to take map image for mini-map

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='Christopher G.' timestamp='1311055764' post='4837225']
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.
[/quote]

Nothing stated here is what I didn't know. How about at least some pseudocode?

Share this post


Link to post
Share on other sites
pseudocode:[code]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[/code]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 "[i]it depends[/i]" currently...

Share this post


Link to post
Share on other sites
[quote name='Hodgman' timestamp='1311083340' post='4837375']
pseudocode:[code]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[/code]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 "[i]it depends[/i]" currently...
[/quote]


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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this