Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Simple (But Powerful) Heightmap Generator  (Read 6933 times)

Draco18s

  • Bay Watcher
    • View Profile
Simple (But Powerful) Heightmap Generator
« on: March 27, 2009, 02:34:11 pm »

Through a discussion on the Cartographer's Guild forums I ran across a thread about how to make mountains using a program called Wilbur and thought that it might come in handy for those who like making their own heightmaps for import with DFHeightmap.  The tutorial I linked to includes the creation of rivers, but I think we can leave that to DF.  I've included and edited below.  You can run rivers if you want (Filter>>Erosion>>Erosion Cycle or either of the other two options if you want to mess with them), but what DF does with that is uncertain, I just did a test and one major waterway ended up mostly ignored with a few small lakes (actually, I think they were the region's oceans).



In Wilbur create an empty map and change the size (Surface>>Size) to 1024x1024.  If you have a simple map you wish to add ranges too, File>>Open and import a PNG that has basic areas filled out (water in black, landmasses in white, coastal regions in a dark gray).

Then generate the heighfiled (Filter>>Calculate Heightfield).  This opens the Heightfield Computation window.  Change the paramters by selecting Ridged Multifractal from the drop-down menu.  If using an imported map change Operation to Multiply.  Uncheck the Spherical Evaluation box and hit the scaling button. In the surface scaling window select Broken Value from the dropdown menu. Then press OK and watch Wilbur generate the terrain.

Fill the basins (Filter>>Fill>>Fill Basins).  Use the default slope value of -1. Next select only the flat areas of the map (Select>>From Terrain>>Flat Areas). Once again use the default values. Then add some percentage noise to these areas (Filter>>Noise>>Percentage Noise). Choose 2 or 3% and press OK. Deselect the flat areas (Select>>Deselect).  (Run rivers here)

Change to a grey scale map (Texture>>Grey maps>>Height Map). Then save the map as 16bit.

Open the greyscale map in Gimp. In order to increase the contrast and make the elevation effects stand out more it is necessary spread the grey map over the full range of black to white. To do this open the levels window (Colors>>Levels).

You'll want to drag the black and white level markers towards the middle to be near the edges of the black area on the histogram.

Save out as another file, it should drop down to 8bit grayscale.  If not, it doesn't really matter.

Import this file into DFHeightmap as elevation, tweak as necessary the parameters (an offset of 70 to 90 with default ratio should work fine).  Import your other maps (or not) and save to world_gen.txt.

Run and generate a new world.
Logged

Volfram

  • Bay Watcher
  • hate you all.
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #1 on: March 27, 2009, 02:43:42 pm »

Now this is the kind of thing I was expecting out of your Cartography thread.
Logged
Andir and Roxorius "should" die.

Yes, actually, I am trying to get myself banned.  I wish Toady would quit working on this worthless piece of junk and go back to teaching math.

Draco18s

  • Bay Watcher
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #2 on: March 27, 2009, 04:37:41 pm »

Now this is the kind of thing I was expecting out of your Cartography thread.

*Shrug* I had to browse their forums a bit before I found this.
Logged

Mr.Person

  • Bay Watcher
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #3 on: March 27, 2009, 04:58:14 pm »

I don't have time to do this now, but what do you get if you import maps?
Logged
Youtube video of the year, all years.
Hmm...I've never been a big fan of CCGs - I mean, I did and still do collect Pokemon cards, but I never got heavily into the battling and trading thing.

By definition that makes you a fan since you still buy them.

Draco18s

  • Bay Watcher
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #4 on: March 27, 2009, 06:46:13 pm »

You can open images and use them as terrain files, I've imported heightmaps to further mess around with.  I don't have any of the File>>Import file types, so I assume its just another way to get the same data from a different kind of file.
Logged

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #5 on: March 27, 2009, 10:07:44 pm »

I'm having a few problems with large maps, it cant place the rainfall, drainage, savagery, volcanism and so on 2000 rejects :-\. Anyone else have this problem? I've not used DFHeightMap before.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

Draco18s

  • Bay Watcher
    • View Profile
Re: Simple (But Powerful) Heightmap Generator
« Reply #6 on: March 28, 2009, 10:07:24 pm »

You might want a few random displacement maps for each of those.  Here's a couple to get you started.
One
Two
Three
Four
Five

Just import those like elevation, leaving one blank means that it's uniformly one value (lowest?) and so it has trouble.
Logged