A Terrain Minimap with SlimDX and DirectX 11

Published November 20, 2013
Advertisement
[font=Arial]



Minimaps are a common feature of many different types of games, especially those in which the game world is larger than the area the player can see on screen at once. Generally, a minimap allows the player to keep track of where they are in the larger game world, and in many games, particularly strategy and simulation games where the view camera is not tied to any specific player character, allow the player to move their viewing location more quickly than by using the direct camera controls. Often, a minimap will also provide a high-level view of unit movement, building locations, fog-of-war and other game specific information.

Today, we will look at implementing a minimap that will show us a birds-eye view of the our Terrain class. We'll also superimpose the frustum for our main rendering camera over the terrain, so that we can easily see how much of the terrain is in view. We'll also support moving our viewpoint by clicking on the minimap. All of this functionality will be wrapped up into a class, so that we can render multiple minimaps, and place them wherever we like within our application window.

As always, the full code for this example can be downloaded from GitHub, at https://github.com/ericrrichards/dx11.git. The relevant project is the Minimap project. The implementation of this minimap code was largely inspired by Chapter 11 of Carl Granberg's Programming an RTS Game with Direct3D, particularly the camera frustum drawing code. If you can find a copy (it appears to be out of print, and copies are going for outrageous prices on Amazon...), I would highly recommend grabbing it.
image_thumb%25255B1%25255D.png?imgmax=800

[/font][font=Arial]


Read more "

[/font]
2 likes 2 comments

Comments

jbadams

Great tutorial Eric! If you'd like some more exposure, we'd love if you also submitted it as an article -- but no pressure of course! :)

November 21, 2013 12:15 PM
ericrrichards22

Great tutorial Eric! If you'd like some more exposure, we'd love if you also submitted it as an article -- but no pressure of course! smile.png

My only reservation about submitting this as an article would be that it depends quite a bit on my custom framework. I don't know how well it would stand alone.

November 21, 2013 03:17 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement