Sign in to follow this  

Loading and Processing Non-Uniform Tile Maps

This topic is 1270 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

I'm beginning work on my own rendition of the strategy game Diplomacy (hopefully some of you have heard of it :D).

 

Real world maps of course have provinces/areas that are all unique in size and shape, so I'm trying to work out the best way to read, process, and render this data.

 

The map provinces need to be able change color and be recognized independently via input (i.e. if you click on a province, the game should be able to map your click to the relevant information).

 

Does anyone have suggestions for the best kind of system to use for this?

 

I've considered an image processing approach that looks for the black line borders, but that seems like it would be hard to distinguish between borders that are actual separate areas and borders that aren't (e.g. a miscellaneous island that is actually part of another, larger area).

 

I've also considered using Paint.NET or my own simple editor to manually define polygon bounds on an overlay of the map, but that may be difficult to match everything perfectly.

Share this post


Link to post
Share on other sites

What are you using for graphics? That could determine the best way to recolor things.

 

 

As for the clickable regions, I would define a separate image that you load into memory but never show on screen. The image is the same size as the map but instead of visual data, the image defines what pixel corresponds to what region. You assign a different color for each region so if you want to know what region a pixel is in, you simply sample the pixel on the off-screen image and use its color to look up what region it is.

Share this post


Link to post
Share on other sites

What are you using for graphics? That could determine the best way to recolor things.

 

Core profile OpenGL.  My own library/engine that is based around JOGL.

 

The offscreen color coded map is a good idea!

Share this post


Link to post
Share on other sites

This topic is 1270 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.

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