TSCB and Map unit: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Zephenryus
m (added links to various stera file specifications.)
 
imported>Leoetlino
m (→‎Definitions: fix formatting)
 
Line 1: Line 1:
<onlyinclude>
{{Stub|what=Complete the contents section, the link system, mention static vs dynamic (and possibly other things)}}
'''T'''errain '''sc'''ene '''b'''inary (TSCB) files describe terrain areas layout and terrain materials.
</onlyinclude>


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


=== Header ===
=== <code>LocationPosX</code> ===
{| class="wikitable"
 
!Offset (h)
=== <code>LocationPosZ</code> ===
!Size
 
!Data Type
=== <code>LocationSize</code> ===
!Description
 
=== <code>Objs</code> ===
 
=== <code>Rails</code> ===
 
== Link system ==
===Definitions===
{|class="wikitable"
! ID !! Name !! Description !! Official description
|-
| 4 || -AxisX || - || マイナスX軸シグナル
|-
| 5 || -AxisY || - || マイナスY軸シグナル
|-
|-
|0x00
| 6 || -AxisZ || - || マイナスZ軸シグナル
|4
|String
|TSCB file signature (magic) <code>54 53 43 42</code> or "TSCB"
|-
|-
|0x04
| 24 || AreaCol || - || エリア(センサ)指定
|4
|Unsigned Int
|TSCB version? <code>0A 00 00 00</code> or "10.0.0.0"<ref>U-King.elf:0x024D2F8C-0x024D300A holds two error messages: "【データロード】メジャーバージョンの不一致" ("[Data load] Major version mismatch") and "【データロード】マイナーバージョンの不一致" ("[Data Load] Minor version mismatch")</ref><ref>Game crashes on load screen if not equal to <code>0A 00 00 00</code></ref>
|-
|-
|0x08
| 1 || AxisX || - || X軸シグナル
|4
|Unsigned Int
|Unknown. Always <code>00 00 00 01</code>. Game crashes on load screen if not equal to <code>00 00 00 01</code>.
|-
|-
|0x0c
| 2 || AxisY || - || Y軸シグナル
|4
|Unsigned Int
|file_base table relative offset
|-
|-
|0x10
| 3 || AxisZ || - || Z軸シグナル
|4
|Float
|<code>world_scale</code> <code>500.0</code>. Scales the terrain along the x- and z-axis.
|-
|-
|0x14
| 37 || BAndSCs || - || ボール&ソケットCS
|4
|Float
|Terrain mesh altitude <code>800.0</code>. Moves the terrain along the y-axis (vertically).
|-
|-
|0x18
| 38 || BAndSLimitAngYCs || - || Y角速度制限付ボール&ソケットCS
|4
|Unsigned Int
|material_info_array length (number of elements in the array)
|-
|-
|0x1c
| 0 || BasicSig || - || 基本シグナル
|4
|Unsigned Int
|area_array length (number of elements in the array)
|-
|-
|0x20
| 9 || BasicSigOnOnly || - || オンのみ基本シグナル
|4
|Unsigned Int
|Probably padding
|-
|-
|0x24
| 14 || ChangeAtnSig || - || アテンション変更時シグナル
|4
|Unsigned Int
|Probably padding
|-
|-
|0x28
| 39 || CogWheelCs || - || 歯車CS
|4
|Float
|Tile size. Used by the area array.
|-
|-
|0x2c
| 21 || CopyWaitRevival || - || 配置自動セーブ継承
|4
|Unsigned Int
|Unknown <code>00 00 00 08</code>. <ref>Values <code>1</code>, <code>2</code>, <code>4</code>, <code>5</code>, <code>6</code>, <code>8</code> affects textures. <code>0</code>, <code>3</code>, <code>7</code>, <code>15</code>, <code>16</code> will crash the game.</ref>
|}
 
== Material Information Array ==
 
=== Header ===
The material information header is one value, the section size. This includes the index table and the value table.
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x00
| 15 || Create || - || 生成
|4
|Unsigned Int
|Material info section size in bytes
|}
 
=== Material Information Array Lookup Table ===
Following the header is a table of relative offsets to each entry in <code>material_info_array</code>
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x00
| 11 || DeadUp || - || 死んだらオン
|4
|Unsigned Int
|Relative offset to array entry
|}
 
