<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://starmadepedia.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SgSkallagrim</id>
	<title>StarMade Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://starmadepedia.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SgSkallagrim"/>
	<link rel="alternate" type="text/html" href="https://starmadepedia.net/wiki/Special:Contributions/SgSkallagrim"/>
	<updated>2026-05-11T23:36:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.3</generator>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5295</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5295"/>
		<updated>2017-02-18T09:15:11Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata file of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // Location of Docking Modules, seems unused since &amp;gt; v0.1616&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, for ships: &amp;quot;1: 'ex' 0&amp;quot; up to v0.19498, an unknown int64  after that&lt;br /&gt;
            13: 'a' { } // Logic (Buttons, Delay blocks)&lt;br /&gt;
            -13: {}  // position and text content of Display Modules / Inner Ship Remote&lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // Hot-Bar Items&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5294</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5294"/>
		<updated>2017-02-18T09:14:10Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata file of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // Location of Docking Modules, seems unused since &amp;gt; v0.1616&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, for ships: &amp;quot;1: 'ex' 0&amp;quot; up to v0.19498, an unknown int64  after that&lt;br /&gt;
            13: 'a'  // Logic (Buttons, Delay blocks)&lt;br /&gt;
            {&lt;br /&gt;
                -13:  // list of positions&lt;br /&gt;
                {&lt;br /&gt;
                    -4: 281543697104912,&lt;br /&gt;
                    -4: 281543697563664&lt;br /&gt;
                }&lt;br /&gt;
                -13:// list of lists with position to timestamp&lt;br /&gt;
                {&lt;br /&gt;
                    -13: { -4: 281479272661011, -4: 1475274596470 }&lt;br /&gt;
                }&lt;br /&gt;
                -13: {}  // Unknown&lt;br /&gt;
            }&lt;br /&gt;
            -13: {}  // position and text content of Display Modules / Inner Ship Remote&lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // Hot-Bar Items&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5293</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5293"/>
		<updated>2017-02-17T21:37:02Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata file of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // Location of Docking Modules, seems unused since &amp;gt; v0.1616&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, for ships: &amp;quot;1: 'ex' 0&amp;quot; up to v0.19498, an unknown int64  after that&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and text content of Display Modules / Inner Ship Remote&lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // Hot-Bar Items&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5292</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5292"/>
		<updated>2017-02-17T20:27:17Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata file of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // Hot-Bar Items&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5291</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5291"/>
		<updated>2017-02-17T11:07:32Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#Header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#Metadata|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#Logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Header|header file]] describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 3.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Metadata|metadata file]] contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Logic|logic file]] describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
[[Blueprint_File_Format_Smd|Data files]] are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data|Block Data]] structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Logic&amp;diff=5290</id>
		<title>Blueprint File Format Logic</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Logic&amp;diff=5290"/>
		<updated>2017-02-17T10:41:08Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=logic.smbpl =&lt;br /&gt;
The logic file contains logic links between modules.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|-&lt;br /&gt;
| Controller Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 'Controller Version' will not exist in old logic files.&amp;lt;br /&amp;gt;&lt;br /&gt;
If this value is read and is positive, then the 'number of controllers' value was read, not the 'Controller Version'.&amp;lt;br /&amp;gt;&lt;br /&gt;
The 'Controller Version' is always negative.&amp;lt;br /&amp;gt;&lt;br /&gt;
If 'Controller Version' does not exist or is between  -1024 &amp;lt;= x &amp;lt; 0 all positions are relative to a core/center at (8, 8, 8).&amp;lt;br /&amp;gt;&lt;br /&gt;
A value lower than -1024 means positions are relative to a core/center at (16, 16, 16).&lt;br /&gt;
&lt;br /&gt;
The following description is only right for files where a 'Controller Version' does not exist or is lower than -1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of controller entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Controller entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int16, int16, int16, ]&lt;br /&gt;
|-&lt;br /&gt;
| Number of group entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Group entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Block Id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Number of position entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Position entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int16, int16, int16, ]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor]. &lt;br /&gt;
&lt;br /&gt;
===smbpl.bt===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Revision: v0.199.435&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5289</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5289"/>
		<updated>2017-02-17T10:37:54Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* smbpl.bt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#Header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#Metadata|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#Logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Header|header file]] describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Metadata|metadata file]] contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Logic|logic file]] describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
[[Blueprint_File_Format_Smd|Data files]] are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data|Block Data]] structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5288</id>
		<title>Blueprint File Format Header</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5288"/>
		<updated>2017-02-17T10:37:00Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* header.smbph */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=header.smbph=&lt;br /&gt;
A file that contains information about entity type/class, followed by its boundary around the [[Blueprint_File_Formats|blueprint]].&lt;br /&gt;
After that, the amount of blocks are listed. Ships also have statistics at the end of the file.&lt;br /&gt;
Docked entities have their own header file and have no influence on the  main entity  header file.&lt;br /&gt;
This file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Version || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity type || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity classification || int32 || 3&lt;br /&gt;
|-&lt;br /&gt;
| Box min || [float, float, float] || 0&lt;br /&gt;
|-&lt;br /&gt;
| Box max || [float, float, float] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity type===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Id&lt;br /&gt;
|-&lt;br /&gt;
| Ship || 0&lt;br /&gt;
|-&lt;br /&gt;
| Shop || 1&lt;br /&gt;
|-&lt;br /&gt;
| Space Station || 2&lt;br /&gt;
|-&lt;br /&gt;
| Asteroid || 3&lt;br /&gt;
|-&lt;br /&gt;
| Managed Asteroid || 4&lt;br /&gt;
|-&lt;br /&gt;
| Planet || 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity classification===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Entity !! Id !! Name&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Ship || 0 || General&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Support&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Cargo&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Attack&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Defence&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Carrier&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Scout&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Scavenger&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Space Station || 9 || General&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Shipyard&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Outpost&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Defense&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Factory&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Trade&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Warp Gate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Shopping&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Asteroid || 18 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Managed Asteroid || 19 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Planet || 20 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Shop || 21 || General&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Block quantities==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Number of entries || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entry[Block id, Quantity] || [int16, int32] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Statistic==&lt;br /&gt;
Statistics were added with version 1 of the 'header.smbph'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Has statistic || Boolean (byte) || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Statistic data===&lt;br /&gt;
Only ships have this section!&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Statistic version&lt;br /&gt;
|-&lt;br /&gt;
| Statistic version || int16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 1 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Defensive || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Power || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mobility || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Danger || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Survivability || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 2 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Support || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mining || double || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor]. &lt;br /&gt;
&lt;br /&gt;
===smbph.bt===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Revision: v0.199.435&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Managed Asteroid = 4,&lt;br /&gt;
    Planet = 5&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; ClassificationType&lt;br /&gt;
{&lt;br /&gt;
    General = 0,&lt;br /&gt;
    Mining = 1,&lt;br /&gt;
    Support = 2,&lt;br /&gt;
    Cargo = 3,&lt;br /&gt;
    Attack = 4,&lt;br /&gt;
    Defense = 5,&lt;br /&gt;
    Carrier = 6,&lt;br /&gt;
    Scout = 7,&lt;br /&gt;
    Scavenger = 8,&lt;br /&gt;
    General = 9,&lt;br /&gt;
    Shipyard = 10,&lt;br /&gt;
    Outpost = 11,&lt;br /&gt;
    Defense = 12,&lt;br /&gt;
    Mining = 13,&lt;br /&gt;
    Factory = 14,&lt;br /&gt;
    Trade = 15,&lt;br /&gt;
    Warp_Gate = 16,&lt;br /&gt;
    Shopping = 17,&lt;br /&gt;
    General = 18,&lt;br /&gt;
    General = 19,&lt;br /&gt;
    General = 20,&lt;br /&gt;
    General = 21,&lt;br /&gt;
    General = 22,&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 version; &lt;br /&gt;
    double offensive0;&lt;br /&gt;
    double defensive;&lt;br /&gt;
    double power;&lt;br /&gt;
    double mobility;&lt;br /&gt;
    double danger;&lt;br /&gt;
    double survivability;&lt;br /&gt;
    double offensive1;&lt;br /&gt;
    double support;&lt;br /&gt;
    double mining;&lt;br /&gt;
} Statistic;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    ClassificationType classificationType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
    byte hasStatistic;&lt;br /&gt;
    Statistic statistic;   // Ships only&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5287</id>
		<title>Blueprint File Format Header</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5287"/>
		<updated>2017-02-17T10:34:25Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* smbph.bt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=header.smbph=&lt;br /&gt;
