PDA

View Full Version : Making Interesting Hex Maps



MoLAoS
07-08-2013, 12:56 PM
I have a working image map in mysql/php using hexagons. But I need to be able to generate interesting landmass features. There are about 2400 hexes currently although there could be more. It would be extremely difficult to manually input the terrain type of each hex into the database. I considered a system where I would click on a hex, and the hexes are links since its an image map, and then use a form to manually enter a terrain type into the database using the id, but that would still be pretty tedious and I would have to do this every time I wanted a new map.

Do any of you guys know of a good algorithm to generate good landmasses with hexes?

Gamerprinter
07-08-2013, 01:05 PM
To me, any grid is an afterthought to a map design. You first create the kind of detailed map you want. When you're done you place your grid whatever that might be - square or hex. To me, creating the hexagons first as backwards design - why would anyone do that? Now if you're using an application like Hexagrapher, a hex based CAD drawing system, then that's how the designs are created. Maps I create can easily have square, hex or no grid, because as I stated grids are something I do as the very last thing in any map design - it really is only an afterthought.

MoLAoS
07-08-2013, 01:15 PM
To me, any grid is an afterthought to a map design. You first create the kind of detailed map you want. When you're done you place your grid whatever that might be - square or hex. To me, creating the hexagons first as backwards design - why would anyone do that? Now if you're using an application like Hexagrapher, a hex based CAD drawing system, then that's how the designs are created. Maps I create can easily have square, hex or no grid, because as I stated grids are something I do as the very last thing in any map design - it really is only an afterthought.

I want to generate random maps. Its just a forum game, not a significant undertaking with complex lore and resource management. I should have been more clear about that.

RobA
07-09-2013, 03:02 PM
There are any number of algorithms for generating random maps, most based on some type of noise function to generate a height field, plus some sort of basic climate modeler. Those are typically implemented in a grid, but you CAN convert from a grid to hexes fairly easily:

- starting with a square grid:
LLLLLLL
LLLLLLL
LLLLLLL
LLLLLLL

- combine adjacent cells in each row, either by averaging or just doubling every other cell horizontally, offsetting every other row:
L_L_L_L_
_L_L_L_L
L_L_L_L_
_L_L_L_L

- This "subway-tile" grouping can has a hex connected topology and can be directly mapped to select your hexes.

The only "trick" is to scale the original noise function on one axis so the resultant hexes are regular hexagons rather than flattened hexagons.

-Rob A>