Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

miket

Crazy hex map question

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

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?

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!