Jump to content
  • Advertisement
Sign in to follow this  
PariaPluto

Strategy World Map Logic and Design

This topic is 2636 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

I have started my development on a 2D Turnbased RTS in which you wage wars on a World Map ala Total War or Hearts of Iron.

I cant for the life of me figure how you would achieve such a map. I tried Vektors, but trashed that idea because I'm not as advanced for that yet, also it didn't really work with libgdx.
Then I asked around and people suggested using images of each province and then working with that, ala picking via bounding box and then checking if the pixel color is transparent or not.

That could technically work, but its tedious and probably not the best way, mainly because you would have to manually arrange the images so that they align correctly.

Does anybody have experience in this? There must be a good way to do this. I dont feel like sitting infront of my computer for hours trying to align images pixel by pixel for hours.

Share this post


Link to post
Share on other sites
Advertisement
There are a few different ways you could do this. One way would be to an image (or multiple images) for your full map. So, you have one large map that shows all the countries that can be controlled. Then, create your own Map Editor (which should use the same engine to display the map as your regular game), which will load the images. On the side of the screen, have a little menu where you set attributes for the countries (name, power, alliance, etc.), and you use a mouse to click the center of each country. In your editor engine, it will take that click, and mark a square zone around it, which marks where a counties click interface is. So, in the game, when a player clicks in that square (which should be drawn), it knows which country to control.

Or, what I would do, use gleed2d (http://gleed2d.codeplex.com/) and draw out my world. You can load images to be the background, and then mark the boundaries of the countries themselves, as well as set attributes. Then I would use an xml parser (I use tinyxml) to parse the levels, and draw them on screen.

If you decide to use gleed2d, be sure you watch the video tutorials. I think it's a powerful editor and can be used for many different game types.



Share this post


Link to post
Share on other sites

Is this not the same problem as discussed in

http://www.gamedev.n...dard-ui-shapes/

?


Well thats what my current plan is, I asked on java-gaming.org and thats what my answer was.

@Beernuts Thanks. But a small square is rather bland, and I wanted to be able to color the regions or map them.

So I think I'm going for colercoded submap with metadata file and a then splitting the big picture into alot of small ones. I'd do the splitting outside of the game to get around a huge loadtime.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!