Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 10

Author Topic: DwarfHeightmap 1.2 - a program to import heightmaps into Dwarf Fortress  (Read 44045 times)

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com

Now open-sourced! Download it here!

Hullo folks.

Thought I'd take a moment to show off my heightmap importing program for Dwarf Fortress - I should have it released in the week, barring no major bugs.

So, yeah, using this:



You import these:



And get this:



It handles all six fields you can draw in the map editor, and gives you tools to adjust contrast and stuff.  It also supports image resizing, in case your map is huge compared to what DF can handle (although it's advisable to resize before importing, because the code's pretty simplistic).

So, yeah, if you ever wanted to battle over the USA, have rainfall patterns in the shape of Jim Adkins' head, or simply create a more Earth-like temperature gradient, with equator and poles, this is the tool for you.

It can be downloaded at http://dffd.wimbli.com/file.php?id=389

This program requires .NET FRAMEWORK 2.0 TO RUN

How to use
  • Make sure you have one or more 24bit, preferably greyscale images (the program supports most standard formats such as BMP and JPG).  Paint.Net is a great tool to draw these, or you can download them from the Internet.  The program will dynamically resize the image for you, so it doesn't matter what size your original is - obviously, the bigger, the higher the detail's going to be.  Colour pictures can be used, but the height of each tile is set to be an average of R, G, and B, so this can have weird consequences.
  • Open the program, enter a map name into the "Map Name" box
  • Pick your chosen dimensions, and choose the type of heightmap you want to use, and hit "Open Heightmap File".  Find the relevant picture
  • The program calculates each pixel through the simple formula - ((average colour) * Ratio + Offset).  I've supplied some default arguments for these, to try and get the closest match to the default map editor settings, but dark or overly bright heightmaps might need these fiddled with.  If you don't like the end result, fiddle with these on your next runthrough.  For altitude, think of sea level as (100 - Offset) * Ratio - so adjust this number to around abouts the same as the darkest point of land in your image.
  • Press "Process" to convert the image and store it in temporary memory.  You can now import additional images for the various types, if you want
  • When you've got all of your maps imported, hit the "Commit to File" button, and find world_gen.txt - it's in the data\init directory of DF.  You might need to run the map editor at least once to have this file.
  • Assuming nothing went wrong, boot up DF, load the custom map settings, and select your new file!  You can now edit it further if you want to tweak some settings, or you can go generate it.  You might need to zero out the minimums in the advanced parameters, because imported heightmaps often don't have everything DF wants
  • Play the game.  Show me screenshots.  Send Toady money.

-Angry Lawyer
« Last Edit: June 18, 2011, 08:45:22 am by Angry Lawyer »
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #1 on: August 04, 2008, 07:25:31 pm »

This will be awesome.  Didn't someone estimate that a Standard sized world was about the size of Britain anyway?
Logged

JoRo

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #2 on: August 04, 2008, 07:41:39 pm »

Aw, I thought that the new topic meant you were releasing it.  I can't wait to make a replica of Washington and start a fort where I'm actually living, further blurring the lines between Dwarf Fortress and real life.
Logged
You have been struck down.
The giant cave spider spits out your head.

Draco18s

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #3 on: August 04, 2008, 08:22:58 pm »

Aw, I thought that the new topic meant you were releasing it.

Same.
Logged

Grek

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #4 on: August 04, 2008, 08:28:17 pm »

Holy toad, this is awesome.
Logged

Fieari

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #5 on: August 04, 2008, 08:30:12 pm »

Question though... what's with the dark blue stripe at the right side?  And in Great Britain itself, there seems to be an odd stripe at the north end of the island...
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #6 on: August 04, 2008, 08:43:16 pm »

Question though... what's with the dark blue stripe at the right side?  And in Great Britain itself, there seems to be an odd stripe at the north end of the island...

Bug in DF.
Logged

Tamren

  • Bay Watcher
  • Two dreams away
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #7 on: August 04, 2008, 10:38:48 pm »

wow awesome! I wonder if we could import a scale model of earth someday  :)
Logged
Fear not the insane man. For who are you to say he does not percieve the true reality?

MrGimp

  • Bay Watcher
    • View Profile
    • WMP Web Design
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #8 on: August 04, 2008, 11:05:00 pm »

Shouldnt that be reversed?  Scotland is mountainous Enlgand is flat(ter).  In the black and white image of Britain, the white is the higher points, but the DF Britain has all of southern England a mountain range.  In this Britain, civilization would center in Scotland, which is still cool...but maybe if you take the black and white image and flip the color scale THEN put it in, it would become more realistic?

Awesome tool by the way!
Logged
Thus ends the official written history of the fortress known as Boatmurdered. May their tortured souls rest in peace.

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #9 on: August 05, 2008, 01:31:30 am »

That's snow, rather than mountains :P

As for the stripe:

Quote from: Toady
fixed problem with the evil/good conversion of very large subregions

Still, I think I've got most of the bugs resolved, just need a few more tests to run then I'll release the first version after work.

-Angry Lawyer

Emperor_Jonathan

  • Bay Watcher
  • GET UP SUCKER
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #10 on: August 05, 2008, 01:35:26 am »

HOLY CRAPOLA DWARFMAN!


That's awesome.
Logged

Footkerchief

  • Bay Watcher
  • The Juffo-Wup is strong in this place.
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #11 on: August 05, 2008, 03:17:58 am »

Okay, that's friggin incredible.
Logged

Fleeb

  • Bay Watcher
  • The Fleebiest
    • View Profile
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #12 on: August 05, 2008, 11:31:40 am »

Fantastic, can't wait to play around with this.
Logged
"If you push something hard enough, it will fall over" -Fudds First Law of Opposition
"If it goes in, it must come out" -Teslicles Deviant to Fudds Law

TheSpaceMan

  • Bay Watcher
    • View Profile
    • http://www.digital-lifeform.com
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #13 on: August 05, 2008, 11:34:07 am »

Thank you so much, for such a long time I have had this strange urge to do a random map generator for Df (just for my own sake) and this way i can just make something that generates grayscales load them trough your program, and tada!

Thanks. :D
Logged
Poking around with a DFParser.
Bodypart names, creatures names in one easily overviewable place.

Oh my new (old) picture?

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #14 on: August 05, 2008, 11:40:58 am »

I've just uploaded it - I'll write some instructions shortly, although it's pretty self-explanatory.

Updated the original post - there's a link there.

It takes 24bit bitmaps as its input - greyscale them first or it'll make up its own decisions on what parts are high or low.

If you can figure it out before I get to writing instructions, I'd love to see what you've made from it.  Let me know of any bugs or irrational interface problems and I'll make a note for the next version.

-Angry Lawyer
« Last Edit: August 05, 2008, 11:43:33 am by Angry Lawyer »
Logged
Pages: [1] 2 3 ... 10