• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mapping a hex game board to rectangular tiles.

 
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was pleased to read about the Game APIs support of tiled screens, but I'm still stuck trying to figure out an efficient way to create a hexagon based map using rectangular tiles.
I started to explain a lot of the details, but for now I think just being able to make the map would be a good start.
Basically there's two types of hexes on the map. However, there's an added complication that any or all of the six sides of the hex could allow any game piece to cross or restrict crossing to specified types of pieces.
If anyone here's got experience with this kind of issue, or can point me in a reasonable direction, I'd be most grateful.
Thaks!
 
Burk Hufnagel
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm... Nobody's replied which leads me to believe its either much simpler than I suspect, much harder, or nobody cares...
Guess I'd better try someplace like Gamasutra...
 
hired gun
Posts: 250
MS IE Oracle Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Burk, I've read your post but have no clue what to tell you. It's hard to tell how many people look at your post and then like myself don't have a clue. I actually came back in here when I saw that it had a reply to see what the answer might have been.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was quite a while ago and in a different environment but here is what I did.
The map was represented by multiple 2D arrays.
One array had "connectivity type code" for each location - this code controlled the allowable "movement" from that location in terms of the changes in x (rows) and y(columns) that were possible.
In other words, taking location x1,y1 the connectivity code led to all the legal changes in x and y - similiar to a terrain map really.
For display, each row has an offset that lets you display the row so it looks like a hex map.
(lets see if I can show this...)

So x1y1 is a type that can move +1x or +1y
x2y2 can move in six directions, etc.
Bill
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic