Work in progress - hexworld generator

System-neutral discussion of campaign setting and game world design. Discussion of existing rules systems belongs in The Crunchy Bits and its sub-forums.
Post Reply
User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Work in progress - hexworld generator

Post by isomage » Wed Aug 18, 2010 4:16 am

Inspired by discussion in this thread I've begun working on an icosahedral planetary random hex map generator. So far I have a simple prototype, showing only land and sea areas, but eventually I hope to use Thorf's Mystara tiles and have realistic climate zones. The program actually outputs .SVG files, but these have been converted to .PNG for the web; hopefully in the end you'll be able to edit the maps in Inkscape or Illustrator.

Here's the same planet generated at a range of different hex scales:

Image

Image

Image

Image

Image

Image
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
Chimpman
Hadozee
Posts: 7929
Joined: Thu May 22, 2008 6:52 pm
Gender: male
Location: USA, California

Re: Work in progress - hexworld generator

Post by Chimpman » Wed Aug 18, 2010 5:11 am

This is really cool isomage! Can you tell us a little bit more about how you're generating landmasses? Having just purchased Fractal Terrains, the one thing I'm a little disappointed with are the strange landmass shapes that it generates most of the time (the ones you've shown above look pretty good by the way). I'd love to see some kind of plate tectonics at work here to generate more realistic looking mountain ranges for example.
THRESHOLD Magazine - The Mystara Fanzine
Visit the Exiles Campaign Setting (a Mystara / Spelljammer crossover)
Visit Mystara 2300 BC

Moderator of The Tabard Inn and Blackmoor. My moderator voice is purple.

User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Re: Work in progress - hexworld generator

Post by isomage » Wed Aug 18, 2010 5:17 am

Nothing fancy for the landmasses so far -- the program just intersects the icosahedron with a 3-dimensional noise field, and a hex is either black or white depending on whether the noise value at its center is high or low. I don't know if I'll go so far as to try to simulate plate tectonics, but I doubt I'll just use a single noise field for elevation either. I'll have to experiment a little.
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
Bonetti
Fire Giant
Posts: 1163
Joined: Wed May 20, 2009 3:03 am
Gender: male
Location: Garden Grove, California

Re: Work in progress - hexworld generator

Post by Bonetti » Wed Aug 18, 2010 7:45 am

I'm already impressed, can't wait to see future revisions :-)
Darokin expansion (maps, notes, merchant houses)
NaNoWriMo: Winner 2013-2017; Camp NaNoWriMo: 2014-2018
Image

User avatar
Azaghal
Green Dragon
Posts: 4316
Joined: Wed Mar 31, 2010 7:25 pm
Gender: male
Location: Albuquerque, NM USA
Contact:

Re: Work in progress - hexworld generator

Post by Azaghal » Wed Aug 18, 2010 8:58 am

Bonetti wrote:I'm already impressed, can't wait to see future revisions :-)
I definitely second that!!
Sean "Azaghal" Pennington

User avatar
Chimpman
Hadozee
Posts: 7929
Joined: Thu May 22, 2008 6:52 pm
Gender: male
Location: USA, California

Re: Work in progress - hexworld generator

Post by Chimpman » Wed Aug 18, 2010 6:22 pm

Yeah, if I didn't make it clear before, I am also very impressed with this.

Would it be somehow possible to take a "pre-generated" noise file and pipe it into the application? I'm wondering if we could somehow create a bin model for a pre-existing world, and then feed that into your program.
THRESHOLD Magazine - The Mystara Fanzine
Visit the Exiles Campaign Setting (a Mystara / Spelljammer crossover)
Visit Mystara 2300 BC

Moderator of The Tabard Inn and Blackmoor. My moderator voice is purple.

User avatar
Bonetti
Fire Giant
Posts: 1163
Joined: Wed May 20, 2009 3:03 am
Gender: male
Location: Garden Grove, California

Re: Work in progress - hexworld generator

Post by Bonetti » Wed Aug 18, 2010 9:26 pm

(Didn't mean to imply you weren't :-) )

One of my medium- to long-term goals for my game is to pull it into Spelljammer. This would help immensely with Planet of the Week scenarios -- and while I can do a half-baked job of making a quick continental map, the coastlines are never adequately jaggy. This approach looks like it would address that pretty well.

