Added the minimap

In the incubator week Arjen (thanks Arjen!) worked on the minimap feature. It was a bit tougher then anticipated, but the end-result is very nice!

Brief history about my experience with the minimap / radar

Every since I played Dune 2 I wanted to build my own RTS game (which I did, twice). I always found the minimap a very handy feature. Since I’ve used it quite a lot I want the experience for every player to be flawless.

When hacking away at Dune 2 I noticed the map sizes were always a power of two (32×32 or 64×64). The minimap itself had a max of 64×64 pixels, so each tile would be 1 pixel on the map. If you played on a 32×32 map, the tiles would simply be pixels of 2 by 2.

Dune 2 in action with 32×32 minimap

How we wanted the minimap to work

We had the following requirements

Ability to render very big maps (4096×4096) in the minimap area

Ability to handle ‘awkward’ map sizes (ie, not power of two)

Ability to handle very small maps (32×32)

Minimap would be available only after building a RADAR

You would need sufficient power to see anything on the minimap

Demo

See the minimap in action here:

What it looks like with various map sizes

64×64128×128

83×57256×64

Improvements?

For now we’re satisfied, but we already have a few ideas to improve further: