TSCB: Difference between revisions

mNo edit summary
m Improve description of file_base mainly for the area array entry
 
(4 intermediate revisions by 3 users not shown)
Line 30: Line 30:
|4
|4
|Unsigned Int
|Unsigned Int
|<code>file_base</code> table relative offset
|<code>file_base</code> Offset to the basename (filename without extension) table
|-
|-
|<code>0x10</code>
|<code>0x10</code>
Line 77: Line 77:


===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, as well as itself.
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)
Line 182: Line 182:
|4
|4
|Float
|Float
|Unknown - Affects grass density.<ref>0 may be default. Higher numbers have increased density.</ref>
|Minimum Terrain Height - ranges from 0 to 1
|-
|-
|<code>0x10</code>
|<code>0x10</code>
|4
|4
|Float
|Float
|Unknown
|Maximum Terrain Height - ranges from 0 to 1
|-
|-
|<code>0x14</code>
|<code>0x14</code>
|4
|4
|Float
|Float
|Unknown
|Minimum Water Height - ranges from 0 to 1
|-
|-
|<code>0x18</code>
|<code>0x18</code>
|4
|4
|Float
|Float
|Unknown
|Maximum Water Height - ranges from 0 to 1
|-
|-
|<code>0x1c</code>
|<code>0x1c</code>
Line 207: Line 207:
|4
|4
|Unsigned Int
|Unsigned Int
|<code>file_base</code>. Relative offset to file base name string.
|<code>file_base</code>. Offset to the basename string relative to the current tile entry
|-
|-
|<code>0x24</code>
|<code>0x24</code>
Line 234: Line 234:
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. Entries in the <code>extra_info_array</code> indicate if there is an additional [[Water.extm|.water.extm]] and / or [[Grass.extm|.grass.extm]] file to look for.
 
===Terrain and Water Height===
0x0c through 0x18 are used to determine what height range the terrain and water should render within. This is possibly used to assist with occlusion. If the heightmap moves outside of the range defined here, there will be visual artefacts present at higher viewing angles, usually between 45 and 90 degrees. The range value is multiplied by the max height defined in the TSCB header to determine the final value in 'real' co-ordinates.


====Header====
====Header====
Line 255: Line 258:


====Extra Information Array Value Table====
====Extra Information Array Value Table====
After the Header, there is <code>extra_info_array length</code> / 4 elements of this structure.
After the Header, there are <code>extra_info_array length / 4</code> elements of this structure.
Elements act as flags for presence of [[Water.extm|.water.extm]] or [[Grass.extm|.grass.extm]] files.
A "water" element indicates that there is water data for the terrain section defined in a [[Water.extm|.water.extm]] file. A "grass" element similarly indicates the presence of a [[Grass.extm|.grass.extm]] file.
Grass and water are referenced via the <code>extra_info_array</code> because presence water and grass data for any given terrain area is optional.
{| class="wikitable"
{| class="wikitable"
!Offset (h)
!Offset (h)