=== Material Information Value Table ===
Each entry in the array contains an index and four attributes
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x00
| 16 || Delete || - || 削除
|4
|Unsigned Int
|Array index (<code>mat_index</code>) of <code>material_info_array</code>
|-
|-
|0x04
| 29 || DemoMember || - || デモ参加
|4
|Float
|Texture u-axis (x-axis)
|-
|-
|0x08
| 32 || FixedCs || - || 固定CS
|4
|Float
|Texture v-axis (y-axis)
|-
|-
|0x0c
| 26 || ForSale || - || 売り物
|4
|Float
|Unknown. values range from 0-1.
|-
|-
|0x10
| 19 || ForbidAttention || - || アテンションタイプ変更
|4
|Float
|Unknown. values range from 0.2-1.63
|}
 
== Area Array ==
 
=== Area Array Lookup Table ===
Following the material information section is a table of relative offsets to each entry in area_array
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x00
| 18 || Freeze || - || 凍結
|4
|Unsigned Int
|Relative offset to array entry
|}
 
=== 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.
 
Entries range from 0x30 to 0x54 depending on the size of <code>extra_info_array</code>
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x00
| 7 || GimmickSuccess || - || ネタ成功シグナル
|4
|Float
|X Position
|-
|-
|0x04
| 33 || HingeCs || - || ヒンジCS
|4
|Float
|Z Position
|-
|-
|0x08
| 12 || LifeZero || - || ライフ0
|4
|Float
|Unknown (Inverse height scale?)<ref>Lower numbers yield greater height. Also seems that this is affected by <code>world_scale</code> in the header</ref>
|-
|-
|0x0c
| 34 || LimitHingeCs || - || 制限付ヒンジCS
|4
|Float
|Unknown - Affects grass density.<ref>0 may be default. Higher numbers have increased density.</ref>
|-
|-
|0x10
| 27 || ModelBind || - || モデルバインド
|4
|Float
|Unknown
|-
|-
|0x14
| 17 || MtxCopyCreate || - || 位置継承生成
|4
|Float
|Unknown
|-
|-
|0x18
| 22 || OffWaitRevival || - || 配置自動セーブオフ
|4
|Float
|Unknown
|-
|-
|0x1c
| 30 || PhysSystemGroup || - || 物理システムグループ
|4
|Unsigned Int
|Unknown. Usually <code>0</code>, <code>1</code> or <code>2</code>, crashes on <code>4</code>, <code>16</code>.<ref>May be a flag for grass and water? <code>0</code> seems to indicate no water or grass.</ref>
|-
|-
|0x20
| 28 || PlacementLOD || - || 配置LOD
|4
|Unsigned Int
|<code>file_base</code>. Relative offset to file base name string.
|-
|-
|0x24
| 36 || PulleyCs || - || 滑車CS
|4
|Unsigned Int
|Unknown. Usually <code>0</code>.
|-
|-
|0x28
| 40 || RackAndPinionCs || - || ラック&ピニオンCS
|4
|Unsigned Int
|Unknown. Usually <code>0</code>.
|-
|-
|0x2c
| 23 || Recreate || - || 再生成
|4
|Unsigned Int
|<code>ref_extra</code>. It seems to be a flag to indicate if there is an attached <code>extra_info_array</code>
|}
 
=== Extra Information Array ===
if ref_extra does not equal 0 there is an extra_info_array attached to this area. The array is 4 or 8 values long.
 
Every area includes a [[HGHT|.hght]] and [[MATE|.mate]] file. The extra_info_array indicates if there is an additional [[Water.extm|.water.extm]] and / or [[Grass.extm|.grass.extm]] file
{| class="wikitable"
!Offset (h)
!Size
!Data Type
!Description
|-
|-
|0x30
| 41 || Reference || - || 参照
|4
|Unsigned Int
|extra_info_array length. Number of elements in array.
|-
|-
|0x34
| 10 || Remains || - || 遺物シグナル
|4
|Unsigned Int
|Unknown. Usually 20 or 3.
|-
|-
|0x38
| 25 || SensorBind || - || センサバインド
|4
|Unsigned Int
|Unknown. Usually 0, 1 or 3.
|-
|-
|0x3c
| 35 || SliderCs || - || スライダーCS
|4
|Unsigned Int
|Unknown. Usually 0 or 1.
|-
|-
|0x40
| 13 || Stable || - || 安定
|4
|Unsigned Int
|Unknown. Usually 0 or 1.
|-
|-
|0x44
| 31 || StackLink || - || スタック
|4
|Unsigned Int
|Unknown. Always 0.
|-
|-
|0x48
| 20 || SyncLink || - || 生成グループ
|4
|Unsigned Int
|Unknown. Always 3
|-
|-
|0x4c
| 8 || VelocityControl || - || 速度制御シグナル
|4
|Unsigned Int
|Unknown. Usually 0 or 1.
|-
|-
|0x50
|4
|Unsigned Int
|Unknown. Always 1.
|}
|}
[20, 3, 0, 1, 0, 3, 1, 1] = water, grass
[20, 3, 1, 1, 0, 3, 0, 1] = water, grass
[ 3, 1, 1, 0]            = water
[ 3, 0, 1, 0]            = grass


