Scheduled system upgrade on Sunday 21 April 2024 15:00-16:00 UTC - On that day, the wiki and other services might go down for 5-15 minutes.

TSCB: Difference between revisions

Jump to navigation Jump to search
99 bytes removed ,  3 years ago
m
no edit summary
imported>Zephenryus
mNo edit summary
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
</onlyinclude>
</onlyinclude>


== TSCB File Specification ==
==TSCB File Specification==


=== Header ===
===Header===
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)
Line 73: Line 73:
|}
|}


== Material Information Array ==
==Material Information Array==
The material information array references texture data contained in <code>content/Model/Terrain.Tex1.sbfres</code>.
The material information array references texture data contained in <code>content/Model/Terrain.Tex1.sbfres</code>.


=== Header ===
===Header===
The material information header is one value, the section size. This includes the index table and the value table.
The material information header is one value, the section size. This includes the index table and the value table.
{| class="wikitable"
{| class="wikitable"
Line 90: Line 90:
|}
|}


=== Material Information Array Lookup Table ===
===Material Information Array Lookup Table===
Following the header is a table of relative offsets to each entry in <code>material_info_array</code>
Following the header is a table of relative offsets to each entry in <code>material_info_array</code>
{| class="wikitable"
{| class="wikitable"
Line 101: Line 101:
|4
|4
|Unsigned Int
|Unsigned Int
|Relative offset to array entry
|Offset to array entry, relative to the first byte of this offset
|}
|}


=== Material Information Value Table ===
===Material Information Value Table===
Each entry in the array contains an index and four attributes
Each entry in the array contains an index and four attributes
{| class="wikitable"
{| class="wikitable"
Line 138: Line 138:
|}
|}


== Area Array ==
==Area Array==


=== Area Array Lookup Table ===
===Area Array Lookup Table===
Following the material information section is a table of relative offsets to each entry in area_array
Following the material information section is a table of relative offsets to each entry in area_array
{| class="wikitable"
{| class="wikitable"
Line 151: Line 151:
|4
|4
|Unsigned Int
|Unsigned Int
|Relative offset to array entry
|Offset to array entry, relative to the first byte of this offset
|}
|}


=== Area Array Value Table ===
===Area Array Value Table===
Each entry contains meta data for one tile in the terrain scene. There are multiple levels of detail (lod) for the terrain.
Each entry contains meta data for one tile in the terrain scene. There are multiple levels of detail (lod) for the terrain.


Entries range from <code>0x30</code> to <code>0x54</code> depending on the size of <code>extra_info_array</code>
Entry size ranges from <code>0x30</code> to <code>0x58</code> depending on the size of <code>extra_info_array</code>
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)
Line 225: Line 225:
|}
|}


==== Parameters ====
====Parameters====
<code>x</code> - Area tile x coordinate (East-West)
<code>x</code> - Area tile x coordinate (East-West)


Line 231: Line 231:
<code>area_size</code> - Determines the length and width of the area. It can be calculated with:<blockquote><code>(area_size / tile_size * world_scale) * 20</code></blockquote><code>tile_size</code> and <code>world_scale</code> are in the header.
<code>area_size</code> - Determines the length and width of the area. It can be calculated with:<blockquote><code>(area_size / tile_size * world_scale) * 20</code></blockquote><code>tile_size</code> and <code>world_scale</code> are in the header.


=== Extra Information Array ===
===Extra Information Array===
if <code>ref_extra</code> does not equal <code>0</code> there is an <code>extra_info_array</code> attached to this area. The array is 4 or 8 values long.
if <code>ref_extra</code> does not equal <code>0</code> there is an <code>extra_info_array</code> attached to this area. The array is 4 or 8 values long.


Every area includes a [[HGHT|.hght]] and [[MATE|.mate]] file. The <code>extra_info_array</code> indicates if there is an additional [[Water.extm|.water.extm]] and / or [[Grass.extm|.grass.extm]] file
Every area includes a [[HGHT|.hght]] and [[MATE|.mate]] file. The <code>extra_info_array</code> indicates if there is an additional [[Water.extm|.water.extm]] and / or [[Grass.extm|.grass.extm]] file
====Header====
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)
Line 241: Line 243:
!Description
!Description
|-
|-
|<code>0x30</code>
|<code>0x00</code>
|4
|4
|Unsigned Int
|Unsigned Int
|extra_info_array length. Number of elements in array.
|extra_info_array length. Number of values (not elements) in array.
|-
|-
|<code>0x34</code>
|<code>(0x04)</code>
|4
|4
|Unsigned Int
|Unsigned Int
|Unknown. Usually 20 or 3.
|Unknown. Always 20, but only present when extra_info_array length is 8.
|}
 
====Extra Information Array Value Table====
After the Header, there is <code>extra_info_array length</code> / 4 elements of this structure.
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|<code>0x38</code>
|0x00
|4
|4
|Unsigned Int
|Unsigned Int
|Unknown. Usually 0, 1 or 3.
|Unknown. Always 3.
|-
|-
|<code>0x3c</code>
|0x04
|4
|4
|Unsigned Int
|Unsigned Int
|Unknown. Usually 0 or 1.
|Unknown. 0 or 1.
|-
|-
|<code>0x40</code>
|0x08
|4
|4
|Unsigned Int
|Unsigned Int
|Unknown. Usually 0 or 1.
|Unknown. Always 1.
|-
|-
|<code>0x44</code>
|0x0c
|4
|4
|Unsigned Int
|Unsigned Int
|Unknown. Always 0.
|Unknown. Always 0.
|-
|<code>0x48</code>
|4
|Unsigned Int
|Unknown. Always 3
|-
|<code>0x4c</code>
|4
|Unsigned Int
|Unknown. Usually 0 or 1.
|-
|<code>0x50</code>
|4
|Unsigned Int
|Unknown. Always 1.
|}
|}
  [20, 3, 0, 1, 0, 3, 1, 1] = water, grass
  [3, 0, 1, 0, 3, 1, 1, 0] = grass, water
  [20, 3, 1, 1, 0, 3, 0, 1] = water, grass
  [3, 1, 1, 0, 3, 0, 1, 0] = water, grass
  [ 3, 1, 1, 0]            = water
  [3, 1, 1, 0]            = water
  [ 3, 0, 1, 0]            = grass
  [3, 0, 1, 0]            = grass
It seems that water is <code>[3, 1, 1]</code> and grass is <code>[3, 0, 1]</code>
It seems that water is <code>[3, 1, 1]</code> and grass is <code>[3, 0, 1]</code>
[20, `3, 0, 1`, 0, `3, 1, 1`] = grass, water
[20, `3, 1, 1`, 0, `3, 0, 1`] = water, grass
[`3, 1, 1`, 0]                = water
[`3, 0, 1`, 0]                = grass


== <code>stera</code> File Positions ==
==<code>stera</code> File Positions==
[[File:Stera_File_Positions.png|alt=stera File Positions|thumb|<code>stera</code> File Positions]]
[[File:Stera_File_Positions.png|alt=stera File Positions|thumb|<code>stera</code> File Positions]]
<code>stera</code> files referenced in the area array are positioned using a [[wikipedia:Z-order_curve|z-order curve]] or the [[wikipedia:Moser–de_Bruijn_sequence|Moser-de Bruijn sequence]].
<code>stera</code> files referenced in the area array are positioned using a [[wikipedia:Z-order_curve|z-order curve]] or the [[wikipedia:Moser–de_Bruijn_sequence|Moser-de Bruijn sequence]].
4

edits

Navigation menu