# More fun with hexes and approaches

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

## Recommended Posts

Guys, okay, we standardized on a layout for hexes. For some reason, that was a bit of a debate even though it really shouldn't matter. In the end, we decided on a 0,0 at the center with the flat sides north and south. North of 0,0 is 0,1 0,2 and then 0,3. Right of 0,0 (and sharing a side with it) is 1,1 and 1,0 (just below 1,1). Okay, so we've essentially come up with 3 different ways to move around the hex map and I'm curious if anyone has any input on which of these ways is best overall, if it doesn't matter at all, or if another way is best. Say you want to move from 0,0 up one hex to 0,1 and then make a slight left up to -1,1. In the game you can move one of several ways and some move you, in a single turn, across several hexes. The first approach was to do this in steps. We broke these down so that step one was to keep your facing the same and move to 0,1. Step two was to turn left 60 degrees and move up to -1,1. This works as a "single" move but seems ... a bit too simplistic. The next method was a functional method to get there in one step. Every move could have a "modifier" based on the facing you're at. So each move would have six different facing modifiers. The move I mentioned above would look like this: (Facing starts at 0 or due North and goes to 5 which is 300 degrees) If Facing 0, X-1, Y+1 Facing -1 (turn 60 degrees left from your starting facing) If Facing 1, X+1, Y+2 Facing -1 If Facing 3, X+2, Y+1 Facing -1 ....and so forth. This gets you there in one immediate move but also seems a bit convoluted. Another member suggested the use of a base number system and multiplayer that he thought would work were you created the facing table once and then each move would have a multiplier applied to that single 6 entry table. That would be even more efficient but I couldn't get it to work when the non-diagonal paths came into play (like the above move). I might not have gotten the idea down entirely though. Any thoughts?

##### Share on other sites
Basically, Yes.

......0,1
-1, 0......1,1
......0,0
-1,-1......1,0
......0,-1

Can't really draw a hex map here...

If you look at the numbers above and ignore the dots, that's pretty much the layout.

##### Share on other sites
Oh, so, y coordinates increase upwards? I'd consider that backwards.

##### Share on other sites
So did I but I lost that argument as I wasn't the one that was going to have to work with the hexes as much as the others. Thankfully it seems to math works regardless as long as we all stick to the same core mapping.... hehehe

You can see in my initial posts that I had the X going upwards and it made sense to me but....

##### Share on other sites
For my game the path finding created a list of Loc's then...
for each newLoc
-get newAngle from currentLoc to newLoc
-face newAngle
-move to newLoc

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 33
• ### Forum Statistics

• Total Topics
632633
• Total Posts
3007543
• ### Who's Online (See full list)

There are no registered users currently online

×