Crazy hex map question

Started by
5 comments, last by miket 20 years, 1 month ago
First off I would like to thank you guys for all your help. I have a cray idea I would like to run by u you guys. I am making a hex map where movement is effected not only by the terrain in the hex but also the hexsides as well. I am sure alot of you know how hard it is to make a map of hex shapes to begin with let alone worry about the hex sides. Wheil makeing the game I noticed alot of overlaping where the hexes met. My ides(or cray thought) is instead of having one big hex title divid each tile into s smaller square tiles 2 rows of 3 that way the two flat sides and each of the four bent sides would have there own little square. I am thinking doing it this why would not only make the map easier to work with but let the play get info about the hex side terrain as well. What do you guys think?
Advertisement
Huh?

Get off my lawn!

What I am saying is break the hex into small squares
instead of having just one hex shape graphic I would break it into six square graphics.
Say you had a 6 sided hex with the flat sides on the top and bottom. and starting at the top and going clockwise u had each side called N, NE, SE, S, SW, NW. What I am saying is each of those sides have its own little square graphic then put those squars together so they look like a hex on screen


[edited by - miket on February 27, 2004 1:15:27 PM]
Ok since no one responded I am going to quess you all think thats nuts.
Let me address the real problem I get the tiles to load and everything. The problem I have is that not only do the hexes have terrian but so do the hexsides. So you may be in a clear hex and in order to go one hex to the left there may be a river hexside between your hex and that one. I can get the terrian for the hex itself but I am having trouble getting the system to inforce movement over the hex sides any idea?
You could well shatter your hexes, but you might be fine with doing it this way instead.

You have terrain features that can lay on the "surface" of a hex, and features that can lay along an "edge" of a hex. Obviously, each side is shared by two hexagons, so you''ll need to decide which hexes own which sides, so you know where to store and where to look for the edge info. If your hexes are axis-horizontal (the top and bottom are flat), I recommend storing side information for the top, top-left, and bottom-left sides of a hex.

Now, to enforce pass-through rules. If you are moving up, up-left, or down-left, check the hex you are in for that given side. If you are moving down, look at the upwards side info in the downward hex. For moving down-right, look at the the up-leftwards side of the down-rightwards hex. You can probably guess the last side (up-right) on your own.

Now, as far as draw order. This is easy if you use the side storage I just explained. Whether drawing columns inside a row loop, or rows inside a column loop, as long as you draw left to right and top to bottom you can simply draw the edge images/sprites after you draw the tile they lay on.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
You need to have your tiles also "data-mapped" to a database or flat file. This is what I am doing because when a unit crosses a hexside with a river, the river is a property of that hex-side and the hex your crossing into''s hexside. Let''s say you have hex 0,0 and hex 1,0 and they are adjacent. If you begin numbering hexsides starting with the NE = 1, E = 2, SE = 3, SW = 4, W = 5, and NW = 6. Now if there''s a river running between hex 0,0 and hex 1,0 that means hex 0,0 side 2(the east face) has a river to cross and that river spills onto hex 1,0 hexside 5. Get it?

Here''s my db I''ve developed-

HEX...123456
0,0...CRCCCC
1,0...CCCCRC

Then when you load your map you also have to load the "data" of your map hexes and put them into a UDT or class.

Are you with me?

Gib
gib
I agree with what you are saying maybe I am just doing it wrong what I did was have a db with each tile info in it (Terrain hex number, city or anything like that)and a pointer to the graphic then I put the hex sides in with that. Then when the game load is loops through and fills a strucutre for each hex and displays it.
Or should I have a sperate DB just for the hex sides?

This topic is closed to new replies.

Advertisement