A file that contains information about entity type/class, followed by its boundary around the blueprint.&lt;br /&gt;
After that, the amount of blocks are listed. Ships also have statistics at the end of the file.&lt;br /&gt;
Docked entities have their own header file and have no influence on the  main entity  header file.&lt;br /&gt;
This file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Version || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity type || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity classification || int32 || 3&lt;br /&gt;
|-&lt;br /&gt;
| Box min || [float, float, float] || 0&lt;br /&gt;
|-&lt;br /&gt;
| Box max || [float, float, float] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity type===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Id&lt;br /&gt;
|-&lt;br /&gt;
| Ship || 0&lt;br /&gt;
|-&lt;br /&gt;
| Shop || 1&lt;br /&gt;
|-&lt;br /&gt;
| Space Station || 2&lt;br /&gt;
|-&lt;br /&gt;
| Asteroid || 3&lt;br /&gt;
|-&lt;br /&gt;
| Managed Asteroid || 4&lt;br /&gt;
|-&lt;br /&gt;
| Planet || 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity classification===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Entity !! Id !! Name&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Ship || 0 || General&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Support&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Cargo&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Attack&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Defence&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Carrier&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Scout&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Scavenger&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Space Station || 9 || General&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Shipyard&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Outpost&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Defense&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Factory&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Trade&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Warp Gate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Shopping&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Asteroid || 18 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Managed Asteroid || 19 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Planet || 20 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Shop || 21 || General&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Block quantities==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Number of entries || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entry[Block id, Quantity] || [int16, int32] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Statistic==&lt;br /&gt;
Statistics were added with version 1 of the 'header.smbph'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Has statistic || Boolean (byte) || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Statistic data===&lt;br /&gt;
Only ships have this section!&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Statistic version&lt;br /&gt;
|-&lt;br /&gt;
| Statistic version || int16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 1 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Defensive || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Power || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mobility || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Danger || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Survivability || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 2 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Support || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mining || double || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor]. &lt;br /&gt;
&lt;br /&gt;
===smbph.bt===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Revision: v0.199.435&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Managed Asteroid = 4,&lt;br /&gt;
    Planet = 5&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; ClassificationType&lt;br /&gt;
{&lt;br /&gt;
    General = 0,&lt;br /&gt;
    Mining = 1,&lt;br /&gt;
    Support = 2,&lt;br /&gt;
    Cargo = 3,&lt;br /&gt;
    Attack = 4,&lt;br /&gt;
    Defense = 5,&lt;br /&gt;
    Carrier = 6,&lt;br /&gt;
    Scout = 7,&lt;br /&gt;
    Scavenger = 8,&lt;br /&gt;
    General = 9,&lt;br /&gt;
    Shipyard = 10,&lt;br /&gt;
    Outpost = 11,&lt;br /&gt;
    Defense = 12,&lt;br /&gt;
    Mining = 13,&lt;br /&gt;
    Factory = 14,&lt;br /&gt;
    Trade = 15,&lt;br /&gt;
    Warp_Gate = 16,&lt;br /&gt;
    Shopping = 17,&lt;br /&gt;
    General = 18,&lt;br /&gt;
    General = 19,&lt;br /&gt;
    General = 20,&lt;br /&gt;
    General = 21,&lt;br /&gt;
    General = 22,&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 version; &lt;br /&gt;
    double offensive0;&lt;br /&gt;
    double defensive;&lt;br /&gt;
    double power;&lt;br /&gt;
    double mobility;&lt;br /&gt;
    double danger;&lt;br /&gt;
    double survivability;&lt;br /&gt;
    double offensive1;&lt;br /&gt;
    double support;&lt;br /&gt;
    double mining;&lt;br /&gt;
} Statistic;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    ClassificationType classificationType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
    byte hasStatistic;&lt;br /&gt;
    Statistic statistic;   // Ships only&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5286</id>
		<title>Blueprint File Format Header</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5286"/>
		<updated>2017-02-17T10:33:22Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=header.smbph=&lt;br /&gt;
A file that contains information about entity type/class, followed by its boundary around the blueprint.&lt;br /&gt;
After that, the amount of blocks are listed. Ships also have statistics at the end of the file.&lt;br /&gt;
Docked entities have their own header file and have no influence on the  main entity  header file.&lt;br /&gt;
This file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Version || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity type || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity classification || int32 || 3&lt;br /&gt;
|-&lt;br /&gt;
| Box min || [float, float, float] || 0&lt;br /&gt;
|-&lt;br /&gt;
| Box max || [float, float, float] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity type===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Id&lt;br /&gt;
|-&lt;br /&gt;
| Ship || 0&lt;br /&gt;
|-&lt;br /&gt;
| Shop || 1&lt;br /&gt;
|-&lt;br /&gt;
| Space Station || 2&lt;br /&gt;
|-&lt;br /&gt;
| Asteroid || 3&lt;br /&gt;
|-&lt;br /&gt;
| Managed Asteroid || 4&lt;br /&gt;
|-&lt;br /&gt;
| Planet || 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity classification===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Entity !! Id !! Name&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Ship || 0 || General&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Support&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Cargo&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Attack&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Defence&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Carrier&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Scout&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Scavenger&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Space Station || 9 || General&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Shipyard&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Outpost&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Defense&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Factory&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Trade&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Warp Gate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Shopping&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Asteroid || 18 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Managed Asteroid || 19 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Planet || 20 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Shop || 21 || General&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Block quantities==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Number of entries || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entry[Block id, Quantity] || [int16, int32] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Statistic==&lt;br /&gt;
Statistics were added with version 1 of the 'header.smbph'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Has statistic || Boolean (byte) || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Statistic data===&lt;br /&gt;
Only ships have this section!&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Statistic version&lt;br /&gt;
|-&lt;br /&gt;
| Statistic version || int16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 1 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Defensive || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Power || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mobility || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Danger || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Survivability || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 2 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Support || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mining || double || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor]. &lt;br /&gt;
&lt;br /&gt;
===smbph.bt===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Revision: v0.199.435&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Managed Asteroid = 4,&lt;br /&gt;
    Planet = 5&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; ClassificationType&lt;br /&gt;
{&lt;br /&gt;
    General = 0,&lt;br /&gt;
    Mining = 1,&lt;br /&gt;
    Support = 2,&lt;br /&gt;
    Cargo = 3,&lt;br /&gt;
    Attack = 4,&lt;br /&gt;
    Defense = 5,&lt;br /&gt;
    Carrier = 6,&lt;br /&gt;
    Scout = 7,&lt;br /&gt;
    Scavenger = 8,&lt;br /&gt;
    General = 9,&lt;br /&gt;
    Shipyard = 10,&lt;br /&gt;
    Outpost = 11,&lt;br /&gt;
    Defense = 12,&lt;br /&gt;
    Mining = 13,&lt;br /&gt;
    Factory = 14,&lt;br /&gt;
    Trade = 15,&lt;br /&gt;
    Warp_Gate = 16,&lt;br /&gt;
    Shopping = 17,&lt;br /&gt;
    General = 18,&lt;br /&gt;
    General = 19,&lt;br /&gt;
    General = 20,&lt;br /&gt;
    General = 21,&lt;br /&gt;
    General = 22,&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 version; &lt;br /&gt;
    double offensive0;&lt;br /&gt;
    double defensive;&lt;br /&gt;
    double power;&lt;br /&gt;
    double mobility;&lt;br /&gt;
    double danger;&lt;br /&gt;
    double survivability;&lt;br /&gt;
    double offensive1;&lt;br /&gt;
    double support;&lt;br /&gt;
    double mining;&lt;br /&gt;
} Statistic;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    ClassificationType classificationType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
    byte hasStatistics;&lt;br /&gt;
    Statistic statistic;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Logic&amp;diff=5285</id>
		<title>Blueprint File Format Logic</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Logic&amp;diff=5285"/>
		<updated>2017-02-17T10:06:44Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: Created page with &amp;quot;=logic.smbpl = The logic file contains logic links between modules.  ==Header of file== {| class=&amp;quot;wikitable&amp;quot; ! Purpose !! Data type  |- | Version || int32 |- | Controller Vers...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=logic.smbpl =&lt;br /&gt;
The logic file contains logic links between modules.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|-&lt;br /&gt;
| Controller Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The 'Controller Version' will not exist in old logic files.&amp;lt;br /&amp;gt;&lt;br /&gt;
If this value is read and is positive, then the 'number of controllers' value was read, not the 'Controller Version'.&amp;lt;br /&amp;gt;&lt;br /&gt;
The 'Controller Version' is always negative.&amp;lt;br /&amp;gt;&lt;br /&gt;
If 'Controller Version' does not exist or is between  -1024 &amp;lt;= x &amp;lt; 0 all positions are relative to a core/center at (8, 8, 8).&amp;lt;br /&amp;gt;&lt;br /&gt;
A value lower than -1024 means positions are relative to a core/center at (16, 16, 16).&lt;br /&gt;
&lt;br /&gt;
The following description is only right for files where a 'Controller Version' does not exist or is lower than -1024.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of controller entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Controller entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int16, int16, int16, ]&lt;br /&gt;
|-&lt;br /&gt;
| Number of group entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Group entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Block Id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Number of position entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Position entry===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int16, int16, int16, ]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5283</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5283"/>
		<updated>2017-02-17T09:35:17Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* File Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#Header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#Metadata|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#Logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Header|header file]] describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Metadata|metadata file]] contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Logic|logic file]] describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
