Jump to content

  • Log In with Google      Sign In   
  • Create Account


Loading and Processing Non-Uniform Tile Maps


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 bgroenks   Members   -  Reputation: 115

Like
0Likes
Like

Posted 24 June 2014 - 11:14 AM

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.



Sponsor:

#2 HappyCoder   Members   -  Reputation: 2558

Like
0Likes
Like

Posted 24 June 2014 - 01:35 PM

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.



#3 bgroenks   Members   -  Reputation: 115

Like
0Likes
Like

Posted 24 June 2014 - 01:44 PM

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!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS