User Tools

Site Tools


banjo_tooie:model_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
banjo_tooie:model_data [2018/03/09 19:02]
trenavix [Display List Setup]
banjo_tooie:model_data [2024/02/29 04:24] (current)
BanjoFreak64 [Header]
Line 1: Line 1:
 ======== Model Data ======== ======== Model Data ========
  
-Banjo-Tooie uses a file-system in which most resources are packed into file blocks throughout the ROM, and are unpacked into RAM when needed. Among these are the model files, each with their own syntax and load-lines. This page's purpose is to cover the syntax and properties of said model files.+Banjo-Tooie uses a file-system in which most resources are packed into file blocks throughout the ROM, and are unpacked into RAM when needed. Among these are the model files, each with their own syntax and load-lines. This page's purpose is to cover the syntax and properties of said model files. Note that it is //very// similar to [[https://​hack64.net/​wiki/​doku.php?​id=banjo_kazooie:​model_data|Banjo-Kazooie'​s model format]], just with more features like collision changes, optimised texture headers, and F3DEX2 instead of F3DEX.
  
 ===== Header ===== ===== Header =====
Line 7: Line 7:
 ^ Address ^ Value/​Syntax ^ Description ^ ^ Address ^ Value/​Syntax ^ Description ^
 | 0x00000000 | [00 00 00 0B] | START | | 0x00000000 | [00 00 00 0B] | START |
-| 0x00000004 | [<​color ​darkred>aa aa aa aa</​color>​] | Geometry Layout Offset | +| 0x00000004 | [<​color ​red>aa aa aa aa</​color>​] | Geometry Layout Offset | 
-| 0x00000008 | [<​color ​darkgreen>bb bb</​color>​ <​color ​darkblue>cc cc</​color>​] | <​color ​darkgreen>​bb</​color>​=Texture Setup Offset (Usually 00 50), <​color ​darkblue>​cc</​color>​=Geo Type* | +| 0x00000008 | [<​color ​limegreen>bb bb</​color>​ <​color ​aqua>cc cc</​color>​] | <​color ​limegreen>​bb</​color>​=Texture Setup Offset (Usually 00 50), <​color ​aqua>​cc</​color>​=Geo Type* | 
-| 0x0000000C | [<​color ​darkred>dd dd dd dd</​color>​] | Display List Setup Offset | +| 0x0000000C | [<​color ​red>dd dd dd dd</​color>​] | Display List Setup Offset | 
-| 0x00000010 | [<​color ​darkgreen>ee ee ee ee</​color>​] | Vertex Store Setup Offset |+| 0x00000010 | [<​color ​limegreen>ee ee ee ee</​color>​] | Vertex Store Setup Offset |
 | 0x00000014 | [00 00 00 00] | ? | | 0x00000014 | [00 00 00 00] | ? |
-| 0x00000018 | [<​color ​darkblue>ff ff ff ff</​color>​] | Animation Setup | +| 0x00000018 | [<​color ​aqua>ff ff ff ff</​color>​] | Animation Setup | 
-| 0x0000001C | [<​color ​darkred>gg gg gg gg</​color>​] | Collision Setup | +| 0x0000001C | [<​color ​red>gg gg gg gg</​color>​] | Collision Setup | 
-| 0x00000020 | [<​color ​darkgreen>hh hh hh hh</​color>​] | Effects Setup End Address | +| 0x00000020 | [<​color ​limegreen>hh hh hh hh</​color>​] | Effects Setup End Address | 
-| 0x00000024 | [<​color ​darkgreen>hh hh hh hh</​color>​] | Effects Setup | +| 0x00000024 | [<​color ​limegreen>hh hh hh hh</​color>​] | Effects Setup | 
-| 0x00000028 | [00 00 00 00] | +| 0x00000028 | [<color aqua>ii ii ii ii</​color>​] | Vertex-Bone Mapping ​
-| 0x0000002C | [00 00 00 00] | |+| 0x0000002C | [<color red>jj jj jj jj</​color>​] | Texure Animation Setup |
 | 0x00000030 | [00 00 00 00] | ? | | 0x00000030 | [00 00 00 00] | ? |
-| 0x00000034 | [00 00 <​color ​darkblue>ii ii</​color>​] | Related to external textures??? | +| 0x00000034 | [00 00 <​color ​limegreen>kk kk</​color>​] | Related to external textures??? | 
-| 0x00000038 | [<​color ​darkred>jj jj jj jj</​color>​] | Some animation setup offset? (Vertex ​clipping?​) ​+| 0x00000038 | [<​color ​aqua>ll ll ll ll</​color>​] | Vertex ​Normals ​
-| 0x00000044 | [<​color ​darkgreen>kk kk</​color>​ <​color ​darkblue>ll ll</​color>​] | kk= Tri count, ​ll= vert count | +| 0x00000044 | [<​color ​red>nn nn</​color>​ <​color ​limegreen>oo oo</​color>​] | nnnn= Tri count, ​oooo= vert count 
-''​*Geo Types: 0000=normal,​ 0002= Trilinear MipMapping (RGBA16), 0004=Env mapping''​+| 0x00000048 | [00 00 00 00] | ? | 
 +| 0x0000004C | [00 00 00 00] | ? 
 +''​*Geo Types: 0000=normal,​ 0002= Trilinear MipMapping (RGBA16), 0004=Env mapping, 0010=?''​
  
 ---- ----
Line 28: Line 30:
 ===== Texture Setup ===== ===== Texture Setup =====
 ^ Offset from TexSetup Start ^ Value/​Syntax ^ Description ^ ^ Offset from TexSetup Start ^ Value/​Syntax ^ Description ^
-| 0x00000000 | [<​color ​darkred>aa aa aa aa</​color>​] | Amount of data in bytes to load (including command) | +| 0x00000000 | [<​color ​red>aa aa aa aa</​color>​] | Amount of data in bytes to load (including command) | 
-| 0x00000004 | [<​color ​darkgreen>bb bb</​color>​ <​color ​darkblue>​cc</​color>​ 00] | bb=Texture Count, cc=External Textures(01y 00n) | +| 0x00000004 | [<​color ​limegreen>bb bb</​color>​ <​color ​aqua>​cc</​color>​ 00] | bb=Texture Count, cc=External Textures(01y 00n) | 
-| 0x00000008 | [<​color ​darkred>dd dd dd dd</​color>​] | Texture[i] segment address from texture data start OR External Texture Index* | +| 0x00000008 | [<​color ​red>dd dd dd dd</​color>​] | Texture[i] segment address from texture data start OR External Texture Index* | 
-| 0x0000000C | [<​color ​purple>​ee</​color>​ <​color ​darkgreen>​ff</​color>​ <​color ​darkblue>​xx</​color>​ <​color ​darkred>​yy</​color>​] | Texture[i] <​color ​purple>​ee</​color>​ = 0x80 for MIP Mapping (00 otherwise), <​color ​darkgreen>​ff</​color>​ =type*, <​color ​darkblue>​xx</​color><​color ​darkred>​yy</​color>​=Pixel Grid | +| 0x0000000C | [<​color ​violet>​ee</​color>​ <​color ​limegreen>​ff</​color>​ <​color ​aqua>​xx</​color>​ <​color ​red>​yy</​color>​] | Texture[i] <​color ​violet>​ee</​color>​ = 0x80 for MIP Mapping (00 otherwise), <​color ​limegreen>​ff</​color>​ =type*, <​color ​aqua>​xx</​color><​color ​red>​yy</​color>​=Pixel Grid | 
-''​*Types:​ 01=CI4, 02=CI8 04=RGBA16, 08=RGBA32, 0x10=IA8,''​+''​*Types:​ 01=CI4, 02=CI804=RGBA16, 08=RGBA32, 0x10=IA8,''​
  
 <​code>​*External texture indices start at FileID 0x1EF6, 0 indexed. <​code>​*External texture indices start at FileID 0x1EF6, 0 indexed.
Line 44: Line 46:
 ==== Display List Setup ==== ==== Display List Setup ====
 ^ Offset from DLSetup Start ^ Value/​Syntax ^ Description ^ ^ Offset from DLSetup Start ^ Value/​Syntax ^ Description ^
-| 0x00000000 | [<​color ​darkred>aa aa aa aa</​color>​ 00 00 00 00] | F3DEX2 Command Count | +| 0x00000000 | [<​color ​red>aa aa aa aa</​color>​ 00 00 00 00] | F3DEX2 Command Count | 
-| 0x00000008 | [[http://​hack64.net/​wiki/​doku.php?​id=f3dex2]] | F3DEX2 Display List |+| 0x00000008 | [[http://​hack64.net/​wiki/​doku.php?​id=f3dex2|F3DEX2]] | F3DEX2 Display List |
  
 ---- ----
Line 51: Line 53:
 ==== Vertex Store Setup ==== ==== Vertex Store Setup ====
 ^ Offset from VTXSetup Start ^ Value/​Syntax ^ Description ^ ^ Offset from VTXSetup Start ^ Value/​Syntax ^ Description ^
-| 0x00000000 | [<​color ​darkred>aa aa</​color>​ <​color ​darkgreen>bb bb</​color>​ <​color ​darkblue>cc cc</​color>​] | Draw distance: Negative Coords | +| 0x00000000 | [<​color ​red>aa aa</​color>​ <​color ​limegreen>bb bb</​color>​ <​color ​aqua>cc cc</​color>​] | Draw distance: Negative Coords | 
-| 0x00000006 | [<​color ​darkred>dd dd</​color>​ <​color ​darkgreen>ee ee</​color>​ <​color ​darkblue>ff ff</​color>​] | Draw distance: Positive Coords | +| 0x00000006 | [<​color ​red>dd dd</​color>​ <​color ​limegreen>ee ee</​color>​ <​color ​aqua>ff ff</​color>​] | Draw distance: Positive Coords | 
-| 0x0000000C | [<​color ​darkred>gg gg</​color>​ <​color ​darkgreen>hh hh</​color>​] | Object Coordinate Range | +| 0x0000000C | [<​color ​red>xx xx</​color>​ <​color ​limegreen>yy yy</​color>​ <color aqua>zz zz</​color>​] | Object Coordinate Range | 
-0x00000010 ​| [<​color ​darkred>jj jj</​color>​] | Collision range? (Enemies, Objects) | +0x00000012 ​| [<​color ​red>jj jj</​color>​] | Collision range? (Enemies, Objects) | 
-| 0x00000014 | [<​color ​darkgreen>kk kk</​color>​] | Collision range? (Banjo) | +| 0x00000014 | [<​color ​limegreen>kk kk</​color>​] | Collision range? (Banjo) | 
-| 0x00000016 | [<​color ​darkblue>ll ll</​color>​] | Vertex Count*2 |+| 0x00000016 | [<​color ​aqua>ll ll</​color>​] | Vertex Count*2 |
  
 ---- ----
  
 +==== Animation Setup ====
 +^ Offset from Setup Start ^Value/​Syntax ^Description ^
 +| 0x00000000 | [<color red>aa aa aa aa</​color>​] | Translation Scale (float) |
 +| 0x00000004 | [<color limegreen>​bb bb</​color>​ 00 00] | Bone Count|
 +^ Offset From Bone Start ^ ^ ^
 +| 0x00000000 | [<color red>xx xx xx xx</​color>​] | Bone X Translation (float) |
 +| 0x00000004 | [<color limegreen>​yy yy yy yy</​color>​] | Bone Y Translation (float) |
 +| 0x00000008 | [<color aqua>zz zz zz zz</​color>​] | Bone Z Translation (float) |
 +| 0x0000000C | [<color orange>​cc cc</​color>​ <color purple>​dd dd</​color>​] | <color orange>​cccc</​color>​=Bone ID, <color purple>​dddd</​color>​=Parent Index |
 +
 +----
 +
 +==== Effects Setup ====
 +^ Offset from Setup Start ^ Value/​Syntax ^ Description ^
 +| 0x00000000 | [<color red>aa aa</​color>​] | Effect Count |
 +| 0x0000002 | [<color limegreen>​bb bb</​color>​ <color aqua>cc cc</​color>​] | <color limegreen>​bbbb</​color>​=Effect ID, <color aqua>​cccc</​color>​=Effect Vertex Count|
 +| 0x0000006 | [<color orange>​dd dd</​color>​ <color purple>​ee ee</​color>​] | <color orange>​dddd</​color>,​ <color purple>​eeee</​color>​...=Effect Vertex Index List |
 +| ...|||
 +
 +Effect IDs are <​code>​100*Type + Param  (decimal)</​code>​ where Param is usually used to 
 +control the speed of the effect, and Type is taken from
 +^Type^DLL Name^Description^
 +| 0 |  | Code room letters |
 +| 1 | idscroll | Texture scrolling (along vertical axis) |
 +| 2 | idlight | Flickering vertex color, for fake lighting around flames |
 +| 3 | idwater | Oscillating texture scrolling |
 +| 4 | | |
 +| 5 | idglow | Vertex color regularly gets brighter and dimmer |
 +| 6 | | |
 +| 7 | idwave | Rippling water surface, amplitude controlled by bounding box of affected vertices |
 +| 8 | idglowa | Like glow, but only for vertex alpha |
 +| 9 | idflasha | |
 +| 10 | idflash | |
 +| 11 | | |
 +| 12 | idwibble | All wibbles use a spherical wave to change some vertex parameters (usually texture coordinate and color). This one is faster, with a smaller amplitudes|
 +| 13 | idwibble | Standard wibble |
 +| 14 | idwibble | Only wibble color |
 +| 15 | idwibble | Only wibble texture coordinates |
 +| 16 | idwibble | Also move up and down, like idwave |
 +| 17 | idbounce | Used for bouncy castle |
 +| 18 | idtwinkle | Used for mine crystals; occasionally choose a center vertex and briefly brighten the vertex colors on its neighbors with random delays|
 +| 19 | idflame | |
 +| 20 | idtwinklea | |
 +| 21 | idwibble | Fast wibble, with larger amplitudes|
 +| 22 | idtwinklecolour | |
 +----
 +
 +==== Vertex-Bone Mapping ====
 +^ Offset from Setup Start ^Value/​Syntax ^Description ^
 +| 0x00000000 | [<color red>aa aa</​color>​ <color limegreen>​bb bb</​color>​] | <color red>​aaaa</​color>​=Has Norms, <color limegreen>​bbbb</​color>​=Entry Count |
 +^ Offset From Entry Start ^ ^ ^
 +| 0x00000000 | [<color red>cc cc</​color>​ <color limegreen>​dd dd</​color>​ <color aqua>ee ee</​color>​] | <color red>​cccc</​color>​=Bone ID, <color limegreen>​dddd</​color>​=Position Count, <color aqua>​eeee</​color>​=Normal Count |
 +| 0x00000006 | [<color red>xx xx</​color>​ <color limegreen>​yy yy</​color>​ <color aqua>zz zz</​color>​] | Vertex Position (in bone space) |
 +| ... | | |
 +| 0x6 + 6*Positions | [<color red>​xx</​color>​ <color limegreen>​yy</​color>​ <color aqua>​zz</​color>​ 00] | Vertex Normal (in bone space) |
 +| ... | | |
 +| 0x6 + 6*Positions + 4*Normals | [<color orange>​ee ee</​color>​ <color purple>​ff ff</​color>​] | <color orange>​eeee</​color>,​ <color purple>​ffff</​color>,​...=Vertex IDs |
 +
 +Each vertex is assumed to have its own normal, but some share positions. The initial vertices are assigned the first position, then an ID of -1 in the list indicates ​
 +that the following vertices should use the next position in the list, and -2 indicates the end.
 +Thus there are (Normal Count) + (Offset Count) entries in the ID list, including the negative values.
 +
 +----
 +
 +==== Texture Animation Setup ====
 +Up to five entries corresponding to segments 0xF,​0xD,​0xE,​0xC,​0xB of the following form:
 +
 +^ Offset from Entry Start ^Value/​Syntax ^Description ^
 +| 0x00000000 | [<color red>aa aa</​color>​ <color limegreen>​bb bb</​color>​] | <color red>​aaaa</​color>​=Block Size, <color limegreen>​bbbb</​color>​=Block Count |
 +| 0x00000004 | [<color aqua>cc cc cc cc</​color>​] | Frames Per Second (float)|
 +
 +A block is contiguous memory holding texture data which gets loaded into the corresponding segment. ​
 +The chosen block advances at the specified framerate, looping back around to the beginning. ​
 +
 +----
banjo_tooie/model_data.1520622126.txt.gz · Last modified: 2018/03/09 19:02 by trenavix