[[Blueprint_File_Format_Smd|Data files]] are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data|Block Data]] structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5282</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5282"/>
		<updated>2017-02-17T09:34:48Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* File Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#Header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#Meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#Logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Header|header file]] describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Metadata|metadata file]] contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Logic|logic file]] describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
[[Blueprint_File_Format_Smd|Data files]] are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data|Block Data]] structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5281</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5281"/>
		<updated>2017-02-17T08:58:55Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Header|header file]] describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Metadata|metadata file]] contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Logic|logic file]] describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
[[Blueprint_File_Format_Smd|Data files]] are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data|Block Data]] structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5280</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5280"/>
		<updated>2017-02-17T08:54:31Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* meta.smbpm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata file of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5279</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5279"/>
		<updated>2017-02-17T08:53:42Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* meta.smbpm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a [[Blueprint File Formats|blueprint]].&amp;lt;br /&amp;gt;&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
And location and rotation of docked entities and stuff that is yet unknown.  &amp;lt;br /&amp;gt;&lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5278</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5278"/>
		<updated>2017-02-17T08:46:54Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&amp;lt;br /&amp;gt;&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5277</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5277"/>
		<updated>2017-02-17T08:45:57Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint File Format Metadata Tag 2|Tag 2]]===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5276</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5276"/>
		<updated>2017-02-17T08:43:24Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Wireless logic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5275</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5275"/>
		<updated>2017-02-17T08:42:40Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Wireless logic====&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Docked entities====&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5274</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5274"/>
		<updated>2017-02-17T08:38:40Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possible structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5273</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5273"/>
		<updated>2017-02-17T08:38:16Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&amp;lt;br /&amp;gt;&lt;br /&gt;
This is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5272</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5272"/>
		<updated>2017-02-17T08:37:34Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: 'Ship',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: 'false',&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: 'Any',&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5271</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5271"/>
		<updated>2017-02-17T08:36:13Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: 'MAIN_ENTITY_SHIP_Label',  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: 'DOCKED_ENTITY_SHIP_Label',&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5270</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5270"/>
		<updated>2017-02-17T08:35:22Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: MAIN_ENTITY_SHIP_Label,  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: DOCKED_ENTITY_SHIP_Label,&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the coordinate system of the docked entity.&lt;br /&gt;
            -2: 663,&lt;br /&gt;
            -1: 14, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5269</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5269"/>
		<updated>2017-02-17T08:33:52Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: MAIN_ENTITY_SHIP_Label,  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Rail Orientation&lt;br /&gt;
            -1: 1,  // Rail Orientation&lt;br /&gt;
            -1: 100,  // Rail Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: DOCKED_ENTITY_SHIP_Label,&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the Docked entity.&lt;br /&gt;
            -2: 662,&lt;br /&gt;
            -1: 10, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5268</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5268"/>
		<updated>2017-02-17T08:32:27Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* meta.smbpm */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&amp;lt;br /&amp;gt;&lt;br /&gt;
A metadata file with of version v0 to v3 is considered to have positions relative to a core at (8, 8, 8). A blueprint might contain Smd files with a core at (16, 16, 16) and still have a metadata of v3 or lower. In that case all positions of the metadata file need to be adjusted for positions to be consistent.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: MAIN_ENTITY_SHIP_Label,  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Orientation&lt;br /&gt;
            -1: 1,  // Orientation&lt;br /&gt;
            -1: 100,  // Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: DOCKED_ENTITY_SHIP_Label,&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the Docked entity.&lt;br /&gt;
            -2: 662,&lt;br /&gt;
            -1: 10, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5267</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5267"/>
		<updated>2017-02-17T08:24:24Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: MAIN_ENTITY_SHIP_Label,  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Orientation&lt;br /&gt;
            -1: 1,  // Orientation&lt;br /&gt;
            -1: 100,  // Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: DOCKED_ENTITY_SHIP_Label,&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the Docked entity.&lt;br /&gt;
            -2: 662,&lt;br /&gt;
            -1: 10, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5266</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5266"/>
		<updated>2017-02-17T08:23:23Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Tag 4 starts with 2 vectors of float values. &lt;br /&gt;
Metadata files with version two or higher will follow that with a list of [[Wireless_Logic_Module]] connections.&lt;br /&gt;
And lastly, every version will have a list of positions and orientations of entities docked to a [[Rail Basic|Rail]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Unknown || [float, float, float]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For Metadata version 2 and higher wireless logic connection are listed here.&lt;br /&gt;
The (x, y, z) positions are encoded into the int64 values. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Entity label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Number of wireless connection entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Wireless logic module entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| Label || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position (from)  || int64&lt;br /&gt;
|-&lt;br /&gt;
| Position (to) || int64&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For every version there will be a list of docked entities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entity entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Docked entity Entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|-&lt;br /&gt;
| Tag structure || [Tag structure[size]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a tag structure example&lt;br /&gt;
&lt;br /&gt;
        -13:  // Main entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5. Some older v5 do not have it&lt;br /&gt;
            -8: MAIN_ENTITY_SHIP_Label,  // Label&lt;br /&gt;
            -10: (16, 17, 16),  // Position of Rail&lt;br /&gt;
            -2: 662,  // Block Id, Rail Basic&lt;br /&gt;
            -1: 10,  // Orientation&lt;br /&gt;
            -1: 1,  // Orientation&lt;br /&gt;
            -1: 100,  // Hitpoints&lt;br /&gt;
        }  &lt;br /&gt;
        -13:  // Docked entity&lt;br /&gt;
        {&lt;br /&gt;
            -1: 0,  // Unknown, meta version 5, sometimes&lt;br /&gt;
            -8: DOCKED_ENTITY_SHIP_Label,&lt;br /&gt;
            -10: (16, 15, 16),  // Position of Rail Docker in the Docked entity.&lt;br /&gt;
            -2: 662,&lt;br /&gt;
            -1: 10, &lt;br /&gt;
            -1: 1,&lt;br /&gt;
            -1: 100,&lt;br /&gt;
        }  &lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -10: (16, 18, 16),  // Position of Rail Docker of docked entity in the main entity coordinate system&lt;br /&gt;
        -16: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]],  // Unknown matrix&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
        -1: 0,  // Unknown&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5264</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5264"/>
		<updated>2017-02-17T01:50:36Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &amp;lt;br /&amp;gt;&lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5263</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5263"/>
		<updated>2017-02-17T01:39:26Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked       probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5262</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5262"/>
		<updated>2017-02-17T01:38:04Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // Wireless logic&lt;br /&gt;
               13: 'TR' { }  // Transporter&lt;br /&gt;
               13: 'A'  { }  // Turret Docker.        probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked to.   probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5261</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5261"/>
		<updated>2017-02-17T01:36:43Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Tag 2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // wireless logic&lt;br /&gt;
               13: 'TR' { }  // transporter&lt;br /&gt;
               13: 'A'  { }  // Turred Docker.            probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked to.   probably outdated since &amp;gt; v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5260</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5260"/>
		<updated>2017-02-17T01:33:44Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // wireless logic&lt;br /&gt;
               13: 'TR' { }  // transporter&lt;br /&gt;
               13: 'A'  { }  // Turred Docker.            probably outdated since v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked to.   probably outdated since v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Entity&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5259</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5259"/>
		<updated>2017-02-17T01:33:18Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 2===&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // wireless logic&lt;br /&gt;
               13: 'TR' { }  // transporter&lt;br /&gt;
               13: 'A'  { }  // Turred Docker.            probably outdated since v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked to.   probably outdated since v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