One parameter it would be nice to be able to adjust, though, is sea-level -- i.e. being able to take the same basic geography and push it from mostly a water world to mostly a land world. (I'm sure this already occurred to you :-) )
Darokin expansion (maps, notes, merchant houses)
NaNoWriMo: Winner 2013-2017; Camp NaNoWriMo: 2014-2018
Image

User avatar
Chimpman
Hadozee
Posts: 7929
Joined: Thu May 22, 2008 6:52 pm
Gender: male
Location: USA, California

Re: Work in progress - hexworld generator

Post by Chimpman » Wed Aug 18, 2010 10:17 pm

Yeah, I'll second that. Raising and lowering water levels on a fixed map would be super cool!
THRESHOLD Magazine - The Mystara Fanzine
Visit the Exiles Campaign Setting (a Mystara / Spelljammer crossover)
Visit Mystara 2300 BC

Moderator of The Tabard Inn and Blackmoor. My moderator voice is purple.

User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Re: Work in progress - hexworld generator

Post by isomage » Wed Aug 18, 2010 10:24 pm

Yeah, sea level could be a parameter, and potentially so could things like rainfall and sunlight (allowing creation of desert worlds, jungle worlds, frozen worlds, etc.), but I'm not that far into the development yet.

Bringing existing worlds into the program would be difficult. The maps don't currently have any kind of useful coordinate system for hexes, so it wouldn't be possible in the current implementation to specify particular tiles for particular locations. Depending on how the program evolves, it may turn out that the renderer could be separated from the generator in such a way that this could be done, but it's still too early to tell.

I'm interested in all your ideas, though, so keep 'em coming and I'll see what I can do :)
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
Bonetti
Fire Giant
Posts: 1163
Joined: Wed May 20, 2009 3:03 am
Gender: male
Location: Garden Grove, California

Re: Work in progress - hexworld generator

Post by Bonetti » Wed Aug 18, 2010 11:18 pm

Excellent :-)

Speaking of rainfall/cloud cover, one of the things I liked about the SMAC map generator was the ability to designate tidal/erosion forces as well as relative quantity of water (more/less cloud cover/rainfall). I forget what Tidal controlled, but erosion dictated how steep/shallow the terrain height was on the map. I'm not sure how well that would adapt here, but it's another idea.

I know you are uncertain about tectonic behavior, but how about rivers? Is a river baseline in the stars?
Darokin expansion (maps, notes, merchant houses)
NaNoWriMo: Winner 2013-2017; Camp NaNoWriMo: 2014-2018
Image

User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Re: Work in progress - hexworld generator

Post by isomage » Thu Aug 19, 2010 4:31 am

Bonetti wrote: Is a river baseline in the stars?
I've never had very much luck with rivers. To get them working right you tend to need to do erosion, and I'm definitely not going to do that. Still, some sort of random wandering from mountain hexes through land hexes to water hexes might be doable.
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Re: Work in progress - hexworld generator

Post by isomage » Thu Aug 19, 2010 4:38 am

Here are ten random results from my first mountain test. I think there's some good there, and some not-so-good. Without modeling plate tectonics we have no guarantee that mountains will always be realistic, so the question is: are they "good enough"? Does every world need to be a winner, or might typical usage involve generating a few worlds and seeing which one you like best? Program parameters could include how clumped-together the landmasses are, how frequent and how large the mountain ranges are, what the sea level is, and so on, so people would be able to tune the output.

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
happylarry
Ogre
Posts: 276
Joined: Mon Jun 09, 2008 7:44 pm
Gender: male
Location: Cheshire

Re: Work in progress - hexworld generator

Post by happylarry » Thu Aug 19, 2010 1:37 pm

Hey - these are already looking really good. Personally, I'd be happy to churn out 10 worlds to get one that was 'just right' - and the ability to alter various parameters to get there would be cool to.

Did I say this looked really good?

User avatar
Dave L
Storm Giant
Posts: 1591
Joined: Wed Nov 26, 2008 10:58 pm
Gender: male
Location: Plymouth, England

Re: Work in progress - hexworld generator

Post by Dave L » Thu Aug 19, 2010 1:44 pm

They are looking really good - how long does it typically take to generate one world?

User avatar
Seer of Yhog
Outer Being
Posts: 3230
Joined: Fri May 23, 2008 1:29 am
Gender: male
Location: Ottawa, Canada

Re: Work in progress - hexworld generator

Post by Seer of Yhog » Thu Aug 19, 2010 2:05 pm

I'll mindlessly echo what the others have said - this is a great utility!
Moderator for Mystara. My moderator voice is heliotrope.

My Blog is here!

User avatar
AuldDragon
White Dragon
Posts: 2231
Joined: Mon Oct 06, 2008 2:28 am
Gender: male
Location: Silver Spring, MD
Contact:

Re: Work in progress - hexworld generator

Post by AuldDragon » Thu Aug 19, 2010 3:04 pm

