Bay 12 Games Forum

Please login or register.

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

Author Topic: dorfgen, DFHack Legends exports to minecraft.  (Read 11563 times)

Thutmose

  • Bay Watcher
    • View Profile
dorfgen, DFHack Legends exports to minecraft.
« on: September 06, 2015, 09:58:20 pm »

Introducing dorfgen A Minecraft mod which imports DF world maps.

The two games I interact with the most are DF and Minecraft, so I figured why not combine them.

I found http://www.bay12forums.com/smf/index.php?topic=138366.0 and rather enjoyed it, but it had the issue of taking a while to generate large worlds, and not being able to adjust for things added by mods, so I made a version of it which runs as a Forge mod for minecraft.

it loads the terrain and initially loads the biomes in a very similar way to Dorven Realms, but does so as the world generates.  It then also tries to do adjustments to the biome based on temperature and rainfall, and eventually as many other DF maps as I can make use of. 

It then generates minecraft structures where sites are, currently mostly replacing them with villages, proper cave and lair replacement will come later, Fortresses are currently replaced with strongholds.  The sites are loaded from the first section of the legends.xml and legends_plus.xml, and is outputted to a truncated version of the file, as the artifact, entity and other information is not currently needed, and makes the xml rather large.

Spoiler (click to show/hide)

source located at
https://github.com/Thutmose/dorfgen
and current releases at
https://github.com/Thutmose/dorfgen/releases

Usage:
install minecraft forge 1481 for minecraft 1.7.10.
run minecraft once to generate the needed folders.
place the el, bm, elw, evil, rain, tmp, veg and vol images into config/dorfgen.
place the legends.xml and the legends_plus.xml into config/dorfgen.
run minecraft, select generator.finite as the worldtype when creating a new world.
« Last Edit: September 06, 2015, 10:27:57 pm by Thutmose »
Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #1 on: September 06, 2015, 11:08:37 pm »

Interesting program.

What if you reach the edge of a Dwarf Fortress map? Terrain still generated?
Logged
Thank you for all the fish. It was a good run.

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #2 on: September 07, 2015, 03:15:42 am »

So this is still being worked at :)
I just recently discovered the problem behind the conversion in the "Dorven Realms" thread together with ideas on how some maptiles could be converted.
Dorven Realms doesnt convert maptiles(the ones, 1 dwarf can stand in) to MC, it converts whole embarcmap/travelmap-tiles, which each consist of 48x48 of those maptiles and can contain hills, streams, caves, villages etc.
i'd like to contribute to a converter that works with the maptiles.

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1266006-dorven-realms-a-dwarf-fortress-based-minecraft?comment=10
« Last Edit: September 07, 2015, 03:24:19 am by Pvt. Pirate »
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Thutmose

  • Bay Watcher
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #3 on: September 07, 2015, 11:07:36 am »

So this is still being worked at :)
I just recently discovered the problem behind the conversion in the "Dorven Realms" thread together with ideas on how some maptiles could be converted.
Dorven Realms doesnt convert maptiles(the ones, 1 dwarf can stand in) to MC, it converts whole embarcmap/travelmap-tiles, which each consist of 48x48 of those maptiles and can contain hills, streams, caves, villages etc.
i'd like to contribute to a converter that works with the maptiles.

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1266006-dorven-realms-a-dwarf-fortress-based-minecraft?comment=10
It currently also uses just the embark tiles rather than the map tiles, mainly due to the difficulty in getting the height to work out properly if using map tiles, minecraft only has 256 possible values for height, whereas DF has much more.  the site placing works though as the site locations are given as coordinates based on a 16x16 square of embark tiles, so with my default 8 blocks per embark tile, this results in each site having 128x128 blocks available for it, which is enough for a large town.  Is it possible to export the map tiles? or is the only way to get the site specific maps? I was planning on trying to actually use the site maps, rather than just making up sites.

it seems each site map is 816x816 pixels, quite a bit more than my 128x128, but I can try to work on something for converting that as well.

Interesting program.

What if you reach the edge of a Dwarf Fortress map? Terrain still generated?

there are two options for what happens here, in one mode, it just generates ocean for ever, in the other it can swap over to more minecraft like terrain.  the second option is still a bit buggy, as there are often sharp borders in the terrain, I have not worked on smoothing functions yet for properly merging it.  I did also work on another mod which can wrap the player around when they leave a border, so I might merge that into the mode where it is ocean forever.
« Last Edit: September 07, 2015, 11:11:06 am by Thutmose »
Logged

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #4 on: September 07, 2015, 11:22:26 am »