===Tag 3===&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity===&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 4===&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
===Tag 5===&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
===Tag 6===&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Rail Docker]]&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Tag 7===&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5258</id>
		<title>Blueprint File Format Metadata</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Metadata&amp;diff=5258"/>
		<updated>2017-02-17T01:31:55Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: Created page with &amp;quot;=meta.smbpm= A metafile can contain a huge abundance of information about a blueprint. Storage content, position and volume and shop prizes. Also wireless logic connections, t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=meta.smbpm=&lt;br /&gt;
A metafile can contain a huge abundance of information about a blueprint.&lt;br /&gt;
Storage content, position and volume and shop prizes.&lt;br /&gt;
Also wireless logic connections, transporter,  jump drive/inhibitor, scanner, shipyard, warp gates, race gate positions and targets, information about power, shields, display content, some block amounts, AI configurations.&lt;br /&gt;
Also location and rotation of docked entities and stuff that is yet unknown.  &lt;br /&gt;
The file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Version || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
After the version comes a tag. There are 7 known tags that indicate how the bytes that come after them are read.&lt;br /&gt;
The end of a file is reached if tag id '1' is read, or at the end of the tag id '2' data bytes.&lt;br /&gt;
A version followed by a 1 byte is the shortest possible metadata file.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Tag !! Data &lt;br /&gt;
|-&lt;br /&gt;
| 1 || End of file&lt;br /&gt;
|-&lt;br /&gt;
| 2 || A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
|-&lt;br /&gt;
| 5 || AI configuration, also contained in tag 2&lt;br /&gt;
|-&lt;br /&gt;
| 6 || [[Rail Docker]] position and orientation.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || [[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Tag 2==&lt;br /&gt;
A collection of several Information. Is at the end of a metadata file and replaces tag '1'.&lt;br /&gt;
The tag byte is followed directly by a [[tag structure]].&lt;br /&gt;
A tag structure is defined by various tags that indicate a specific data structure.&lt;br /&gt;
For example '-13'/'13' indicates a list of [[tag payloads]].&lt;br /&gt;
Here is a summary of one possibly structure:&lt;br /&gt;
&lt;br /&gt;
        13: 'container'&lt;br /&gt;
        {&lt;br /&gt;
            -13: {}  // List of storage blocks and their contents&lt;br /&gt;
            3: 'shipMan0' 0,  // unknown&lt;br /&gt;
            -13: {-6: 50000.0, -6: 0.0, }  // Power, Aux Power&lt;br /&gt;
            6: 'sh' 1000.0,  // Shield&lt;br /&gt;
            -13: { }  // shop info for stations, an unknown int64 for ships&lt;br /&gt;
           -13: 'a' {}  // Unknown&lt;br /&gt;
            -13: {}  // position and content of Display Modules &lt;br /&gt;
            -13: {}  //  A short list of block ids and their amount&lt;br /&gt;
            -1: 0,  // Warp gate info, unless it is a ship&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
               13: 'ACD' { }  // wireless logic&lt;br /&gt;
               13: 'TR' { }  // transporter&lt;br /&gt;
               13: 'A'  { }  // Turred Docker.            probably outdated since v0.1867&lt;br /&gt;
               13: 'A'  { }  // Entities docked to.   probably outdated since v0.1867&lt;br /&gt;
               13: 'J'  { }  // Jump Drive&lt;br /&gt;
               13: 'JP'  { }  // Jump Inhibitor&lt;br /&gt;
               13: 'SC'  { }  // Scanner&lt;br /&gt;
               13: 'SYRD' { }  // Shipyard&lt;br /&gt;
            }&lt;br /&gt;
           13: 'AIConfig1' {}  //  AI configuration, same as in tag '5'&lt;br /&gt;
          -13: { }  // unknown&lt;br /&gt;
          -1: 0,  // Race gate info, unless it is a ship&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
          -13: {}  // unknown&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
==Tag 3==&lt;br /&gt;
This tag is followed by a list of information about docked entities.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of docked entities || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity===&lt;br /&gt;
Position and orientation of entities docked to a [[Turret Docking Unit]] or [[Docking Module]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| String length || int16&lt;br /&gt;
|-&lt;br /&gt;
| relative folder path || String[length * char]&lt;br /&gt;
|-&lt;br /&gt;
| Position || int32&lt;br /&gt;
|-&lt;br /&gt;
| Size || [float, float, float]&lt;br /&gt;
|-&lt;br /&gt;
| Style || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Tag 4==&lt;br /&gt;
Position and orientation of entities docked to a [[Rail Basic|Rail]] and wireless connections&lt;br /&gt;
&lt;br /&gt;
==Tag 5==&lt;br /&gt;
AI configuration, also contained in tag 2&lt;br /&gt;
This tag is followed by an integer indicating the byte size of the Tag structure after it.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Tag structure size || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
        13: 'AIConfig1'&lt;br /&gt;
        {&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 1,&lt;br /&gt;
                -8: Ship,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 2,&lt;br /&gt;
                -8: false,&lt;br /&gt;
            }&lt;br /&gt;
            -13:&lt;br /&gt;
            {&lt;br /&gt;
                -1: 0,&lt;br /&gt;
                -8: Any,&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
The tag structure contains three Tag payload lists.&lt;br /&gt;
Each list starts with a byte representing:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Byte !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Target&lt;br /&gt;
|-&lt;br /&gt;
| 1 || AI Type&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Active&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The byte is then followed by a string:  &lt;br /&gt;
AI types: &amp;quot;Ship&amp;quot;, &amp;quot;Turret&amp;quot;, &amp;quot;Fleet&amp;quot;  &lt;br /&gt;
Target: &amp;quot;Any&amp;quot;, &amp;quot;Missiles&amp;quot;, &amp;quot;Selected Target&amp;quot;, &amp;quot;Astronauts&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
==Tag 6==&lt;br /&gt;
[[Rail Docker]] position and orientation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Number of [[Rail Docker]] entries || int32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===[[Rail Docker]]===&lt;br /&gt;
Position and orientation of [[Rail Docker]] blocks.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || [int32, int32, int32]&lt;br /&gt;
|-&lt;br /&gt;
| Block id || int16&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 1 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Orientation 2 || byte&lt;br /&gt;
|-&lt;br /&gt;
| Hit points || byte&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Tag 7==&lt;br /&gt;
[[Storage]]/[[Basic_Factory|Factory]] block positions and their volume&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type &lt;br /&gt;
|-&lt;br /&gt;
| Position || int64&lt;br /&gt;
|-&lt;br /&gt;
| Volume || Double&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The (x, y, z) position is encoded into the int64 value. The bits 0-15 are x, 16-31 is y and 32-47 is z. Bit 48 to 63 are always 0.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5257</id>
		<title>Blueprint File Format Header</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5257"/>
		<updated>2017-02-16T23:13:53Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Statistic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=header.smbph=&lt;br /&gt;
A file that contains information about entity type/class, followed by its boundary around the blueprint.&lt;br /&gt;
After that, the amount of blocks are listed. Ships also have statistics at the end of the file.&lt;br /&gt;
Docked entities have their own header file and have no influence on the  main entity  header file.&lt;br /&gt;
This file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Version || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity type || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity classification || int32 || 3&lt;br /&gt;
|-&lt;br /&gt;
| Box min || [float, float, float] || 0&lt;br /&gt;
|-&lt;br /&gt;
| Box max || [float, float, float] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity type===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Id&lt;br /&gt;
|-&lt;br /&gt;
| Ship || 0&lt;br /&gt;
|-&lt;br /&gt;
| Shop || 1&lt;br /&gt;
|-&lt;br /&gt;
| Space Station || 2&lt;br /&gt;
|-&lt;br /&gt;
| Asteroid || 3&lt;br /&gt;
|-&lt;br /&gt;
| Managed Asteroid || 4&lt;br /&gt;
|-&lt;br /&gt;
| Planet || 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity classification===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Entity !! Id !! Name&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Ship || 0 || General&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Support&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Cargo&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Attack&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Defence&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Carrier&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Scout&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Scavenger&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Space Station || 9 || General&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Shipyard&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Outpost&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Defense&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Factory&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Trade&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Warp Gate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Shopping&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Asteroid || 18 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Managed Asteroid || 19 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Planet || 20 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Shop || 21 || General&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Block quantities==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Number of entries || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entry[Block id, Quantity] || [int16, int32] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Statistic==&lt;br /&gt;
Statistics were added with version 1 of the 'header.smbph'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Has statistic || Boolean (byte) || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Statistic data===&lt;br /&gt;
Only ships have this section!&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Statistic version&lt;br /&gt;
|-&lt;br /&gt;
| Statistic version || int16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 1 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Defensive || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Power || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mobility || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Danger || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Survivability || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 2 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Support || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mining || double || 1&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5256</id>
		<title>Blueprint File Format Header</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Header&amp;diff=5256"/>
		<updated>2017-02-16T23:09:04Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: Created page with &amp;quot;=header.smbph= A file that contains information about entity type/class, followed by its boundary around the blueprint. After that, the amount of blocks are listed. Ships also...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=header.smbph=&lt;br /&gt;
A file that contains information about entity type/class, followed by its boundary around the blueprint.&lt;br /&gt;
After that, the amount of blocks are listed. Ships also have statistics at the end of the file.&lt;br /&gt;
Docked entities have their own header file and have no influence on the  main entity  header file.&lt;br /&gt;
This file is written using Big-endian.&lt;br /&gt;
&lt;br /&gt;
==Header of file==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Version || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity type || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entity classification || int32 || 3&lt;br /&gt;
|-&lt;br /&gt;
| Box min || [float, float, float] || 0&lt;br /&gt;
|-&lt;br /&gt;
| Box max || [float, float, float] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity type===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Id&lt;br /&gt;
|-&lt;br /&gt;
| Ship || 0&lt;br /&gt;
|-&lt;br /&gt;
| Shop || 1&lt;br /&gt;
|-&lt;br /&gt;
| Space Station || 2&lt;br /&gt;
|-&lt;br /&gt;
| Asteroid || 3&lt;br /&gt;
|-&lt;br /&gt;
| Managed Asteroid || 4&lt;br /&gt;
|-&lt;br /&gt;
| Planet || 5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Entity classification===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Entity !! Id !! Name&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Ship || 0 || General&lt;br /&gt;
|-&lt;br /&gt;
| 1 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Support&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Cargo&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Attack&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Defence&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Carrier&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Scout&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Scavenger&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=9 | Space Station || 9 || General&lt;br /&gt;
|-&lt;br /&gt;
| 10 || Shipyard&lt;br /&gt;
|-&lt;br /&gt;
| 11 || Outpost&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Defense&lt;br /&gt;
|-&lt;br /&gt;
| 13 || Mining&lt;br /&gt;
|-&lt;br /&gt;
| 14 || Factory&lt;br /&gt;
|-&lt;br /&gt;
| 15 || Trade&lt;br /&gt;
|-&lt;br /&gt;
| 16 || Warp Gate&lt;br /&gt;
|-&lt;br /&gt;
| 17 || Shopping&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Asteroid || 18 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Managed Asteroid || 19 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Planet || 20 || General&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=1 | Shop || 21 || General&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Block quantities==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Number of entries || int32 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Entry[Block id, Quantity] || [int16, int32] || 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Statistic==&lt;br /&gt;
Statistics were added with version 1 of the 'header.smbph'.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Version&lt;br /&gt;
|-&lt;br /&gt;
| Has statistic || Boolean || 1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Statistic data===&lt;br /&gt;
Only ships have this section!&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Purpose !! Data type !! Statistic version&lt;br /&gt;
|-&lt;br /&gt;
| Statistic version || int16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 1 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Defensive || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Power || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mobility || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Danger || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Survivability || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Offensive 2 || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Support || double || 0&lt;br /&gt;
|-&lt;br /&gt;
| Mining || double || 1&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5255</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5255"/>
		<updated>2017-02-16T22:05:09Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Header|Header]]==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Metadata|Metadata]]==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Logic|Logic]]==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Smd|Data]]==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5254</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5254"/>
		<updated>2017-02-16T22:04:32Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Metadata */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Header|Header]]==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Metadata|Metadata]]==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Logic|Logic]]==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5253</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5253"/>
		<updated>2017-02-16T22:04:05Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Header */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Header|Header]]==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Logic|Logic]]==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5252</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5252"/>
		<updated>2017-02-16T22:03:24Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Logic */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==[[Blueprint_File_Format_Logic|Logic]]==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5234</id>
		<title>Blueprint File Format Block Data</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5234"/>
		<updated>2017-02-10T20:44:09Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the [[Blueprint_File_Formats|blueprint]].&lt;br /&gt;
