]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - doc/mapformat.txt
Add util/buildbot
[dragonfireclient.git] / doc / mapformat.txt
index fd892c9db9c4d2c061ed17ee45bcdc048be52e93..a7380b35e1f7d2701e7d1fac5c3f864a84539db4 100644 (file)
@@ -1,11 +1,11 @@
-===============================================
-Minetest World Format used as of 0.4.dev-120322
-===============================================
+=================================================
+Minetest World Format used as of 0.4.dev-20120322
+=================================================
 
 This applies to a world format carrying the block serialization version 22
-which is used at least in version 0.4.dev-120322.
+which is used at least in version 0.4.dev-20120322.
 
-The map data serialization version used is 22. It does not fully specify every
+The block serialization version used is 22. It does not fully specify every
 aspect of this format; if compliance with this format is to be checked, it
 needs to be done by detecting if the files and data indeed follows it.
 
@@ -271,6 +271,7 @@ zlib-compressed node data:
   u8[4096]: param0 fields
   u8[4096]: param1 fields
   u8[4096]: param2 fields
+- The location of a node in each of those arrays is (z*16*16 + y*16 + x).
 
 zlib-compressed node metadata list
 - content:
@@ -316,6 +317,22 @@ foreach num_name_id_mappings
 
 EOF.
 
+Format of nodes
+----------------
+A node is composed of the u8 fields param0, param1 and param2.
+
+The content id of a node is determined as so:
+- If param0 < 0x80,
+    content_id = param0
+- Otherwise
+    content_id = (param0<<4) + (param2>>4)
+
+The purpose of param1 and param2 depend on the definition of the node.
+
+The name-id-mapping
+--------------------
+The mapping maps node content ids to node names.
+
 Node metadata format
 ---------------------
 
@@ -354,6 +371,50 @@ Node metadata format
   u8[len] owner
   serialized inventory
 
+Static objects
+---------------
+Static objects are persistent freely moving objects in the world.
+
+Object types:
+1: Test object
+2: Item
+3: Rat (deprecated)
+4: Oerkki (deprecated)
+5: Firefly (deprecated)
+6: MobV2 (deprecated)
+7: LuaEntity
+
+1: Item:
+  u8 version
+  version 0:
+    u16 len
+    u8[len] itemstring
+
+7: LuaEntity:
+  u8 version
+  version 1:
+    u16 len
+    u8[len] entity name
+    u32 len
+    u8[len] static data
+    s16 hp
+    s32 velocity.x * 10000
+    s32 velocity.y * 10000
+    s32 velocity.z * 10000
+    s32 yaw * 1000
+
+Itemstring format
+------------------
+eg. 'default:dirt 5'
+eg. 'default:pick_wood 21323'
+eg. '"default:apple" 2'
+eg. 'default:apple'
+- The wear value in tools is 0...65535
+- There are also a number of older formats that you might stumble upon:
+eg. 'node "default:dirt" 5'
+eg. 'NodeItem default:dirt 5'
+eg. 'ToolItem WPick 21323'
+
 Inventory serialization format
 -------------------------------
 - The inventory serialization format is line-based