Bay 12 Games Forum

Please login or register.

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

Author Topic: A Scottish cyclops has arrived! Beware its explosive caber toss! (DF --> TF2)  (Read 2915 times)

Flying Carcass

  • Bay Watcher
    • View Profile

Quick synopsis: It is possible to take maps created in Dwarf Fortress and play them in Source engine games through the use of two tools.

If you ever visit the modding section of this forum, you may have noticed a nifty tool called DFHack ( http://www.bay12forums.com/smf/index.php?topic=91166.0 ). One of its features is the ability to convert Dwarf Fortress maps to Minecraft maps. Neat!

Yesterday I was browsing the Minecraft forums and came across this post:
http://www.minecraftforum.net/topic/805589-10-sourcecraft-minecraft-to-source-converter/

Someone had created a tool, called Sourcecraft, to convert Minecraft maps to Source engine maps (used by Valve games like Team Fortress 2, Half Life, Counterstrike, Portal).

So, if Dwarf Fortress maps could be converted to Minecraft maps, and Minecraft maps be converted to Source maps, then it should be possible to take a map from Dwarf Fortress and play on it in Team Fortress 2 (or another valve game) using the two tools. This had to be done, for !!science!!, and I am happy to report such an endeavor is possible!

Here are some screenshots of the same section of the same map in all three games. (Yes, the fort I used for this sucks. I abandoned it for a reason.)

Dwarf Fortress
Spoiler (click to show/hide)

Minecraft
Spoiler (click to show/hide)

Team Fortress 2
Spoiler (click to show/hide)

Some things to note should anyone else try to do this:
1) The whole process is a pain in the neck.
2) (Edited) A single DF square in Minecraft is 3x3x3. Floors going over an empty space in DF will take up the top row of the Minecraft 3x3x3 group below.
3) To move through a passage in TF2, it needs to be at least 2 minecraft blocks wide and at least 2 minecraft blocks tall (if crouching. Otherwise it needs to be at least 3 minecraft blocks tall to stand)
4) One needs to place the player spawner on the map in the source SDK before it can be used for Team Fortress 2.
5) Only a small section of the Minecraft map can be converted to source. The Sourcecraft maker suggests using 5x5 as the chunk parameters.
6) In minecraft x and z are the horizontal planes while y is the vertical plane.
Edit: 7) When Sourcecraft prompts you for the file you want to convert, you can find the file you need by going ".minecraft -> saves -> 'yourworld' -> region" and select r.0.0.mcr (I haven't tried it with the other .mcr files yet, but I'd assume it'd be best to go with r.0.0, as Sourcecraft finds the area you wish to convert based on coordinates relative to 0,0 (x,z)
Edit: 8 ) With version 1.1 of Sourcecraft, when it prompts you for the file you wish to convert, you choose the folder called "region" (as opposed to a .mcr file). You can find it by going ".minecraft -> saves -> 'yourworld'" and select the region folder.
Edit: 9) You can find your coordinates within Minecraft by pressing f3 while in-game.

Thanks to the makers of DFHack and Sourcecraft!  :)
« Last Edit: November 30, 2011, 08:27:41 pm by Flying Carcass »
Logged

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #1 on: November 27, 2011, 06:26:36 pm »

I wonder, is DF2MC compatible with 40d? The documentation in the thread seems to be out of date.

This is awesome, by the way.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

Flying Carcass

  • Bay Watcher
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #2 on: November 27, 2011, 06:28:54 pm »

I wonder, is DF2MC compatible with 40d? The documentation in the thread seems to be out of date.

This is awesome, by the way.

No idea, I used 31.25
Logged

Dsarker

  • Bay Watcher
  • Ἱησους Χριστος Θεου Υἱος Σωτηρ
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #3 on: November 27, 2011, 06:33:30 pm »

Posting to watch.
Logged
Quote from: NewsMuffin
Dsarker is the trolliest Catholic
Quote
[Dsarker is] a good for nothing troll.
You do not convince me. You rationalize your actions and because the result is favorable you become right.
"There are times, Sember, when I could believe your mother had a secret lover. Looking at you makes me wonder if it was one of my goats."

Cruxador

  • Bay Watcher
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #4 on: November 27, 2011, 07:45:27 pm »

Well this is clearly going places. If it is indeed 40d compatible, we need to get some of the historic megafortresses transferred. And then we need to organize a TF2 tournament or something in these maps.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #5 on: November 27, 2011, 08:28:56 pm »

I would love to play in any Dwarf Fortress forts you guys make! Are there any steam groups set up for this?
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

Bdthemag

  • Bay Watcher
  • Die Wacht am Rhein
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #6 on: November 27, 2011, 08:34:17 pm »

TF2 Boatmurdered map.

I think my brain just nearly exploded...
Logged
Well, you do have a busy life, what with keeping tabs on wild, rough-and-tumble forum members while sorting out the drama between your twenty two inner lesbians.
Your drunk posts continue to baffle me.
Welcome to Reality.