&lt;br /&gt;
=Segment-data v0=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=3 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For all other blocks except [[Grey Standard Armor Corner|corners]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Segment-data v1=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Segment-data v2=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 6&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Shipyard Module]] and [[Rail Docker|rail]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Segment-data v3=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Orientation=&lt;br /&gt;
The Orientation field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpreted as follows :&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1,v2==&lt;br /&gt;
&lt;br /&gt;
Type 3 to 6 were introduced in segment data version 2.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=3 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || 23 || 22 || 21 || The block facing&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1 || 23 || 22 || || The axis of rotation.&lt;br /&gt;
*00 : +Y&lt;br /&gt;
*01 : -Y&lt;br /&gt;
*10 : -Z&lt;br /&gt;
*11 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2/6 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4/5 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5233</id>
		<title>Blueprint File Format Block Data</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5233"/>
		<updated>2017-02-10T20:28:37Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the [[Blueprint_File_Formats|blueprint]].&lt;br /&gt;
&lt;br /&gt;
=Segment-data v0,v1=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=3 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For all other blocks except [[Grey Standard Armor Corner|corners]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Segment-data v2=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 6&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Shipyard Module]] and [[Rail Docker|rail]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Segment-data v3=&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Orientation=&lt;br /&gt;
The Orientation field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpreted as follows :&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1,v2==&lt;br /&gt;
&lt;br /&gt;
Type 3 to 6 were introduced in segment data version 2.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=3 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || 23 || 22 || 21 || The block facing&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1 || 23 || 22 || || The axis of rotation.&lt;br /&gt;
*00 : +Y&lt;br /&gt;
*01 : -Y&lt;br /&gt;
*10 : -Z&lt;br /&gt;
*11 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2/6 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4/5 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Topic:Tjz9m2ms5zwbeog4&amp;topic_postId=tk1rzz44sahc1qv8&amp;topic_revId=tk1rzz44sahc1qv8&amp;action=single-view</id>
		<title>Topic:Tjz9m2ms5zwbeog4</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Topic:Tjz9m2ms5zwbeog4&amp;topic_postId=tk1rzz44sahc1qv8&amp;topic_revId=tk1rzz44sahc1qv8&amp;action=single-view"/>
		<updated>2017-01-29T20:00:24Z</updated>

		<summary type="html">&lt;span class=&quot;plainlinks&quot;&gt;&lt;a href=&quot;/index.php?title=User:SgSkallagrim&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new mw-userlink&quot; title=&quot;User:SgSkallagrim (page does not exist)&quot;&gt;&lt;bdi&gt;SgSkallagrim&lt;/bdi&gt;&lt;/a&gt; &lt;span class=&quot;mw-usertoollinks&quot;&gt;(&lt;a href=&quot;/index.php?title=User_talk:SgSkallagrim&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new mw-usertoollinks-talk&quot; title=&quot;User talk:SgSkallagrim (page does not exist)&quot;&gt;talk&lt;/a&gt; | &lt;a href=&quot;/wiki/Special:Contributions/SgSkallagrim&quot; class=&quot;mw-usertoollinks-contribs&quot; title=&quot;Special:Contributions/SgSkallagrim&quot;&gt;contribs&lt;/a&gt;)&lt;/span&gt; &lt;a rel=&quot;nofollow&quot; class=&quot;external text&quot; href=&quot;https://starmadepedia.net/index.php?title=Topic:Tjz9m2ms5zwbeog4&amp;amp;topic_showPostId=tk1rzz44sahc1qv8#flow-post-tk1rzz44sahc1qv8&quot;&gt;commented&lt;/a&gt; on &quot;Removing shapes from the list&quot; (&lt;em&gt;For completeness the slabs would also be nice to have. Using four columns sound good. This is a lot of work, I hope a script will be used...&lt;/em&gt;)&lt;/span&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5173</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5173"/>
		<updated>2017-01-29T14:21:42Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Block Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation. &amp;lt;br/&amp;gt;&lt;br /&gt;
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.Others have 0 as Active-bit.&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5172</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5172"/>
		<updated>2017-01-29T14:15:50Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Block Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===[[Blueprint_File_Format_Block_Data|Block Data]]===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
[[Blueprint_File_Format_Block_Data|More info]]&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====[[Blueprint_File_Format_Block_Data#Orientation|Orientation]]====&lt;br /&gt;
The [[Blueprint_File_Format_Block_Data#Orientation|Orientation]] field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpeted as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5171</id>
		<title>Blueprint File Format Block Data</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5171"/>
		<updated>2017-01-29T14:06:24Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the [[Blueprint_File_Formats|blueprint]].&lt;br /&gt;
&lt;br /&gt;
=Smd2=&lt;br /&gt;
&lt;br /&gt;
A Smd2 segment consists of 4096 blocks. Segment data version 0 and 1 can be found in such files.&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=3 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For all other blocks except [[Grey Standard Armor Corner|corners]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Smd3=&lt;br /&gt;
&lt;br /&gt;
A Smd3 segment consists of 32768 blocks. Segment data version 2 and 3 can be found in such files.&lt;br /&gt;
&lt;br /&gt;
==Segment-data v2==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 6&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Shipyard Module]] and [[Rail Docker|rail]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Orientation=&lt;br /&gt;
The Orientation field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpreted as follows :&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1,v2==&lt;br /&gt;
&lt;br /&gt;
Type 3 to 6 were introduced in segment data version 2.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=3 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || 23 || 22 || 21 || The block facing&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1 || 23 || 22 || || The axis of rotation.&lt;br /&gt;
*00 : +Y&lt;br /&gt;
*01 : -Y&lt;br /&gt;
*10 : -Z&lt;br /&gt;
*11 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2/6 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4/5 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5170</id>
		<title>Blueprint File Format Block Data</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Format_Block_Data&amp;diff=5170"/>
		<updated>2017-01-29T14:03:46Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: Created page with &amp;quot;The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.  =Smd2=  A Smd2 segment consists of 4096 blocks. Seg...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
&lt;br /&gt;
=Smd2=&lt;br /&gt;
&lt;br /&gt;
A Smd2 segment consists of 4096 blocks. Segment data version 0 and 1 can be found in such files.&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=3 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For all other blocks except [[Grey Standard Armor Corner|corners]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Smd3=&lt;br /&gt;
&lt;br /&gt;
A Smd3 segment consists of 32768 blocks. Segment data version 2 and 3 can be found in such files.&lt;br /&gt;
&lt;br /&gt;
==Segment-data v2==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 6&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Shipyard Module]] and [[Rail Docker|rail]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Orientation=&lt;br /&gt;
The Orientation field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpreted as follows :&lt;br /&gt;
&lt;br /&gt;
==Segment-data v0,v1,v2==&lt;br /&gt;
&lt;br /&gt;
Type 3 to 6 were introduced in segment data version 2.&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=3 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || 23 || 22 || 21 || The block facing&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1 || 23 || 22 || || The axis of rotation.&lt;br /&gt;
*00 : +Y&lt;br /&gt;
*01 : -Y&lt;br /&gt;
*10 : -Z&lt;br /&gt;
*11 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2/6 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4/5 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Segment-data v3==&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
	<entry>
		<id>https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5169</id>
		<title>Blueprint File Formats</title>
		<link rel="alternate" type="text/html" href="https://starmadepedia.net/index.php?title=Blueprint_File_Formats&amp;diff=5169"/>
		<updated>2017-01-29T13:38:54Z</updated>

		<summary type="html">&lt;p&gt;SgSkallagrim: /* Data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Below are the details of the blueprint data files.  This information is intended for those who are interested in writing external tools to inspect and modify blueprints.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
As '''StarMade''' is under active development, file formats and layouts could change with each version.  As a result, the information on this page may become inaccurate over time.  If you find errors in this information, please provide corrections and note the version and changes in the [[#Changelog|Changelog]] section at the bottom of this page.&lt;br /&gt;
&lt;br /&gt;
==File Layout==&lt;br /&gt;
Blueprints are comprised of several files arranged in the blueprints directories in the StarMade installation directory.  There are three such directories:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Directory !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blueprints || Player-saved blueprints (the local catalog) as well as the initial pirate ship blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-default || Also contains pirate blueprints&lt;br /&gt;
|-&lt;br /&gt;
| blueprints-stations || Station blueprints, organized into directories for each of the NPC factions.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Within each blueprint directory are directories for each ship or station.  Within each of those directories are the following files:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File Name !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header.smbph || The [[#header|header]] file.&lt;br /&gt;
|-&lt;br /&gt;
| meta.smbpm || The [[#meta|metadata]] file.&lt;br /&gt;
|-&lt;br /&gt;
| logic.smbpl || The [[#logic|logic]] file.&lt;br /&gt;
|-&lt;br /&gt;
| DATA/ || A directory containing the *.smd2 block [[#data|chunk data]] files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Header==&lt;br /&gt;
&lt;br /&gt;
The header file describes the following basic bits of information about the blueprint: &lt;br /&gt;
&lt;br /&gt;
; Entity Type : Indicates whether the blueprint is for a Ship, Shop, Space Station, Asteroid or Planet.&lt;br /&gt;
; Entity Class : Indicates the class of an entity. Like General, Mining, Attack or Defense and so on. Part of header since header version 2.&lt;br /&gt;
; Bounding Box : A pair of three-dimensional coordinates providing the minimum and maximum block coordinates for the blueprint.  These are relative to a 0,0,0 base, so the minimum coordinates will be negative and the maximum coordinates will be positive.  The size of the blueprint is determined by subtracting the minimum coordinates from the maximum ones in each dimension.&lt;br /&gt;
; Element Map: An array of structures describing the number and types of each block in the blueprint.&lt;br /&gt;
; Statistical data of an entity: Offensive, Defensive, Power, Mobility, Danger, Survivability and Support. Part of header since header version 1.&lt;br /&gt;
&lt;br /&gt;
With the information from the header, it's possible to calculate the size and composition of the blueprint to, for example, produce a list of materials needed for construction or determine if a ship can fit in a particular space.&lt;br /&gt;
&lt;br /&gt;
==Metadata==&lt;br /&gt;
&lt;br /&gt;
The metadata file contains all the other information about a blueprint except for block positions.  This includes things like docked turrets, contents of storage boxes on the ship, etc.  It is arranged in two sections: docking and Tags.&lt;br /&gt;
&lt;br /&gt;
; Docking : This section contains an array of structures describing the name of the blueprint for the docked entity, its size and position, the docking style and its docked orientation.&lt;br /&gt;
; Tags : This is a hierarchical data format which may contain binary information of several types, optionally named.  See the file format section for additional details.&lt;br /&gt;
&lt;br /&gt;
The Tags section may be compressed, requiring zlib compression functionality to work with.  Each Tag contains the following information:&lt;br /&gt;
; Type : The type of data contained in the payload.&lt;br /&gt;
; Name (optional): If present this is the name of this tag&lt;br /&gt;
; Payload : A variable format data structure which describes one of the following values:&lt;br /&gt;
:* Byte (8-bit value)&lt;br /&gt;
:* Short (16-bit value)&lt;br /&gt;
:* Int (32-bit value)&lt;br /&gt;
:* Long (64-bit value)&lt;br /&gt;
:* Float (32-bit single-precision value)&lt;br /&gt;
:* Double (64-bit double-precision value)&lt;br /&gt;
:* Byte Array&lt;br /&gt;
:* String (UTF-encoded with a length prefix)&lt;br /&gt;
:* Vector3f (a vector of 3 floats)&lt;br /&gt;
:* Vector3i (a vector of 3 integers)&lt;br /&gt;
:* Vector3b (a vector of 3 bytes)&lt;br /&gt;
:* List (A list of Payloads which all contain the same type of data)&lt;br /&gt;
:* Structure (A list of Tags of varying types)&lt;br /&gt;
:* FactoryId (a 8-bit value used for factory registration)&lt;br /&gt;
:* Vector4f (A vector of 4 floats)&lt;br /&gt;
&lt;br /&gt;
==Logic==&lt;br /&gt;
&lt;br /&gt;
The logic file describes all of the [[Linking|linked]] module groups in the ship.  It is structured as an array or arrays of block information.&lt;br /&gt;
&lt;br /&gt;
; Controller Map : An array of Controller Entity structures, one for each linked master.&lt;br /&gt;
; Controller Entity : Contains the position of the controller (master) block and an array of Controller Group structures describing the master and slaved blocks.&lt;br /&gt;
; Controller Group : Contains the type of block and an array of positions of each slaved block of that type&lt;br /&gt;
&lt;br /&gt;
There is a hierarchy of groups, starting with the Controller Entity with controller position 8, 8, 8 (corresponding to the [[Ship Core]]) which will contain a list of Controller Groups containing the master blocks (such as the various computers.)  Within each of these groups will be the positions of those master blocks, and those positions will correspond to the Controller Entity positions of the other Entities in the Controller Map.&lt;br /&gt;
&lt;br /&gt;
==Data==&lt;br /&gt;
&lt;br /&gt;
Data files are contained within the DATA directory for a given blueprint.  These files contain the actual block data - types, positions and orientations, organized into segments and further organized into regions.  Each region will be in its own file named with the following format &amp;lt;blueprintname&amp;gt;.&amp;lt;regionX&amp;gt;.&amp;lt;regionY&amp;gt;.&amp;lt;regionZ&amp;gt;.smd2.  For a blueprint called Alpha, the data file for region 0, 0, 0 would be called Alpha.0.0.0.smd2.&lt;br /&gt;
&lt;br /&gt;
The region file contains the following information:&lt;br /&gt;
; Segment Index : A 16x16x16 array of segment indexes, pointing to Segment Data in the data array&lt;br /&gt;
; Segment Timestamps : A 16x16x16 array of timestamps.&lt;br /&gt;
; Segment Data : An array of up to 16x16x16 (4096) entries containing the data pointed to by the Segment Index.  Each Segment Data contains the segment timestamp, the segment position within the region, the type of segment and a compressed array of Block Data.&lt;br /&gt;
; [[Blueprint_File_Format_Block_Data|Block Data]] : A bit-packed structure describing the block id, orientation, hitpoints and whether the block is active.&lt;br /&gt;
&lt;br /&gt;
===Block Data===&lt;br /&gt;
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.&lt;br /&gt;
&lt;br /&gt;
====smd2====&lt;br /&gt;
This format is used by segment-data version 0 and 1.&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=3 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=9 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=12 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For all other blocks except [[Grey Standard Armor Corner|corners]]&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====smd3====&lt;br /&gt;
This format is used by segment-data version 2.&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 0&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 3&lt;br /&gt;
| colspan=4 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=1 bgcolor=teal align=center |  -&lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 5&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 6&lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| colspan=8 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | For [[Shipyard Module]] and [[Rail Docker|rail]] blocks&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This format is used by segment-data version 3.&lt;br /&gt;
{| class=wikitable&lt;br /&gt;
! ||MSB !! colspan=22 | Bit Offsets !! LSB&lt;br /&gt;
|-&lt;br /&gt;
! Type !! 23 !! 22 !! 21 !! 20 !! 19 !! 18 !! 17 !! 16&lt;br /&gt;
! 15 !! 14 !! 13 !! 12 !! 11 !! 10 !! 9 !! 8 !! 7 !! 6 !! 5 !! 4 !! 3 !! 2 !! 1 !! 0&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | All &lt;br /&gt;
| colspan=5 bgcolor=red align=center | Orientation &lt;br /&gt;
| bgcolor=teal align=center | Active &lt;br /&gt;
| colspan=7 bgcolor=blue align=center | Hit Points&lt;br /&gt;
| colspan=11 bgcolor=green align=center | Block ID&lt;br /&gt;
|-&lt;br /&gt;
| colspan=24 | Blocks than can be active have 1 for 'inaktive' and 0 for 'active'.&amp;lt;br/&amp;gt;Others have 0 as Active-bit.&amp;lt;br/&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Orientation====&lt;br /&gt;
The Orientation field represents how the block is facing in the blueprint.  When all the bits in this field are zero, the block will be in its default orientation.  The bits are interpeted as follows - if the bit is not part of the orientation :&lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=3 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || 23 || 22 || 21 || The block facing&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 1 || 23 || 22 || || The axis of rotation.&lt;br /&gt;
*00 : +Y&lt;br /&gt;
*01 : -Y&lt;br /&gt;
*10 : -Z&lt;br /&gt;
*11 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 2/6 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=2 | Type 4/5 || 19 || 23 || 22 || The axis of rotation.&lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|-&lt;br /&gt;
| 21 || 20 || || The amount of clockwise rotation around the axis of rotation, in 90-degree steps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This format is used by segment-data version 3. &lt;br /&gt;
&lt;br /&gt;
{| class=wikitable padding=2&lt;br /&gt;
! Type !! colspan=5 | Bits !! Description&lt;br /&gt;
|-&lt;br /&gt;
!  !! 23 !! 22 !! 21 !! 20 !! 19 !!&lt;br /&gt;
|-&lt;br /&gt;
| Type 0/3 || colspan=5 | Block facing || &lt;br /&gt;
* 0: Front / Back&lt;br /&gt;
* 1: Back / Front&lt;br /&gt;
* 2: Top / Bottom&lt;br /&gt;
* 3: Bottom / Top&lt;br /&gt;
* 4: Right / Left&lt;br /&gt;
* 5: Left / Right&lt;br /&gt;
|-&lt;br /&gt;
| Type 1 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
|-&lt;br /&gt;
| Type 2/6 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
*010 : -Z&lt;br /&gt;
*011 : +Z&lt;br /&gt;
*100 : -X&lt;br /&gt;
*101 : +X&lt;br /&gt;
|-&lt;br /&gt;
| Type 4/5 || colspan=3 | The axis of rotation. ||  colspan=2 | Rotations in 90-degree steps|| &lt;br /&gt;
*000 : +Y&lt;br /&gt;
*001 : -Y&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Additional Resources==&lt;br /&gt;
In order to assist developers, the following files are provided to help understand and work with blueprint files.&lt;br /&gt;
&lt;br /&gt;
===010 Editor===&lt;br /&gt;
The following *.bt files are format definitions for the [http://www.sweetscape.com/010editor 010 Hex Editor].  Their format is largely similar to C structures and should be easily translatable to your language of choice.&lt;br /&gt;
&lt;br /&gt;
====smbph.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbph.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Header file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3f&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
enum &amp;lt;unsigned int&amp;gt; EntityType&lt;br /&gt;
{&lt;br /&gt;
    Ship = 0,&lt;br /&gt;
    Shop = 1,&lt;br /&gt;
    SpaceStatiion = 2,&lt;br /&gt;
    Asteroid = 3,&lt;br /&gt;
    Planet = 4&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3f min;&lt;br /&gt;
    Vector3f max;&lt;br /&gt;
} BoundingBox;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int blockCount;&lt;br /&gt;
} Element;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int numElements;&lt;br /&gt;
    Element elements[numElements];&lt;br /&gt;
} ElementCountMap;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version; &lt;br /&gt;
    EntityType entityType;&lt;br /&gt;
    BoundingBox boundingBox;&lt;br /&gt;
    ElementCountMap elementCountMap;&lt;br /&gt;
} Header;&lt;br /&gt;
&lt;br /&gt;
Header header;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpl.bt====&lt;br /&gt;
For a logic file with  chunk 16 positions. The core/center is at (8, 8, 8).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a logic file with  chunk 32 positions. The core/center is at (16, 16, 16).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpl.bt&lt;br /&gt;
// Purpose: StarMade Blueprint Logic file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
struct Vector3s&lt;br /&gt;
{&lt;br /&gt;
    short x;&lt;br /&gt;
    short y;&lt;br /&gt;
    short z;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short blockId;&lt;br /&gt;
    int numBlocks;&lt;br /&gt;
    Vector3s blockPositions[numBlocks];&lt;br /&gt;
} ControllerGroup &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    Vector3s controllerPosition;&lt;br /&gt;
    int numGroups;&lt;br /&gt;
    ControllerGroup groups[numGroups];&lt;br /&gt;
} ControllerEntity &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    int controllerVersion;  //  A number smaller than -1024.&lt;br /&gt;
    int numControllers;&lt;br /&gt;
    ControllerEntity entities[numControllers];&lt;br /&gt;
} ControllerMap &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
ControllerMap controllerMap;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smbpm.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smbpm.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: StarMade Blueprint Meta file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
enum &amp;lt;byte&amp;gt; TagType&lt;br /&gt;
{&lt;br /&gt;
    Finish = 1,&lt;br /&gt;
    SegManager = 2,&lt;br /&gt;
    Docking = 3&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
struct TagList;&lt;br /&gt;
struct TagStructure;&lt;br /&gt;
struct Payload;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte x;&lt;br /&gt;
    byte y;&lt;br /&gt;
    byte z;&lt;br /&gt;
} Vector3b;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
} Vector3f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    float x;&lt;br /&gt;
    float y;&lt;br /&gt;
    float z;&lt;br /&gt;
    float w;&lt;br /&gt;
} Vector4f;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    short nameLen;&lt;br /&gt;
    char name[nameLen];&lt;br /&gt;
    Vector3i dockingPos;&lt;br /&gt;
    Vector3f dockingSize;&lt;br /&gt;
    short dockingStyle;&lt;br /&gt;
    byte dockingOrientation;&lt;br /&gt;
} DockedEntry &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int dockedCount;&lt;br /&gt;
    DockedEntry dockedEntry[dockedCount];&lt;br /&gt;
} DockedBlueprints &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned short stringLen;&lt;br /&gt;
    char str[stringLen];&lt;br /&gt;
} String &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int length;&lt;br /&gt;
    byte data[length];&lt;br /&gt;
} ByteArray &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct (byte type)&lt;br /&gt;
{&lt;br /&gt;
    switch(type)&lt;br /&gt;
    {&lt;br /&gt;
        case 0:&lt;br /&gt;
            break;&lt;br /&gt;
        case 1: // Byte&lt;br /&gt;
            byte dataByte;&lt;br /&gt;
            break;&lt;br /&gt;
        case 2: // Short&lt;br /&gt;
            short dataShort;&lt;br /&gt;
            break;&lt;br /&gt;
        case 3: // Int&lt;br /&gt;
            int dataInt;&lt;br /&gt;
            break;&lt;br /&gt;
        case 4: //Long&lt;br /&gt;
            int64 dataLong;&lt;br /&gt;
            break;&lt;br /&gt;
        case 5: // Float&lt;br /&gt;
            float dataFloat;&lt;br /&gt;
            break;&lt;br /&gt;
        case 6: // Double&lt;br /&gt;
            double dataDouble;&lt;br /&gt;
            break;&lt;br /&gt;
        case 7: // Byte array&lt;br /&gt;
            ByteArray byteArray;&lt;br /&gt;
            break;&lt;br /&gt;
        case 8: // String&lt;br /&gt;
            String dataString;&lt;br /&gt;
            break;&lt;br /&gt;
        case 9: // Float vector&lt;br /&gt;
            Vector3f floatVector;&lt;br /&gt;
            break; &lt;br /&gt;
        case 10: // int vector&lt;br /&gt;
            Vector3i intVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 11: // Byte vector&lt;br /&gt;
            Vector3b byteVector;&lt;br /&gt;
            break;&lt;br /&gt;
        case 12: // List&lt;br /&gt;
            TagList list;&lt;br /&gt;
            break;&lt;br /&gt;
        case 13: // Struct&lt;br /&gt;
            TagStructure structure;&lt;br /&gt;
            break;&lt;br /&gt;
        case 14: // Factory registration&lt;br /&gt;
            byte factoryId;&lt;br /&gt;
            break;&lt;br /&gt;
        case 15: // Float4 vector&lt;br /&gt;
            Vector4f float4Vector;&lt;br /&gt;
            break;&lt;br /&gt;
    }&lt;br /&gt;
} Payload &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte type;&lt;br /&gt;
    if(type &amp;gt; 0)&lt;br /&gt;
    {&lt;br /&gt;
        String name;&lt;br /&gt;
    }&lt;br /&gt;
    if(type != 0)&lt;br /&gt;
    {&lt;br /&gt;
        Payload payload(Abs(type));&lt;br /&gt;
    }&lt;br /&gt;
} Tag &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte listType;&lt;br /&gt;
    int listLength;&lt;br /&gt;
    Payload payload(listType)[listLength]; &lt;br /&gt;
} TagList &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        Tag tag;&lt;br /&gt;
    }&lt;br /&gt;
    while(tag.type != 0);    &lt;br /&gt;
} TagStructure&amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{    &lt;br /&gt;
    short version; // Current unused.  If this value is 0x1f8b, then from here &lt;br /&gt;
                   // forward - including these bytes - is a gzip compressed stream &lt;br /&gt;
                   // whose contents follow the same structure as the uncompressed &lt;br /&gt;
                   // version.&lt;br /&gt;
    Tag tag;&lt;br /&gt;
} TagRoot &amp;lt;optimize=false&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    unsigned int version;&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        byte tagType;&lt;br /&gt;
        switch(tagType)&lt;br /&gt;
        {&lt;br /&gt;
            case Finish:&lt;br /&gt;
                break;&lt;br /&gt;
&lt;br /&gt;
            case SegManager:&lt;br /&gt;
                TagRoot segmentManager;&lt;br /&gt;
                return;                &lt;br /&gt;
&lt;br /&gt;
            case Docking:&lt;br /&gt;
                DockedBlueprints dockedBlueprints;&lt;br /&gt;
                break;&lt;br /&gt;
        }&lt;br /&gt;
    } while(tagType != Finish);    &lt;br /&gt;
} Metadata;&lt;br /&gt;
&lt;br /&gt;
Metadata metadata;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd2.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd2.bt&lt;br /&gt;
// Author: Cliff Hudson&lt;br /&gt;
// Revision: 0.1867&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte hitpoints: 8;        &lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    ushort blockId: 12;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int x;&lt;br /&gt;
    int y;&lt;br /&gt;
    int z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int segmentId;&lt;br /&gt;
    int segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
    int64 timestamps[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       No longer the newest format, though this format may apply to blueprints with&lt;br /&gt;
    //       an SMD file version of 0.&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;&lt;br /&gt;
    int dataLength;  &lt;br /&gt;
    unsigned byte segmentType;    &lt;br /&gt;
    byte data[5120-25];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentDataOld;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    byte version;&lt;br /&gt;
    // NOTE: This struct will always come out to 5120 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    //       Valid as of 0.1867, smd file version 1 (RegionHeader.version).&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[5120-26];  // zlib compressed array of BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[4096];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====smd3.bt====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
//--- 010 Editor v6.0 Binary Template&lt;br /&gt;
//&lt;br /&gt;
// File: smd3.bt&lt;br /&gt;
// Revision: 0.199.159&lt;br /&gt;
// Purpose: Starmade Region Data file&lt;br /&gt;
//--------------------------------------&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    BitfieldDisablePadding();&lt;br /&gt;
    BitfieldLeftToRight();&lt;br /&gt;
    byte orientation : 3;&lt;br /&gt;
    byte isActive: 1;&lt;br /&gt;
    byte hitpoints: 9;&lt;br /&gt;
    ushort blockId: 11;   &lt;br /&gt;
} BlockData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 x;&lt;br /&gt;
    int32 y;&lt;br /&gt;
    int32 z;&lt;br /&gt;
} Vector3i;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int16 segmentId;&lt;br /&gt;
    int16 segmentSize;&lt;br /&gt;
} SegmentIndex;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    int32 version;&lt;br /&gt;
    SegmentIndex indices[16*16*16];&lt;br /&gt;
} RegionHeader;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    // NOTE: This struct will always come out to 49152 bytes total, even if the &lt;br /&gt;
    //       data field ends up being shorter (it will simply be padded out.)&lt;br /&gt;
    //       This allows the SegmentIndex to trivially find the data on disk without&lt;br /&gt;
    //       loading the entire file.&lt;br /&gt;
    byte version;&lt;br /&gt;
    int64 timestamp;&lt;br /&gt;
    Vector3i segmentPosition;   &lt;br /&gt;
    unsigned byte dataByte; // If 1, there is valid data here    &lt;br /&gt;
    int compressedSize;&lt;br /&gt;
    byte data[49152-26];  // zlib compressed array of (32x32x32) BlockData&lt;br /&gt;
} SegmentData;&lt;br /&gt;
&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    RegionHeader header;&lt;br /&gt;
    SegmentData data[ ( FileSize() - 16388 ) / 49152 ];&lt;br /&gt;
} Region;&lt;br /&gt;
&lt;br /&gt;
Region region;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
Added SegmentDataOld to smd2 format, reflecting the previous format for block data for this file.  It changed somewhere prior to v0.1867, but this is verified correct on 0.1867.&lt;br /&gt;
Initial creation for version 0.1867. &lt;br /&gt;
&lt;br /&gt;
Added block data format for smd3 used by StarMade v0.199.257.&lt;/div&gt;</summary>
		<author><name>SgSkallagrim</name></author>
		
	</entry>
</feed>