Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6] 7 8 ... 10

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

RPharazon

  • Bay Watcher
  • [SEVERONBREAKS]
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #75 on: August 11, 2008, 11:13:37 pm »

I started with this:

Spoiler (click to show/hide)

And I ended up with this:

Spoiler (click to show/hide)

It's awesome, but it's unusable. It apparently can't place mountains, swamps, forests, deserts, and there's no dwarves or goblins.

The other problem is that it seems to be shifted to the left somewhat.
Logged
Quote
<Zaratustra> DF -is- a complex version of the sims
<Zaratustra> except instead of purchasing new sofas
<Zaratustra> you die

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #76 on: August 11, 2008, 11:19:22 pm »

I'm too lazy to make it, but I want to play on a map that's giving me the finger.
If anyone is willing to post up the init for it.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #77 on: August 12, 2008, 12:49:57 am »

I started with this:

Spoiler (click to show/hide)

And I ended up with this:

Spoiler (click to show/hide)

Let me see what I can do.  I'm no master at this, but I have the patience and a general idea of what's going on to make it work.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #78 on: August 12, 2008, 01:46:46 am »

Ok, I tweaked the map (elevations) to give more contrast and to remove the odd "mountains on oceans" that appear around the whole continent (there are also white lines, are those rivers?  Oh, those are roads, this isn't a real heightmap, it's an inverted drawn map).  Import was also offset by 20 using the default ratio.

After supplying random maps (the other 5 that aren't elevation)...
Didn't give it temp, as it doesn't matter too much (you have to nullify region counts on a few things, had to do just about everything).  My texture for volcanoes failed (couldn't place even 1).  After that it genned fine, no rejects.

Oh, and I cropped your heightmap a little closer so that there'd be a little more definition in the landscape to the original.

Spoiler (click to show/hide)

Not sure I got the mountains to come out right, probably needed more contrast.  You're going to have to fool with it, get the areas that are mountains to be WHITE and the areas that are not mountains to be between 25% black and 74% black.  Those coastal areas need to be fixed first, followed by the roads and names (though the DF randomizer will take care of them being legible).  Lets see...

There that's looking a little better (pics in a sec), one "not enough civ locations" reject and then history.  Map should turn out to have enough mountains in the right place.

Edit:
Eh, had more mountains.  In the general area of the mountain chain in the original, but not...quite.  Too much more brightness and contrast and things will start losing out in other ways.
« Last Edit: August 12, 2008, 01:51:36 am by Draco18s »
Logged

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap - a program to import heightmaps into Dwarf Fortress
« Reply #79 on: August 12, 2008, 02:03:03 am »

Wait... The map is fucked up looking, something has gone terribly wrong: http://img231.imageshack.us/my.php?image=worldmapregion110501km9.png
When I gen a world with the elevation only this doesn't happen.

Weird.  Wanna send me the sources you're using and the steps/parameters you used to create that?  From first guess, it's from not enough of an offset on elevation - try plumbing in 89 into the height offset.

-Angry Lawyer

Mullog

  • Bay Watcher
  • Why do my dwarves die???
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #80 on: August 12, 2008, 02:25:51 am »

I found more stuff to report. Yay! :-)

The first is a minor problem with the defaults. In some languages (like norwegian), decimal numbers are written using , instead of . as the decimal separator. This causes a ... formatting error I think, don't remember the exact message now, when the program tries to convert the value into a decimal number. The simple fix would be to change the preset from a string value to a float value. That will take the local settings into account.

The second problem occured when I used a map that wasn't square. I had a map that was wider than it should, and that caused the map to be imported as a mess. When I resized the map the import was fine. Could that be the probelm with RPharazon's map?


Anyway. This is really great stuff! I'm working setting up a large world based on a height map of Middle Earth. Will post it here as soon at its done  8)
Logged

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #81 on: August 12, 2008, 02:36:26 am »

Yeah, I think the resizing code's a little off.

Workaround - resize your bitmaps to the final required size externally.

If people send me their maps and the settings they're using, I'll debug it for next release.

-Angry Lawyer

Mullog

  • Bay Watcher
  • Why do my dwarves die???
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #82 on: August 12, 2008, 02:53:36 am »

I just checked your code again and noticed that you use your own code to read the bitmaps. Is there any particular reason that you don't use the standard imaging methods in .net? The reason I ask is that you get some nice resizing support there and you also get support for a bunch of image formats in addition to bmp.
Logged

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #83 on: August 12, 2008, 03:55:59 am »

Generally it was on a whim (and because I'm pretty new to .NET so didn't know how deep the standard components went) and because I wanted to prove to myself that I could figure out how, but I'll probably move onto the standard imaging methods.  If I can find out what they are, at least.

Edit:  I'll try and get a new version out by the end of the week.

-Angry Lawyer
« Last Edit: August 12, 2008, 04:03:56 am by Angry Lawyer »
Logged

RPharazon

  • Bay Watcher
  • [SEVERONBREAKS]
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #84 on: August 12, 2008, 10:48:04 am »

-snip-

Well, it is kind of hard to get actual heightmaps for fictional (and video game) lands. I tried it again, using your little spiral map for the savagery, vegetation, drainage, and rainfall parameters. It came out fine. The general outline of the place was intact, and there was enough variety to have every civ, and two surviving dragons and a titan by the year 500.

I do have to mess about with it some more.


Workaround - resize your bitmaps to the final required size externally.

My map is 800x800, but it was still shifted to the left. Draco, in his cropping, seems to have fixed the problem somehow.

Or am I missing something and is the template not a square?

Logged
Quote
<Zaratustra> DF -is- a complex version of the sims
<Zaratustra> except instead of purchasing new sofas
<Zaratustra> you die

TheSpaceMan

  • Bay Watcher
    • View Profile
    • http://www.digital-lifeform.com
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #85 on: August 12, 2008, 10:55:21 am »

I would love to know the gray value for land just above the water. It's very hard to guess, either i get very high clifflike effects by the coast or i get the entire country lies under water. if i knew the gray values i could balance it out. ^^

(tries to fit Sweden, Denmark, Norway and UK into one map)
Logged
Poking around with a DFParser.
Bodypart names, creatures names in one easily overviewable place.

Oh my new (old) picture?

RPharazon

  • Bay Watcher
  • [SEVERONBREAKS]
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #86 on: August 12, 2008, 11:40:13 am »

I would love to know the gray value for land just above the water. It's very hard to guess, either i get very high clifflike effects by the coast or i get the entire country lies under water. if i knew the gray values i could balance it out. ^^

(tries to fit Sweden, Denmark, Norway and UK into one map)

From Draco's post: "get the areas that are mountains to be WHITE and the areas that are not mountains to be between 25% black and 74% black."

If you want to make a sandworld, constantly on the shore of some sea, it will take patience unparalleled in this world.

Oh, and I'm sure that the Ratio value fits in there somewhere.
((average colour) * Ratio + Offset) explains it somehow.  ;)
Logged
Quote
<Zaratustra> DF -is- a complex version of the sims
<Zaratustra> except instead of purchasing new sofas
<Zaratustra> you die

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #87 on: August 12, 2008, 11:54:03 am »