1 embark tile <=> 48x48 maptiles
1 worldmap tile <=> 16x16 embark tiles <=> (768x768 = ) 589824 maptiles

and each of those has to be 5x5x4 in size, or be inaccessable from some directions, thus making some completely sane DF cunstructions insanely impassable.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Thutmose

  • Bay Watcher
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #5 on: September 07, 2015, 02:17:29 pm »

1 embark tile <=> 48x48 maptiles
1 worldmap tile <=> 16x16 embark tiles <=> (768x768 = ) 589824 maptiles

and each of those has to be 5x5x4 in size, or be inaccessable from some directions, thus making some completely sane DF cunstructions insanely impassable.

for the horizonal plane, that would be fine, I can see how well my current system extends out from 8 blocks/embark tile to 240 blocks/embark tile.  the problem is with the vertical axis.  as it is, DF has an embark height difference of about 250 or so from the bottom of ocean to top of mountain.  with 8 blocks/embark tile, mountains are already rather squat looking, at 240 they will be practically flat.

edit: I looked into what is needed to increase the height limit from 256, and it essentially requires a re-write of the entire minecraft world save/loading code, and it will not be easy to do that.
« Last Edit: September 07, 2015, 04:48:05 pm by Thutmose »
Logged

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #6 on: September 07, 2015, 05:06:21 pm »

well, you're talking about 1.7.10, arent you?
in 1.8 and above, worlds have cubic chunks of 16x16x16 blocks and can be stacked above eachother as you like. so worlds with 1024 height are actually being produced by some presets within the game.

but as far as i read, it is not a standard feature of DF to export all maptiles on start.
they seem to be created once you actually enter them.
but then again, i'm new to DF and havent looked into the code at all.
but for actual maptiles, 5x5x4 blocks is the minimum size i can imagine being walkable from all 6 (4 plus up/down)directions.
i know MC worlds can be 40.000.000x40.000.000 meters (rounded down) so i guess there's no problem in that direction.
it's rather how tall would DF maps become if the height of each maptile was 4 MCblocks?
where would the mountain peaks be, where the ground of the deepest seas?

would it be possible to add some sort of recognizing which direction a DF doorway is facing? that would make constructing MC doorway tiles easier and prettier.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Thutmose

  • Bay Watcher
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #7 on: September 07, 2015, 06:29:11 pm »

well, you're talking about 1.7.10, arent you?
in 1.8 and above, worlds have cubic chunks of 16x16x16 blocks and can be stacked above eachother as you like. so worlds with 1024 height are actually being produced by some presets within the game.

but as far as i read, it is not a standard feature of DF to export all maptiles on start.
they seem to be created once you actually enter them.
but then again, i'm new to DF and havent looked into the code at all.
but for actual maptiles, 5x5x4 blocks is the minimum size i can imagine being walkable from all 6 (4 plus up/down)directions.
i know MC worlds can be 40.000.000x40.000.000 meters (rounded down) so i guess there's no problem in that direction.
it's rather how tall would DF maps become if the height of each maptile was 4 MCblocks?
where would the mountain peaks be, where the ground of the deepest seas?

would it be possible to add some sort of recognizing which direction a DF doorway is facing? that would make constructing MC doorway tiles easier and prettier.

in both 1.7.10 and 1.8 minecraft stores chunks in an array of 16, 16x16x16 sections, so making more than 256 blocks high takes quite a bit of work, there is a mod which re-writes the saving for 1.8 to allow larger worlds.  The value of 256 is otherwise hard coded into the game.

the height value exported by the legends export ranges from 0 to 255, as it is a colour value.  right now I have it as a 1:1 correspondence, and the peaks of mountains are just at the minecraft build height limit.

the horizontal plane is no issue at all, since as you mentioned, it can have a surface area comparable to a large planet.
Logged

Trapezohedron

  • Bay Watcher
  • No longer exists here.
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #8 on: September 07, 2015, 08:29:16 pm »

