Hi,
I'd like to thank everyone for their help last week. I have DFHack working in VSE 2010, and have the basics of my DF to Minecraft program working. It isn't nearly working yet, but it is a start.
I've converted this map:
http://mkv25.net/dfma/map-9322-roadraced ( A completely above ground wooden castle )
to this Minecraft level:
http://troz.shackspace.com/minecraft/df2mc/cutdown.mclevelplayable here after loading from file (assuming you have a purchased account):
http://minecraft.net/indev/ images:
issues:
The full level is too large to play - .mclevel files are gzipped, and the unzipped version is about 500MB in size, while the indev applet is configured for only 256MB of ram, so I made the cut down versions which only contain the highest 40 layers in Dwarf Fortress (of 171 total layers) and also took only the center part of the map. The widecut version is the full width and length (720 cubes in each direction) but only 40 DF layers (120 cubes) in height.
It start out completely dark (no light info), but the game calculates the light over the first few minutes while you play.
Materials aren't correct yet. - The castle is supposed to be made of wood. Right now all I'm getting is that it is 'constructed', and I'm using cobblestone for 'constructed' right now (as most of the time items in DF are made of rock/stone, and using rock in Minecraft means cobblestone).
No items / workshops / buildings are converted. I'm just looking at terrain data right now. Next version should have buildings, hopefully.
No torches. No torches are placed, so the interiors are all dark. I'm going to attempt to get it placing torches in a percentage of floor tiles that are marked as dark, which should do the trick (except I'd like to no light natural caves, so I'll have to detect them somehow (no torches if there is mud on the tile?))
Trees look messed up. I'm only getting the tree bottoms. I expected to get a 'tree top' tile from Dwarf Fortress, but I'm not, so only the bottom of the tree gets created, and so it looks funny. I'll either have to figure out how to get tree top tiles, or 'fake it' but just assuming there is a tree top above every tree bottom (which make get tricky as I'm converting the level from bottom to top, so when I find a tree bottom, I haven't seen what is above it yet (although I don't think trees can grow if there isn't enough room for the tree top, so it may not be an issue)).
Ramps are OK if they have a wall to the N,S,E, or W, but if the wall they are against is only diagonally, it is rendered as an unsupported ramp (slopes down in all directions) and so doesn't really look right at the corners of sloping layers. I can fix it, but it means going from 16 slope tiles, to a few hundred possibilities technically, but I 'll probably only implement the 4 diagonal possibilities, which should fix 99% of the cases that don't look good right now.
Also, I'm using a single log for a dead shrub, so if you see a log alone, that is supposed to be a dead shrub.
Some questions:
I have some walls showing up as having a TileMaterial of 'constructed'. Does the 'tempvein' look up as done by Probe for those tiles show the material of the 'floor' that was there before the wall was constructed? If so, then I'm assuming that I can get the constructed wall material for the wall by looking in the Constructions object, is that correct? (I haven't looked at the Constructions object yet, but that is the thing I plan to do next.
Are tree tops not an actual DF tile type, and are just 'created' by the interface if a tree is below a air space?
I know I can get the date from the World object, but is it possible to get the location or group name? Civilization name?
Is it possible to get the water depth on a tile? ( just noticed designations[x%16][y%16].bits.flow_size - so yes)
Is it possible to tell if a location is part of a natural cave, and compared to a dwarf dug hallway? I would like to put Minecraft Torches in dwarf dug areas, but natural cave should be unlit. If there isn't an easy way to tell, I guess I can check for mud (all caves have mud floors, correct?) using code from cleanmap. What doe sthe magic number 0xC in cleanmap do, and what would be the value for mud?
Is it possible to find out what items are where? I see that item are available from Items.h, but that doesn't seem to have location, and I don't see where the definitions for item class are. I'm mostly interested in finding barrels and bins and replacing them with Minecraft chests and possibly pile designations (that would probably be someplace else).
I'm going to try to get torches, construction material, and buildings in before I release the code, hopefully by the end next weekend. I'll probably have to do some optimization as well, as it currently take about 15 minutes to convert a 5x5 embarked area, and I'm going to be doing more lookups for buildings, water and such.
Thanks again for all your help!