It's a bug in how I handle images - every program has it's own foibles about what to do after the end of an image, I think.

Still, I've refactored the code to use .NET's image handling, which is safer, handles things other than .BMP, and actually works.

Sea level in DF is 100.  So, if you want a certain pixel to be the lowest point of land possible, find out its colour and subtract it from 100 and set that to be the offset.  So if you want the lowest beach to be at colour 33, set your offset to 77.  Bam, anything less than 33 is water, anything equal above becomes dry land.

I'll release a new version later on.

-Angry Lawyer

Angry Lawyer

  • Bay Watcher
    • View Profile
    • Angry-Lawyer.com
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #88 on: August 12, 2008, 12:16:40 pm »

New version released - it now handles most standard image formats, and might even support different resolutions, as I'm now using the proper .NET bitmap tools.  Resizing now should work flawlessly.

-Angry Lawyer

Draco18s

  • Bay Watcher
    • View Profile
Re: DwarfHeightmap 1.1 - a program to import heightmaps into Dwarf Fortress
« Reply #89 on: August 12, 2008, 01:51:03 pm »

-snip-

Well, it is kind of hard to get actual heightmaps for fictional (and video game) lands. I tried it again, using your little spiral map for the savagery, vegetation, drainage, and rainfall parameters. It came out fine.

'Tis hard, I agree.  Might be more practical to paint ontop of the (color) map with shades of grey based on how high you think the land should be, as if you were painting topographical lines.  If your shades of grey differ by a lot, it wouldn't be too much work (apply a blurr to it when you're done) and DF will erode it out some too.  You can even do the same with temp, rain, and drainage maps, as they have an effect on what terrain is generated.  Volcanism = Elevation and you'd get mountainous-only volcanoes, but that's where the fantasy world probably has them.  Savagery...render a noise cloud.  If your temp/rain/drain maps aren't too varried, you can combine it with a noise map (render on a different layer and then give it 50% alpha or something so that your paint shows through, but leaves variance in non-painted areas).

I would love to know the gray value for land just above the water.

RGB 65,65,65, IIRC.  I remember 64,64,64 was the highest "underwater" value.  The 25% number is from the basis that 0-99 is water and 400 is the highest peak, (99+1)/400 = 0.25  Mountains work the same way, 300-400 is mountains.
Logged
Pages: 1 ... 4 5 [6] 7 8 ... 10