It seems that water is [3, 1, 1] and grass is [3, 0, 1]
== File formats ==


[20, `3, 0, 1`, 0, `3, 1, 1`] = grass, water
=== Map unit binary ===
[20, `3, 1, 1`, 0, `3, 0, 1`] = water, grass
In ''Breath of the Wild'', map units are stored in a binary format and given the ''mubin'' (Map Unit Binary) file extension. All map object IDs are replaced with CRC32 hashes as a space optimisation. [[BYML]] is used as the serialisation format.
[`3, 1, 1`, 0]               = water
[`3, 0, 1`, 0]               = grass


=== Source map unit ===
Source map units have muunt<ref>The executable has remnants of functions that can load map units with the following path: <code>Map/Project/%s/Data/%s/%s.muunt</code> (in what appears to be development code)</ref> as their file extension and use strings for map object IDs such as <code>F-5_challenge.muunt/obj760</code> instead of CRC32 hashes of the IDs in map unit binaries.
[[Category:Internals]]
<references />
<references />
[[Category:File formats]]
[[Category:File formats]]
[[Category:File extensions]]
[[Category:File extensions (STERA)]]

Revision as of 20:47, 30 November 2018


Contents

LocationPosX

LocationPosZ

LocationSize

Objs

Rails

Link system

Definitions

ID Name Description Official description
4 -AxisX - マイナスX軸シグナル
5 -AxisY - マイナスY軸シグナル
6 -AxisZ - マイナスZ軸シグナル
24 AreaCol - エリア(センサ)指定
1 AxisX - X軸シグナル
2 AxisY - Y軸シグナル
3 AxisZ - Z軸シグナル
37 BAndSCs - ボール&ソケットCS
38 BAndSLimitAngYCs - Y角速度制限付ボール&ソケットCS
0 BasicSig - 基本シグナル
9 BasicSigOnOnly - オンのみ基本シグナル
14 ChangeAtnSig - アテンション変更時シグナル
39 CogWheelCs - 歯車CS
21 CopyWaitRevival - 配置自動セーブ継承
15 Create - 生成
11 DeadUp - 死んだらオン
16 Delete - 削除
29 DemoMember - デモ参加
32 FixedCs - 固定CS
26 ForSale - 売り物
19 ForbidAttention - アテンションタイプ変更
18 Freeze - 凍結
7 GimmickSuccess - ネタ成功シグナル
33 HingeCs - ヒンジCS
12 LifeZero - ライフ0
34 LimitHingeCs - 制限付ヒンジCS
27 ModelBind - モデルバインド
17 MtxCopyCreate - 位置継承生成
22 OffWaitRevival - 配置自動セーブオフ
30 PhysSystemGroup - 物理システムグループ
28 PlacementLOD - 配置LOD
36 PulleyCs - 滑車CS
40 RackAndPinionCs - ラック&ピニオンCS
23 Recreate - 再生成
41 Reference - 参照
10 Remains - 遺物シグナル
25 SensorBind - センサバインド
35 SliderCs - スライダーCS
13 Stable - 安定
31 StackLink - スタック
20 SyncLink - 生成グループ
8 VelocityControl - 速度制御シグナル

File formats

Map unit binary

In Breath of the Wild, map units are stored in a binary format and given the mubin (Map Unit Binary) file extension. All map object IDs are replaced with CRC32 hashes as a space optimisation. BYML is used as the serialisation format.

Source map unit

Source map units have muunt[1] as their file extension and use strings for map object IDs such as F-5_challenge.muunt/obj760 instead of CRC32 hashes of the IDs in map unit binaries.

  1. The executable has remnants of functions that can load map units with the following path: Map/Project/%s/Data/%s/%s.muunt (in what appears to be development code)