So this is still being worked at :)
I just recently discovered the problem behind the conversion in the "Dorven Realms" thread together with ideas on how some maptiles could be converted.
Dorven Realms doesnt convert maptiles(the ones, 1 dwarf can stand in) to MC, it converts whole embarcmap/travelmap-tiles, which each consist of 48x48 of those maptiles and can contain hills, streams, caves, villages etc.
i'd like to contribute to a converter that works with the maptiles.

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1266006-dorven-realms-a-dwarf-fortress-based-minecraft?comment=10
It currently also uses just the embark tiles rather than the map tiles, mainly due to the difficulty in getting the height to work out properly if using map tiles, minecraft only has 256 possible values for height, whereas DF has much more.  the site placing works though as the site locations are given as coordinates based on a 16x16 square of embark tiles, so with my default 8 blocks per embark tile, this results in each site having 128x128 blocks available for it, which is enough for a large town.  Is it possible to export the map tiles? or is the only way to get the site specific maps? I was planning on trying to actually use the site maps, rather than just making up sites.

it seems each site map is 816x816 pixels, quite a bit more than my 128x128, but I can try to work on something for converting that as well.

Interesting program.

What if you reach the edge of a Dwarf Fortress map? Terrain still generated?

there are two options for what happens here, in one mode, it just generates ocean for ever, in the other it can swap over to more minecraft like terrain.  the second option is still a bit buggy, as there are often sharp borders in the terrain, I have not worked on smoothing functions yet for properly merging it.  I did also work on another mod which can wrap the player around when they leave a border, so I might merge that into the mode where it is ocean forever.

So, if merged, ocean forever up until a limit where it generates a minecraft land set instead?
Logged
Thank you for all the fish. It was a good run.

Thutmose

  • Bay Watcher
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #9 on: September 07, 2015, 09:47:53 pm »

So, if merged, ocean forever up until a limit where it generates a minecraft land set instead?

na, if merged, it means if you swim off one edge of ocean, you wrap back around to the other side.  If I make some smoothing functions, then it can be ocean for a while, then minecraft terrain after that.
Logged

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #10 on: September 08, 2015, 01:07:30 am »

i'm unsure if you played around with the "customized" worldtype and the presets in 1.8.x expecially the mountain madness reaches by far higher than 256.
http://minecraft.gamepedia.com/Customized#Presets
it is possible and it's already a game feature.
when i want DF in MC, then i want to walk the sites, the cultures built.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #11 on: September 08, 2015, 01:14:10 am »

There actually is a quite old program that converts DF embarks into minecraft maps, for DF 0.31, which uses 3x3x3 minecraft tiles per DF tile, which works quite well as a scale.

There's also this mod: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1446302-tall-worlds-mod-raising-the-world-height-cap
« Last Edit: September 08, 2015, 01:16:47 am by Japa »
Logged

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #12 on: September 08, 2015, 06:26:09 am »

yes, it was mentioned in the OP and i linked a post i made in the corresponding MC forum.
but that program doesnt convert maptiles, but embarktiles.
if the mod could use the actual maptiles and directly convert those into MC sections (like the ones i made) and if world height is (which i still believe) no problem, then there's only the question how the DF materials should be interpreted in MC.
i suggest adding new sets of blocks for each material:
raw boulder, smooth block, engraved block, stairs, slabs, fence/wall, door, trapdoor, "carpet"
the list can possibly be extended.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

Thutmose

  • Bay Watcher
    • View Profile
Re: dorfgen, DFHack Legends exports to minecraft.
« Reply #13 on: September 08, 2015, 06:49:46 am »

i'm unsure if you played around with the "customized" worldtype and the presets in 1.8.x expecially the mountain madness reaches by far higher than 256.
http://minecraft.gamepedia.com/Customized#Presets
it is possible and it's already a game feature.
when i want DF in MC, then i want to walk the sites, the cultures built.

I have looked at the code used to save worlds, it has a hard cap of 256 blocks high, this is why the tall worlds mod exists.  Those settings just shift sea level around to make it look like the worlds are different heights.

Edit: the loading world code is also hardcoded as such, as chunks contain a hard coded 16 maximum block arrays, each containing 16x16x16 blocks.

There actually is a quite old program that converts DF embarks into minecraft maps, for DF 0.31, which uses 3x3x3 minecraft tiles per DF tile, which works quite well as a scale.

There's also this mod: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1446302-tall-worlds-mod-raising-the-world-height-cap

do you know where I can find that program? or an easy way to export the embark to images for reading into minecraft?  the tall worlds mod isn't compatible with anything atm, and doesn't use Forge, so I will probably write my own implementation for it (I already have block saving and loading working, just nothing renders over 256 blocks up https://github.com/Thutmose/bigworld)
« Last Edit: September 08, 2015, 07:01:31 am by Thutmose »
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
« Last Edit: September 08, 2015, 07:09:25 am by Japa »
Logged
Pages: [1] 2 3