Minetest Schematic File Format

From Minetest Developer Wiki
Revision as of 04:25, 15 August 2017 by Wuzzy (talk | contribs) (→‎Version changes: formatting)
Jump to navigation Jump to search

The Minetest Schematic File Format if the file format used when schematics are seralized by e.g. minetest.create_schematic. Schematic files are supposed to have “.mts” as a file name suffix.

Definition

The definition of version 4 of this file format follows. The original and latest defintion can be found in the Minetest source code at src/mg_schematic.h.

All values are stored in big-endian byte order.
[u32] signature: 'MTSM'
[u16] version: 4
[u16] size X
[u16] size Y
[u16] size Z
For each Y:
	[u8] slice probability value
[Name-ID table] Name ID Mapping Table
	[u16] name-id count
	For each name-id mapping:
		[u16] name length
		[u8[]] name
ZLib deflated {
For each node in schematic:  (for z, y, x)
	[u16] content
For each node in schematic:
	[u8] param1
	  bit 0-6: probability
	  bit 7:   specific node force placement
For each node in schematic:
	[u8] param2
}

Version changes

As of Minetest 0.4.16, the current version of the file format is 4.

  • 1—Initial version
  • 2—Fixed messy never/always place; the probability of 0 is now never, and 0xFF is always
  • 3—Added y-slice probabilities; this allows for variable height structures
  • 4—Compressed range of node occurence probability, added per-node force placement bit