I have an idea to write a program to import maps from dwarf fortress into Minecraft. It shouldn't be too hard. I just want to check to see if anybody has made one of these yet just in case I don't have to do all of this work.
*Update*
I decided to learn C++ this morning, and now I can use a library to export from Dwarf Fortress. I will start programming today.
Rollback Post to RevisionRollBack
I like making tools for Minecraft. Here are a few of the ones that I have made so far:
MazeGen (Version 1.0) --- An automatic maze generation tool ModelGen (Version 1.0) --- A 3D model import tool
Do you know how to export information from DF and translate it into whatever blocks you want?
Not to mention the technical problems of it's rather odd physics, like one-tile stairs that you would likely need to have a custom server for in order to make watervators. And you would need to stretch every level into three blocks, two open space and one for the floor. And you could not use furniture, as representing a bed in one tile would be odd.
But yeah, I suggest looking at the Bay 12 Games forums for the programs they have for editing information in DF. Particularly the graphical displays.
Well, here are some of my plans: The most important thing is to realize that each DF tile is going to have to be bigger than an MC tile. I am deciding between 2x2x2 and 3x3x3. Probably the latter. With either of these I will be able to have things like stairs. I would probably use a spiral staircase so orientation wouldn't be a problem. There would probably be a 1-tile floor in between them. Water and lava would possibly have some problems, seeing as in Minecraft it is unlimited, so flooding would really suck. From what I've seen exporting from Dwarf Fortress files isn't terribly hard, that part of it I could get help with on their forums if needed. Now that I think about it, with 3x3x3 I could do some furniture. That would probably work well, in fact. I would probably use a combination of colored blocks and rock blocks for the stone. Hmm... This is beginning to sound more and more like a good idea. I think I'll get started on it.
Rollback Post to RevisionRollBack
I like making tools for Minecraft. Here are a few of the ones that I have made so far:
MazeGen (Version 1.0) --- An automatic maze generation tool ModelGen (Version 1.0) --- A 3D model import tool
Hey guys. I would love to do this as well, so I got half of it done today. I wrote the import script in Python, right now it is only the export-to-MineCraft half. I'm thinking it would be best to wait until the next version of DF comes out before writing the DF importer. Much thanks to Graham Edgecombe for writing Omen, a program I used extensively in debugging this script.
You need both the python script and a template in the same folder. You also have to have python installed (I used 2.6). Create a new map called "DFTemplate.mclevel" with x,y,z dims of 144,72,144. Run the script and there will be a new file called "testing.mclevel". Right now it just demonstrates the basics; stairs, passageways, and solid stone. If someone knows how to get a easy-to-parse DF format, I (or any other programmer) can finish up the rest. Otherwise I'm going to wait until DF V.41 comes out with the new save format and try my hand at cracking it.
Comments and suggestions are welcome. I hope this helps the development effort. I would love to see a DF to MC script in working order!
'''Python script by dudecon
This takes a template MineCraft level and populates
the block data with example Dwarf Fortress information
'''
import gzip
dflength = 48
dfwidth = 48
dfheight = 24
totaldfblocks = dflength * dfwidth * dfheight
def coord_to_idx(coord,size):
x = coord[0]
y = coord[1]
z = coord[2]
idx = x + (y * size[2] + z) * size[0]
return idx
class DfBlockSolid(object):
'''encapsulate material and shape information, and yeild it on request
Material is the base material index. DfBlock objects use MineCraft
material indexes.
Width, length, and height specify how many MineCraft blocks per
DF block. width = x, length = z, height = y
'''
width = 3
length = 3
height = 3
def get_material(self,x,y,z):
'''return the material index
The coordinates x,y,z are local and reference MineCraft orientation.
Override this method for non-uniform blocks.
'''
return self.material
def __init__(self):
self.material = 0
class DfBlockFloor(DfBlockSolid):
def get_material(self,x,y,z):
if y == 0: return self.material
else: return 0
class DfBlockStairUpDown(DfBlockSolid):
matmap = [[[-1,-1,0],[0,0,0],[0,0,0]],
[[-1,-1,0],[-1,0,0],[0,0,0]],
[[-1,-1,0],[-1,0,0],[-1,50,0]]
]
def get_material(self,x,y,z):
'''return material value for locations where stair exists, otherwise, return index for air
Allows sub-classing for only up and only down staircases
'''
newx = x
newy = y
newz = z
if self.flip == True:
newx = self.width-x-1
newz = self.length-z-1
idx = self.matmap[newx][newy][newz]
if idx == -1:
matindex = self.material
else:
matindex = idx
return matindex
def __init__(self):
DfBlockSolid.__init__(self)
self.material = 4
self.flip = False
class DfBlockStairUp(DfBlockStairUpDown):
def get_material(self,x,y,z):
if y > 0:
return DfBlockStairUpDown.get_material(self,x,y,z)
else:
return self.material
class DfBlockStairDown(DfBlockStairUpDown):
def get_material(self,x,y,z):
if y == 0:
return DfBlockStairUpDown.get_material(self,x,y,z)
else:
return 0
airblock = DfBlockSolid()
rockblock = DfBlockSolid()
rockblock.material = 4
stairblock = DfBlockStairUpDown()
stairblockodd = DfBlockStairUpDown()
stairblockodd.flip = True
floorblock = DfBlockFloor()
floorblock.material = 2
'''use the same order of blocks as MineCraft'''
dfblocklist = []
for z in range(dflength):
row = []
for y in range(dfheight):
column = []
for x in range(dfwidth):
if y < 15:
column += [rockblock]
elif y == 15:
column += [floorblock]
else:
column += [airblock]
row += [column]
dfblocklist += [row]
size = [dfwidth,dfheight,dflength]
start = [7,13,1]
for i in range(18):
x = start[0]
y = start[1]
z = start[2]+i
dfblocklist[x][y][z] = floorblock
y = start[1] + 7
dfblocklist[x][y][z] = floorblock
start = [2,11,9]
for i in range(12):
x = start[0]+ i
y = start[1]
z = start[2]
dfblocklist[x][y][z] = floorblock
start = [7,4,9]
for i in range(17):
if i%2 == 1:
stairs = stairblockodd
else:
stairs = stairblock
x = start[0]
y = start[1]+i
z = start[2]
dfblocklist[x][y][z] = stairs
def convertmap():
mcwidth = 3 * dfwidth
mclength = 3 * dflength
mcheight = 3 * dfheight
totalmcblocks = mcwidth * mclength * mcheight
def getblocktype(mapdata):
idx = mapdata.find('Blocks') - 1
offset = 2 + 3 + ord(mapdata[idx])
start = idx + offset
end = start + totalmcblocks
source = mapdata[start]
return source
def setblocktype(mapdata,blockdata):
idx = mapdata.find('Blocks') - 1
offset = 2 + 3 + ord(mapdata[idx])
start = idx + offset
end = start + totalmcblocks
mapout = mapdata[:start] + blockdata + mapdata[end]
return mapout
def setblockdata(mapdata,blockdata):
idx = mapdata.find('Data') - 1
offset = 2 + 3 + ord(mapdata[idx])
start = idx + offset
end = start + totalmcblocks
mapout = mapdata[:start] + blockdata + mapdata[end]
return mapout
filein = gzip.open("DFTemplate.mclevel",'rb')
mapdata = filein.read()
filein.close()
minecraftblocks = ''
mcsize = [mcwidth,mclength,mcheight]
for y in range(mcheight):
for z in range(mclength):
for x in range(mcwidth):
thisblock = dfblocklist[x/3][y/3][z/3]
mat = thisblock.get_material(x%3,y%3,z%3)
if False:# x < 3 and y < 3:
print(x/3,y/3,z/3,x%3,y%3,z%3)
print(mat)
minecraftblocks += chr(mat)
minecraftdata = chr(15)*totalmcblocks
output = setblocktype(mapdata,minecraftblocks)
output = setblockdata(output,minecraftdata)
fileout = gzip.open("testing.mclevel",'wb')
fileout.write(output)
fileout.close()
convertmap()
I have a suggestion... npc's such as builders and miners and lumberjacks and things like dwarf fortress... once you get your fortress dwarfs come and you can assign there jobs/rolls in it and you could give them items or tell them to go get it themselves... since im not the best at dwarf fortress and dont really know all that much about it... since i dont really know how to play it that well...
Please continue developing this mod! You know I am a supporter of you guys!
Dwarf Fortress is my favorite game and I would love to seeit on Minecraft!
Thank you!
he probably is better off with letting someone with more experience with making a mod like collasi or meand if you know anything about dwarf fortress it is a hard to survive game unless your pro and can get a working fortress in sinister weather and if he does make this mod it will not go far so i would say let me do it because i can do almost anything with mods.
*Update*
I decided to learn C++ this morning, and now I can use a library to export from Dwarf Fortress. I will start programming today.
MazeGen (Version 1.0) --- An automatic maze generation tool
ModelGen (Version 1.0) --- A 3D model import tool
Not to mention the technical problems of it's rather odd physics, like one-tile stairs that you would likely need to have a custom server for in order to make watervators. And you would need to stretch every level into three blocks, two open space and one for the floor. And you could not use furniture, as representing a bed in one tile would be odd.
But yeah, I suggest looking at the Bay 12 Games forums for the programs they have for editing information in DF. Particularly the graphical displays.
MazeGen (Version 1.0) --- An automatic maze generation tool
ModelGen (Version 1.0) --- A 3D model import tool
You need both the python script and a template in the same folder. You also have to have python installed (I used 2.6). Create a new map called "DFTemplate.mclevel" with x,y,z dims of 144,72,144. Run the script and there will be a new file called "testing.mclevel". Right now it just demonstrates the basics; stairs, passageways, and solid stone. If someone knows how to get a easy-to-parse DF format, I (or any other programmer) can finish up the rest. Otherwise I'm going to wait until DF V.41 comes out with the new save format and try my hand at cracking it.
Comments and suggestions are welcome. I hope this helps the development effort. I would love to see a DF to MC script in working order!
Might want to try some of the other map visualizers listed on the wiki, like stonesense.
Dwarf Fortress is my favorite game and I would love to seeit on Minecraft!
Thank you!
he probably is better off with letting someone with more experience with making a mod like collasi or meand if you know anything about dwarf fortress it is a hard to survive game unless your pro and can get a working fortress in sinister weather and if he does make this mod it will not go far so i would say let me do it because i can do almost anything with mods.