Difference between revisions of "Blueprint File Format Block Data"
From StarMade Wiki
SgSkallagrim (talk | contribs) (Created page with "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...") |
SgSkallagrim (talk | contribs) m |
||
Line 1: | Line 1: | ||
− | The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint. | + | The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the [[Blueprint_File_Formats|blueprint]]. |
=Smd2= | =Smd2= |
Revision as of 15:06, 29 January 2017
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.
Contents
Smd2
A Smd2 segment consists of 4096 blocks. Segment data version 0 and 1 can be found in such files.
Segment-data v0,v1
MSB | Bit Offsets | LSB | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
Type 0 | Orientation | Active | Hit Points | Block ID | |||||||||||||||||||||
For blocks with an activation status, like a Standard Factory or Activation Module | |||||||||||||||||||||||||
Type 1 | Orientation | Hit Points | Block ID | ||||||||||||||||||||||
For all other blocks except corners | |||||||||||||||||||||||||
Type 2 | Orientation | Hit Points | Block ID | ||||||||||||||||||||||
For corner blocks |
Smd3
A Smd3 segment consists of 32768 blocks. Segment data version 2 and 3 can be found in such files.
Segment-data v2
MSB | Bit Offsets | LSB | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
Type 0 | Orientation | Active | Hit Points | Block ID | ||||||||||||||||||||
For blocks with an activation status, like a Standard Factory or Activation Module | ||||||||||||||||||||||||
Type 1 | Orientation | - | Hit Points | Block ID | ||||||||||||||||||||
For wedge blocks | ||||||||||||||||||||||||
Type 2 | Orientation | Hit Points | Block ID | |||||||||||||||||||||
For corner blocks | ||||||||||||||||||||||||
Type 3 | Orientation | - | Hit Points | Block ID | ||||||||||||||||||||
For most plants and light rods. Blocks like a Snowbuds or Black Rod Light | ||||||||||||||||||||||||
Type 4 | Orientation | Hit Points | Block ID | |||||||||||||||||||||
For tetra blocks | ||||||||||||||||||||||||
Type 5 | Orientation | Hit Points | Block ID | |||||||||||||||||||||
For hepta blocks | ||||||||||||||||||||||||
Type 6 | Orientation | Hit Points | Block ID | |||||||||||||||||||||
For Shipyard Module and rail blocks |
Segment-data v3
MSB | Bit Offsets | LSB | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
All | Orientation | Active | Hit Points | Block ID | ||||||||||||||||||||
Blocks than can be active have 1 for 'inaktive' and 0 for 'active'. Others have 0 as Active-bit. |
Orientation
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 :
Segment-data v0,v1,v2
Type 3 to 6 were introduced in segment data version 2.
Type | Bits | Description | ||
---|---|---|---|---|
Type 0/3 | 23 | 22 | 21 | The block facing |
Type 1 | 23 | 22 | The axis of rotation.
| |
21 | 20 | The amount of clockwise rotation around the axis of rotation, in 90-degree steps | ||
Type 2/6 | 19 | 23 | 22 | The axis of rotation.
|
21 | 20 | The amount of clockwise rotation around the axis of rotation, in 90-degree steps | ||
Type 4/5 | 19 | 23 | 22 | The axis of rotation.
|
21 | 20 | The amount of clockwise rotation around the axis of rotation, in 90-degree steps |
Segment-data v3
Type | Bits | Description | ||||
---|---|---|---|---|---|---|
23 | 22 | 21 | 20 | 19 | ||
Type 0/3 | Block facing |
| ||||
Type 1 | The axis of rotation. | Rotations in 90-degree steps |
| |||
Type 2/6 | The axis of rotation. | Rotations in 90-degree steps |
| |||
Type 4/5 | The axis of rotation. | Rotations in 90-degree steps |
|