isomage wrote:Yeah, sea level could be a parameter, and potentially so could things like rainfall and sunlight (allowing creation of desert worlds, jungle worlds, frozen worlds, etc.), but I'm not that far into the development yet.

Bringing existing worlds into the program would be difficult. The maps don't currently have any kind of useful coordinate system for hexes, so it wouldn't be possible in the current implementation to specify particular tiles for particular locations. Depending on how the program evolves, it may turn out that the renderer could be separated from the generator in such a way that this could be done, but it's still too early to tell.

I'm interested in all your ideas, though, so keep 'em coming and I'll see what I can do :)
You could have each tile have an altitude field, so that when you set the sea level, it'll automatically fill in all those at the appropriate levels with water tiles. That could also help with potential river flow, since rivers always flow downhill. They'll start in one tile, and then check each surrounding tile for one at a lower altitude, and then flow into that one; wash, rinse, repeat. :) If you ever included rainfall, that could help determine where rivers start.

If you did include altitude metadata, it might give you a starting point for converting altitude files into the hexmap, or even vice versa. I have no idea how hard it would be though.

I was also just thinking about plate tectonics while looking at this image on Wikipedia. You'll notice some plates seem to uniformly move in one direction, while some plates like the North American plate and the Eurasian plate are spinning. Plates boundaries could be randomly generated, and then the direction, spin, and speed could be randomized; that would determine where mountains and ridges would be. Again, no clue how difficult that would be to model. It is something interesting for us world builders to think about when making planets, even if we can't have it generated randomly. :)

Jeff
Let's Play Old Games with AuldDragon (Youtube) | My 2nd Edition Blog
Monster Mythology Update Project | Spelljammer Livestream Campaign
"That sums it up in a nutshell, AuldDragon. You make a more convincing argument. But he's right and you're not."

User avatar
isomage
Orc
Posts: 29
Joined: Sat Apr 18, 2009 11:12 am
Gender: male
Contact:

Re: Work in progress - hexworld generator

Post by isomage » Thu Aug 19, 2010 9:08 pm

Dave L wrote:how long does it typically take to generate one world?
Depends on the resolution. The final image in the first post has 30,722 hexes and that takes less than half a second. The next stage of recursion, with 122,882 hexes, takes about 1.5 to 2 seconds. 491,522 hexes takes around 7 to 8 seconds. The time will doubtless increase as I start doing climate calculations.
My random map generators and GIMP scripts: http://axiscity.hexamon.net/users/isomage/

User avatar
Dave L
Storm Giant
Posts: 1591
Joined: Wed Nov 26, 2008 10:58 pm
Gender: male
Location: Plymouth, England

Re: Work in progress - hexworld generator

Post by Dave L » Thu Aug 19, 2010 11:23 pm

isomage wrote:
Dave L wrote:how long does it typically take to generate one world?
Depends on the resolution. The final image in the first post has 30,722 hexes and that takes less than half a second. The next stage of recursion, with 122,882 hexes, takes about 1.5 to 2 seconds. 491,522 hexes takes around 7 to 8 seconds. The time will doubtless increase as I start doing climate calculations.
Keeping it less than say 30 seconds will mean producing a dozen worlds and picking the best will be no problem at all. So if you can keep the time down like you have I'd say don't worry about plate tectonics.

User avatar
Blacky the Blackball
White Dragon
Posts: 2036
Joined: Fri Aug 14, 2009 7:47 am
Gender: male
Location: Brighton, UK
Contact:

Re: Work in progress - hexworld generator

Post by Blacky the Blackball » Fri Aug 20, 2010 8:06 am

isomage wrote:
Dave L wrote:how long does it typically take to generate one world?
Depends on the resolution. The final image in the first post has 30,722 hexes and that takes less than half a second. The next stage of recursion, with 122,882 hexes, takes about 1.5 to 2 seconds. 491,522 hexes takes around 7 to 8 seconds. The time will doubtless increase as I start doing climate calculations.
I'm being a bit thick here. What's the relationship between world size, hex size, and number of hexes?

I make it roughly...

Length of side of each face = 4/(1+sqrt(5))r, which is approximately (for our purposes) 1.25r. With our r of 4,000, that makes each face a convenient 5,000 miles per side.

Since each face is an equilateral triangle, the area of each will be (sqrt(3)/4)x^2, which with an x of 5,000 is 10,825,318 square miles.

If we use 72-mile hexes, each hex is 4489.476 square miles, so that's 2411.25 hexes per face, or 48,225 hexes in total.
If we use 24-mile hexes, each hex is 498.831 square miles, so that's 21,721 hexes per face, or 434,420 hexes in total.

