Sign in to follow this  
brekehan

strategy game maps

Recommended Posts

I was pondering working on a strategy title ala SR 2020, or Hearts of Iron 3. The data and AI I can fathom. I am wondering though how those types of maps are done. I can draw a 2d map in photoshop easy enough and have DX render it as a textured quad, but it is more complicated than that. How do you define borders of provinces or regions, ownership, etc. How do you define the paths that units may move through them? I was thinking of a mask of sorts, another texture that isn't rendered where ownership is coded into RGB values. But the movement I can't figure out. Would be easy if they were all hexes, but that's too 1980 really.

Share this post


Link to post
Share on other sites
One way to do it, which I think will be easier to program in several ways, would be to cut the texture into multiple small textures, one for each province. I might go about this by marking them with different numbers in a second texture or the alpha channel, then run a program to read an image and cut it, to create the textures, setting the alpha to zero for the rest of the pixels. You'd also have to keep for each texture its relative position in the image.

To define the data for each region, I'd create an editor which allows selecting a region using the mouse (something you'd need for the game anyway), and entering data for it (including where it links).

There are various other ways to do it, but the benefits I see for this one is that your map size isn't limited by the hardware's texture size and that you since you render each region separately your shaders can be pretty simple. You can also do CPU testing with bounding rects to speed up mouse selection.

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