Dsarker

  • Bay Watcher
  • Ἱησους Χριστος Θεου Υἱος Σωτηρ
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #7 on: November 27, 2011, 08:34:46 pm »

Pull the lever.
Logged
Quote from: NewsMuffin
Dsarker is the trolliest Catholic
Quote
[Dsarker is] a good for nothing troll.
You do not convince me. You rationalize your actions and because the result is favorable you become right.
"There are times, Sember, when I could believe your mother had a secret lover. Looking at you makes me wonder if it was one of my goats."

ZJVavrek

  • Bay Watcher
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #8 on: November 27, 2011, 09:05:44 pm »

Team Flarechannel!

This looks interesting.  Is it possible to convert through the Minecraft format without actually having Minecraft?
Logged

Flying Carcass

  • Bay Watcher
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #9 on: November 27, 2011, 09:15:13 pm »

Team Flarechannel!

This looks interesting.  Is it possible to convert through the Minecraft format without actually having Minecraft?

I don't think so. When I opened the DF map in Minecraft, Minecraft did some reformatting of the "region" folder DFHack had created.
Logged

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #10 on: November 27, 2011, 09:28:31 pm »

I wonder, is DF2MC compatible with 40d? The documentation in the thread seems to be out of date.

This is awesome, by the way.

No idea, I used 31.25
What OS are you using? I can't get DF2MC to find the DF process in 31.25 or 31.12.
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

Flying Carcass

  • Bay Watcher
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #11 on: November 27, 2011, 09:33:11 pm »

Windows 7

Edit: Oh, in the DFHack post I linked, there's a link to 'df2minecraft'. Don't follow the df2minecraft link, just download DFHack, it already includes the df2minecraft function. Extract the contents of the DFHack zip folder into your dwarf fortress folder (save the new version of SDL.dll over the old one) and run dwarf fortress. If all is well a command prompt window should open up along with DF. Load up the map you want to use, then input "df2minecraft" (without quotes) into the command line an press enter. It will create a minecraft save folder called world 1 in your dwarf fortress folder. Move it to your minecraft save folder and run the map in minecraft to format the region folder. Then you can use sourcecraft.
« Last Edit: November 27, 2011, 09:41:29 pm by Flying Carcass »
Logged

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #12 on: November 27, 2011, 09:58:11 pm »

Although only small chunks of the minecraft versions of DF maps can be converted at one time, anyone even slightly competent at using Source SDK can probably merge several separately-converted parts together. It might end up being very inefficient, performance-wise... I bet that nothing's func_detail'ed.

Having not used Windows (and therefore Steam and therefore Source and therefore the SDK) in a while my knowledge probably isn't up to date, although if this project picks up a lot of interest I could make an attempt at resurrecting Ye Olde Windows Partition (or do SSDK through Wine maybe). I have done a bit of mapping in the past, so I could help out as well.
« Last Edit: November 27, 2011, 09:59:42 pm by DrKillPatient »
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

Buttery_Mess

  • Bay Watcher
  • 11x11
    • View Profile
Re: A scottish cyclops has arrived! Beware its explosive caber toss!
« Reply #13 on: November 28, 2011, 02:20:04 am »

This is insane! I wonder if you can fiddle it to make Quake maps with the old Hammer editor?
Logged
But .... It's so small!
It's not the size of the pick that counts... it's the size of the man with the pick.
Quote from: Toady One
Naturally, we'd like to make life miserable for everybody, randomly, but that'll take some doing.

acetech09

  • Bay Watcher
  • Bay Watcher
    • View Profile

...gimme a sec to catch my breath - nearly had a heart attack...

My favorite three games of all time, in this order, are Dwarf Fortress, Minecraft, and Half-Life 2.

I have a tendency of learning to mod the crap out of every game I play, and am adept in all three of those. I'm imagining that a super-awesome adventurer mode could be made with some heavy conversion modding, as well as a whole bunch of other possibilities.

Although only small chunks of the minecraft versions of DF maps can be converted at one time, anyone even slightly competent at using Source SDK can probably merge several separately-converted parts together. It might end up being very inefficient, performance-wise... I bet that nothing's func_detail'ed.

Inefficient? Yep. Better ways? Yep. Does merging preform many calculations to begin with? Nope... at least not how I'm imagining it. I'll look into it.

This looks interesting.  Is it possible to convert through the Minecraft format without actually having Minecraft?

I don't think so. When I opened the DF map in Minecraft, Minecraft did some reformatting of the "region" folder DFHack had created.

Yeah, the df->mc converter seems to export into the old level save format, and minecraft automatically updates it to the latest one when you open it. But yes - you can do it without buying minecraft. Download it, run it, leave usr/pass blank, play offline, load the world in single player. You can't play multiplayer with a unregistered version but you can convert maps.
Logged
I challenge you to a game of 'Hide the Sausage', to the death.
Pages: [1] 2