Difference between revisions of "Blueprint File Format Block Data"

From StarMade Wiki
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the [[Blueprint_File_Formats|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=
+
=Segment-data v0=
 
 
A Smd2 segment consists of 4096 blocks. Segment data version 0 and 1 can be found in such files.
 
 
 
==Segment-data v0,v1==
 
 
{| class=wikitable
 
{| class=wikitable
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB
Line 35: Line 31:
 
|}
 
|}
  
=Smd3=
+
=Segment-data v1=
 
+
{| class=wikitable
A Smd3 segment consists of 32768 blocks. Segment data version 2 and 3 can be found in such files.
+
! ||MSB !! colspan=22 | 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
 +
|-
 +
| rowspan=2 | Type 0
 +
| colspan=4 bgcolor=red align=center | Orientation
 +
| bgcolor=teal align=center | Active
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For blocks with an activation status, like a [[Standard Factory]] or [[Activation Module]] <br/><br/>
 +
|-
 +
| rowspan=2 | Type 1
 +
| colspan=4 bgcolor=red align=center | Orientation
 +
| colspan=1 bgcolor=teal align=center |  -
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For [[Grey Standard Armor Wedge|wedge]] blocks<br/><br/>
 +
|-
 +
| rowspan=2 | Type 2
 +
| colspan=5 bgcolor=red align=center | Orientation
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For [[Grey Standard Armor Corner|corner]] blocks<br/><br/>
 +
|-
 +
| rowspan=2 | Type 3
 +
| colspan=4 bgcolor=red align=center | Orientation
 +
| colspan=1 bgcolor=teal align=center |  -
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For most plants and light rods. Blocks like a [[Snowbuds]] or [[Black Rod Light]] <br/><br/>
 +
|-
 +
| rowspan=2 | Type 4
 +
| colspan=5 bgcolor=red align=center | Orientation
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For [[Grey Standard Armor Tetra|tetra]] blocks<br/><br/>
 +
|-
 +
| rowspan=2 | Type 5
 +
| colspan=5 bgcolor=red align=center | Orientation
 +
| colspan=8 bgcolor=blue align=center | Hit Points
 +
| colspan=11 bgcolor=green align=center | Block ID
 +
|-
 +
| colspan=24 | For [[Grey Standard Armor Hepta|hepta]] blocks<br/><br/>
 +
|}
  
==Segment-data v2==
+
=Segment-data v2=
 
{| class=wikitable
 
{| class=wikitable
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB
Line 99: Line 144:
 
|}
 
|}
  
==Segment-data v3==
+
=Segment-data v3=
 
{| class=wikitable
 
{| class=wikitable
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB
 
! ||MSB !! colspan=22 | Bit Offsets !! LSB

Latest revision as of 21:44, 10 February 2017

The Block Data structure consists of three bytes which contain a bit-packed representation of each block in the blueprint.

Segment-data v0

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

Segment-data 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 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

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.
  • 00 : +Y
  • 01 : -Y
  • 10 : -Z
  • 11 : +Z
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.
  • 000 : +Y
  • 001 : -Y
  • 010 : -Z
  • 011 : +Z
  • 100 : -X
  • 101 : +X
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.
  • 000 : +Y
  • 001 : -Y
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
  • 0: Front / Back
  • 1: Back / Front
  • 2: Top / Bottom
  • 3: Bottom / Top
  • 4: Right / Left
  • 5: Left / Right
Type 1 The axis of rotation. Rotations in 90-degree steps
  • 000 : +Y
  • 001 : -Y
  • 010 : -Z
  • 011 : +Z
Type 2/6 The axis of rotation. Rotations in 90-degree steps
  • 000 : +Y
  • 001 : -Y
  • 010 : -Z
  • 011 : +Z
  • 100 : -X
  • 101 : +X
Type 4/5 The axis of rotation. Rotations in 90-degree steps
  • 000 : +Y
  • 001 : -Y