Skip to main content
gamedev.net
🔒 Locked

Minimap?

Started by crackingod Aug 7, 2006 at 2:01 PM 2 replies 4.8k views
LorenzoGatti
LorenzoGatti
What kind of game is it?
In a FPS, flight simulator or other free perspective 3D game an abstract minimap, consisting of lines and/or blips (like in Doom or Incoming), can be drawn with lines, points, point sprites and small textured polygons as an overlay of the main 3D view (that would remain visible behind the thin obstructions).
In a RTS or other fixed perspective game there is no reason to draw the minimap as a scaled down version of the main view; you need to be abstract.
You could use one pixel per terrain tile, with a conventional colour showing the prevalent or most important terrain type or feature, and each unit or structure as a solid block of usually 1 pixel, with a colour showing its faction. See Warcraft 2, Starcraft and clones thereof (square grid with many units) and Battle for Wesnoth (hex grid with a stretched minimap).

Showing on the minimap what part of the game map is visible is trivial because there is a simple proportion between coordinates in the map and its two views.
For example, if the map coordinates are between 0 and 1000000 in both direction, the minimap is 256 by 256 pixels and the main view shows the region from 38215,122866 to 141322,224403 you can draw a rectangle in the minimap from coordinates
255*38215/1000000= 9,255*122866/1000000= 31 to 255*141322/1000000= 36, 255*224403/1000000= 57.
Omae Wa Mou Shindeiru
starfleetrp
starfleetrp
You could do it without tiles if you want and just create section like anything from x 0 - 100 and y 0 - 100 could be considered as one pixel/tile. This way you do you need tiles because you are just working with chords.
DanielH
DanielH
Pre-render the map onto a texture from a top-down ortho mode and then draw dynamic objects with simple primitives (dots, lines, sprites) onto that texture. :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.