User Tools

Site Tools


banjo_kazooie: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_kazooie:model_data [2024/03/01 16:45]
ThatCowGuy Adding Collision Segment as documented in Decomp and tested
banjo_kazooie:model_data [2024/11/26 16:13] (current)
BanjoFreak64 [Animation Setup]
Line 20: Line 20:
 | 0x00000030 | [<color #​22b14c>​kk kk</​color>​ <color #​00a2e8>​ll ll</​color>​] | <color #​22b14c>​kk</​color>​= Tri count, <color #​00a2e8>​ll</​color>​= vert count | | 0x00000030 | [<color #​22b14c>​kk kk</​color>​ <color #​00a2e8>​ll ll</​color>​] | <color #​22b14c>​kk</​color>​= Tri count, <color #​00a2e8>​ll</​color>​= vert count |
 | 0x00000034 | [00 00 00 00] | ? | | 0x00000034 | [00 00 00 00] | ? |
-''​*Geo Types: 0000=normal,​ 0002= Trilinear MipMapping (RGBA16), 0004=Env mapping, 0006=?''​+''​*Geo Types: 0000=normal,​ 0002= Trilinear MipMapping (RGBA16), 0004=Env mapping, 0006=Trilinear MipMapping (RGBA16) + Environment Mapping''​
  
 ---- ----
Line 76: Line 76:
 | 0x00000016 | [<color #​00a2e8>​mm mm</​color>​] | s16 Largest Distance to Origin | | 0x00000016 | [<color #​00a2e8>​mm mm</​color>​] | s16 Largest Distance to Origin |
  
-Each 16 byte line of the Vertex Setup following the Start denotes where a vertex is stored in 3D space, from where in 2D space its UVs begin being mapped, and which color and opacity alpha values will be applied to these vertices. ​+Each 16 byte line of the Vertex Setup following the Start denotes where a vertex is stored in 3D space, from where in 2D space its UVs begin being mapped, and which color and opacity alpha values will be applied to these vertices. Pulled from [[https://​hack64.net/​wiki/​doku.php?​id=rcpstructs#​rsp_geometry_mode:​~:​text=Edit-,​Vertex%20Structure,​-Vertices%20are%20points|RCP Structures]] for context.
  
 It is stored like this:  It is stored like this: 
Line 98: Line 98:
  
 A vertex will be drawn at position (20, 98, -25). UV mapping will begin at -20 coordinates in the U axis and 20 coordinates in the V axis. This vertex will feature a color of #929292 with full opacity alpha of 0xFF or 255. A vertex will be drawn at position (20, 98, -25). UV mapping will begin at -20 coordinates in the U axis and 20 coordinates in the V axis. This vertex will feature a color of #929292 with full opacity alpha of 0xFF or 255.
 +
 +----
 +===== Animation Setup ======
 +The animation setup rigs bones to a model and anchors them to the origin, or the parent bone (0xFFFF). It is comprised of two sections: A header, and a bone setup.
 +
 +**Animation Header**
 +^ Offset from Animation Setup ^ Value Syntax ^ Description ^
 +| 0x0000 | [<color #​22b14c>​aa aa aa aa</​color>​] | Scaling Factor (float) |
 +| 0x0004 | [<color #​00a2e8>​bb bb</​color>​] | Bone Count |
 +| 0x0006 | [00 00] | Padding / Unk |
 +
 +**Example (74a8.bin, Slappa at address 0x2ca8):**
 +
 +''<​color #​22b14c>​42 34 00 00</​color>​ <color #​00a2e8>​00 19</​color>​ 00 00''​
 +
 +Sets the scaling factor as 45 (<color #​22b14c>​0x42340000</​color>​) and sets the bone count as 25 (<color #​00a2e8>​0x19</​color>​).
 +
 +**Bone Setup**
 +^ Offset following Animation Header ^ Value Syntax ^ Description ^
 +| 0x0000 | [<color #​A946F2>​xx xx xx xx</​color>​] | X Position of Bone (float) |
 +| 0x0004 | [<color #​00a2e8>​yy yy yy yy</​color>​] | Y Position of Bone (float) |
 +| 0x0008 | [<color #​f50569>​zz zz zz zz</​color>​] | Z Position of Bone (float) |
 +| 0x000C | [<color #​d1b219>​ii ii</​color>​] | Internal Bone ID |
 +| 0x000E | [<color #​ff5703>​pp pp</​color>​] | Parent Bone ID |
 +
 +**Example (74a8.bin, Slappa at address 0x2cb0):**
 +
 +''<​color #​A946F2>​BF 8E 23 70</​color>​ <color #​00a2e8>​C3 2D 44 F0</​color>​ <color #​f50569>​40 FC 92 09</​color>​ <color #​d1b219>​00 05</​color>​ <color #​ff5703>​FF FF</​color>''​
 +
 +Assigns a bone to the model at coordinates (<color #​A946F2>​-1.11</​color>,​ <color #​00a2e8>​-173.27</​color>,​ <color #​f50569>​7.89</​color>​),​ gives it an Internal Bone ID of 5 (<color #​d1b219>​0x5</​color>​) and connects that bone to Parent Bone -1 (<color #​ff5703>​0xFFFF</​color>​). This case just so happens to be the origin.
  
 ---- ----
Line 139: Line 169:
 ===== Effects Setup ===== ===== Effects Setup =====
  
-The Effects Setup for Level and Actor bins functions very similar ​in nature ​to that of the [[https://​hack64.net/​wiki/​doku.php?​id=banjo_tooie:​model_data#:​~:​text=Edit-,​Effects%20Setup,​-Offset%20from%20Setup|Effects Setup used in Banjo-Tooie]] only with fewer effects to use. Effects types only appear to go up to 10 types with several unknowns ​currently. Level models can have texture scroll, though actors and objects do not appear to have the same luxury. Some actors like Teehee & Twinklies have effects. There may be more at play that determines how effects are activated.+The Effects Setup for Level and Actor bins functions very similar to the [[https://​hack64.net/​wiki/​doku.php?​id=banjo_tooie:​model_data#:​~:​text=Edit-,​Effects%20Setup,​-Offset%20from%20Setup|Effects Setup used in Banjo-Tooie]] only with fewer effects to use. Effects types only go up to 10 types with several unknowns. Level models can have texture scroll, though actors and objects do not appear to have the same luxury. Some actors like Teehee & Twinklies have "​specially assigned" ​effects. There may be more at play that determines how effects are activated.
  
 ^ Offset from Effects Setup ^ Value/​Syntax ^ Description ^ ^ Offset from Effects Setup ^ Value/​Syntax ^ Description ^
Line 150: Line 180:
 control the speed or amplitude of the effect. For Data Start in the table, param used is 0 and can range from 0-63. Type is taken from control the speed or amplitude of the effect. For Data Start in the table, param used is 0 and can range from 0-63. Type is taken from
 ^Type^Data Start^Description^ ^Type^Data Start^Description^
-| 0 | 0x000 | ?? |+| 0 | 0x000 | ?? - Used in the Sandcastle and Furnace Fun |
 | 1 | 0x064 | Texture scrolling (along vertical axis). Param dictates speed [6A - Slow, 78 - Medium, A0 - Fast]| ​ | 1 | 0x064 | Texture scrolling (along vertical axis). Param dictates speed [6A - Slow, 78 - Medium, A0 - Fast]| ​
 | 2 | 0x0C8 | Flickering vertex color, for fake lighting around flames | | 2 | 0x0C8 | Flickering vertex color, for fake lighting around flames |
Line 156: Line 186:
 | 4 | 0x190 | Seems to trigger geometry to move (possibilities include squash, move). Additional param will crash game. | | 4 | 0x190 | Seems to trigger geometry to move (possibilities include squash, move). Additional param will crash game. |
 | 5 | 0x1F4 | Vertex color regularly gets brighter and dimmer. Param dictates speed of glow. | | 5 | 0x1F4 | Vertex color regularly gets brighter and dimmer. Param dictates speed of glow. |
-| 6 | 0x258 | ?? |+| 6 | 0x258 | ?? - Used in Furnace Fun |
 | 7 | 0x2BC | Rippling wave generation, amplitude controlled by bounding box of affected vertices, speed of wave dictated by param. | | 7 | 0x2BC | Rippling wave generation, amplitude controlled by bounding box of affected vertices, speed of wave dictated by param. |
 | 8 | 0x320 | Vertex alpha regularly gets brighter and dimmer. Param dictates speed of glow. | | 8 | 0x320 | Vertex alpha regularly gets brighter and dimmer. Param dictates speed of glow. |
Line 162: Line 192:
  
  
-Example (GV Model A): +**Example (10238.bin, ​GV Model A):** 
-<code>0003 0078 006A 0010 0011 0012 0013 0014 ... 0605 00AA 0015 06AC ... 06C0 0190 0007 0182 ... 018A 0000 0000 0000</code+ 
-Loads 3 effects, the first being 78 (Medium ​Scrollwith the full vertex count of the effect being 106 (6A) vertices. Verts in the bin that scroll range from vertex lines 16 (0010) to 122 (0605). The second effect in the bin is effect 00AA (fast scrollwith a 21 (15vertex count ranging from vertex lines 1708 (06AC) to 1729 (06C0). The third effect ​in the bin is effect 0190 (??with a vertex count ranging from vertices 386 (0182) to 393 (018A). There is a 4 or 6 byte padding buffer at the end of most effects setups.+''​<color #ed1c24>0003</​color>​ <color #22b14c>0078</​color>​ <color #00a2e8>006A</​color>​ <color orange>0010 0011 0012 0013 0014 [...0605</​color>​ <color #22b14c>00AA</​color>​ <color #00a2e8>0015</​color>​ <color orange>06AC [...06C0</​color>​ <color #22b14c>0190</​color>​ <color #00a2e8>0007</​color>​ <color orange>0182 [...018A</color0000 0000 0000''​ 
 + 
 +Loads 3 (<color #​ed1c24>​0x03</​color>​) effects:  
 +  * Medium ​scroll (<color #​22b14c>​0x78</​color>​assigned to 106 (<color #​00a2e8>​0x6A</​color>​) vertices. Verts in the bin that scroll range from vertex lines 16 (<color orange>​0x10</​color>​) to 122 (<color orange>​0x605</​color>​). 
 +  * Fast Scroll ​(<color #​22b14c>​0xAA</​color>​assigned to 21 (<color #​00a2e8>​0x15</​color>​vertices ​ranging from vertex lines 1708 (<color orange>​0x6AC</​color>​) to 1729 (<color orange>​0x6C0</​color>​). 
 +  * Movement ​effect ​of Star Door (<color #​22b14c>​0x190</​color>​across ​vertices (<color #​00a2e8>​0x7</​color>​) ​ranging from vertices 386 (<color orange>​0x182</​color>​) to 393 (<color orange>​0x18A</​color>​).  
 +There is a 4 or 6 byte padding buffer at the end of most effects setups.
 ---- ----
  
Line 174: Line 210:
 | 0x04 | [<color #​00a2e8>​cc cc cc cc</​color>​] | f32 | Framerate (fps) | | 0x04 | [<color #​00a2e8>​cc cc cc cc</​color>​] | f32 | Framerate (fps) |
  
-Note only the 1st texture in the model can be animated, however it can be animated ​with 4 different framecounts/​framerates.+Note that in order for textures to be animated, all texture data for each frame must be present in the texture section and stacked sequentially. Only the 1st texture in the data stack is displayed and animated, however it can animate through the texture data stack with 4 different framecounts/​framerates. You can determine which textures are being animated by checking the [[https://​hack64.net/​wiki/​doku.php?​id=f3dex#:​~:​text=xx%5D%2000%2000%20%5B-,​bb,​-bb%20bb%20bb%5D|segmented value]] of the FD Set_T_Img display list command for that texture. For Banjo-Kazooie,​ the segmented value can be  
 + ''​0xF,​ 0xE, 0xD, or 0xC''​.
 ---- ----
  
 ===== GeoLayout Setup ===== ===== GeoLayout Setup =====
-This Setup consists of a List of [[https://​hack64.net/​wiki/​doku.php?​id=banjo_kazooie:​geometry_layouts|GeoLayout Commands]].+This Setup consists of a List of [[https://​hack64.net/​wiki/​doku.php?​id=banjo_kazooie:​geometry_layouts|GeoLayout Commands]]. There is no Header in this Setup. 
 + 
 +The Reference-Point Command (''​0x0A''​) appears to be used to determine what Banjo should look at when solving a Jigsaw. The Reference-Point Index is set to ''​0x1E''​ in that case, and the Bone-Index is always ''​0xFFFF''​ (-1) connecting the Point to the origin. Therefor the XYZ Coordinates that are included in the Command represents the actual Position of the Reference-Point within the Map. If a second Jigsaw is in the same Room, it gets the Index ''​0x1F''​ instead, which is the case for the CC and RBB Jigsaws.
 ---- ----
  
banjo_kazooie/model_data.1709311532.txt.gz · Last modified: 2024/03/01 16:45 by ThatCowGuy