So as a rough estimate, a map of Earth at a 24-mile hex size (or a map of the whole of Mystara at the same scale as the Alphatia maps) would be generated in around Isomage's 7 to 8 seconds mark.
Check out Gurbintroll Games for my free RPGs (including Dark Dungeons and FASERIP)!

(I'm a moderator for "The Orc's Revenge" and its sub-forums. If I need to post anything officially as a mod, rather than just as a user, I'll post it in green.)

User avatar
Azaghal
Green Dragon
Posts: 4316
Joined: Wed Mar 31, 2010 7:25 pm
Gender: male
Location: Albuquerque, NM USA
Contact:

Re: Work in progress - hexworld generator

Post by Azaghal » Sat Aug 21, 2010 10:27 am

Plate techtonics would be nice but not an essential for me. The ability to raise and lower water level or set as a percentage is more important to me.
Also if we can set an overall planetery temp, ie jungle/swamp, temerate normal, ice covered, that would be great. I`d love to make some iced worlds.
Sean "Azaghal" Pennington

User avatar
Beedo
Goblin
Posts: 9
Joined: Sun Jan 17, 2010 2:54 pm
Gender: male

Re: Work in progress - hexworld generator

Post by Beedo » Sat Aug 21, 2010 7:59 pm

I saw this and had a nerdgasm. Very cool project!

Regarding plate tectonics... I would say don't bother, the world builder could explain the creation of the mountains 'after the fact' and insert necessary plates, subduction, etc to account for the ranges.

Ditto with rivers, too many variables to worry about.

For climate - this would be cool. Have different "world views" - one where you can see the base world, another with an overlay of wind, another with an overlay of ocean currents, another with an overlay of climate zones, etc (I'm thinking you'd need to apply basic wind, current, land mass and mountain placement to identify wet and dry zones).
My Campaign Journal - Beedo's Gothic Greyhawk:
http://www.dragonsfoot.org/forums/viewt ... 26&t=45047

User avatar
Azaghal
Green Dragon
Posts: 4316
Joined: Wed Mar 31, 2010 7:25 pm
Gender: male
Location: Albuquerque, NM USA
Contact:

Re: Work in progress - hexworld generator

Post by Azaghal » Sun Aug 22, 2010 9:02 am

Robert S. Conely has a "sandboxing" systrem that has some useful climatology work.

http://batintheattic.blogspot.com/2009/ ... ndbox.html
Sean "Azaghal" Pennington

User avatar
Gecko
Storm Giant
Posts: 1633
Joined: Wed Jun 04, 2008 11:51 am
Gender: male
Location: Marooned in California

Re: Work in progress - hexworld generator

Post by Gecko » Sun Sep 19, 2010 2:19 am

As a geographer with a fair amount of training in geology as well, I think I can provide some useful comment on the below.
AuldDragon wrote:I was also just thinking about plate tectonics while looking at this image on Wikipedia. You'll notice some plates seem to uniformly move in one direction, while some plates like the North American plate and the Eurasian plate are spinning.
I can't get the lower half of this image to load, but based on just the top half I can say that this "spinning" you noticed is an illusion caused by distortion in the type of map projection used in that image (ie if you were to plot the same thing on a physical 3-d globe, the movements of each plate would agree). I know that some small microplates have been shown to "rotate" (particularily along major plate boundaries where they are effectively accomidating lateral movement between two major plates - ie out in the mojave desert east of the San Andreas portions of the North American plate have these such smaller microplates) but I'm fairly certain none of the main tectonic plates "rotate" - though hot spot evidence (and other more convoluted and complex researches) do show that plates can and have changed their direction of movement in the geologic past.

Update: Came across something by chance and it made me think back to this post-
Wikipedia has that the Amur microplate (which is actually rather decent in size despite the name "micro") is rotating, but I can't find any confirmation of that in the sole linked source (though I could only access the abstract, nothing in the abstract seems to support that claim). The French and Italian versions of the same wikipedia page seem to be saying something about a 0.93 degree rotation every million years, but I don't know where they get that number from. However the direction of motion indicated on the french graphic seems to be indicating a direction of movement away/towards the transformational boundaries and roughly parrallel to the convergent and divergent boundaries, but plates should be moving away from divergent, towards convergent, and parrallel to transformational boundaries, by definition, so I'm wondering if the labels are wrong on that map graphic. I'm also not sure what to make of the triple-junction it shows between a subduction and a divergent boundary between the Amur & Okinawa microplates and the Philippine plate (triple junctions usually involve other combinations of boundaries not conv.-div., I can't picture how the mechanics of such a junction would work). so either the map is quite wrong or this is just something beyond my level of training in geology (do we have any fully fledged geologists on here?)

Post Reply

Return to “The Squishy Bits”