This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
banjo_kazooie:model_data [2024/02/21 22:54] ThatCowGuy adding GeoLayout Setup with Shortcut |
banjo_kazooie:model_data [2024/07/29 12:31] (current) ThatCowGuy added Info about RefPoints being used for Jigsaw Look-Ats |
||
---|---|---|---|
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. | ||
+ | |||
+ | ---- | ||
+ | ===== Collision Setup ===== | ||
+ | The Collision Setup begins with a Header of Size 0x18: | ||
+ | ^ Offset within CollSetup ^ Value/Syntax ^ Description ^ | ||
+ | | 0x00000000 | [''<color #A946F2>xx xx</color> <color #00a2e8>yy yy</color> <color #f50569>zz zz</color>''] | s16[3] Minimum GeoCube Index | | ||
+ | | 0x00000006 | [''<color #A946F2>xx xx</color> <color #00a2e8>yy yy</color> <color #f50569>zz zz</color>''] | s16[3] Maximum GeoCube Index | | ||
+ | | 0x0000000C | [''<color #d1b219>vv vv</color>''] | u16 Y Stride - GeoCubes per X-Row | | ||
+ | | 0x0000000E | [''<color #ff5703>ww ww</color>''] | u16 Z Stride - GeoCubes per XY-Layer | | ||
+ | | 0x00000010 | [''<color #00a2e8>cc cc</color>''] | u16 Total amount of GeoCubes | | ||
+ | | 0x00000012 | [''<color #22b14c>ss ss</color>''] | u16 GeoCube Scale | | ||
+ | | 0x00000014 | [''<color #ed1c24>tt tt</color>''] | u16 Total amount of Collision Tris | | ||
+ | | 0x00000016 | [''00 00''] | Padding | | ||
+ | |||
+ | The entire map is split up into 3D GeoCubes that all share the same scale ''0x<color #22b14c>SSSS</color>^3''. They are set up in a 3D matrix, such that the GeoCube (0,0,0) is stretching from the coordinates (0,0,0) to (0x<color #22b14c>SSSS</color>, 0x<color #22b14c>SSSS</color>, 0x<color #22b14c>SSSS</color>). In Memory, the GeoCubes are stored as a 1D array, where the Y and Z strides are used for the pointer arithmetic of referencing the correct cube: | ||
+ | |||
+ | <code> | ||
+ | cube_arr[cube_x][cube_y][cube_z] | ||
+ | == cube_arr[cube_x + (cube_y * stride_y) + (cube_z * stride_z)] | ||
+ | == cube_arr[cube_ID] | ||
+ | </code> | ||
+ | Following the Header, we have a list of 0x<color #00a2e8>CCCC</color> GeoCube instances of Size 0x08, looking like this: | ||
+ | |||
+ | ^ Value/Syntax ^ Description ^ | ||
+ | | [''<color #A946F2>aa aa</color>''] | u16 Starting Tri ID | | ||
+ | | [''<color #b5e61d>cc cc</color>''] | u16 Tri Count | | ||
+ | |||
+ | These are referring to a Subset ''[start : (start + count))'' of Collision Tris from the then following Collision Tri list. This list contains 0x<color #ed1c24>TTTT</color> Collision Triangles, of Size 0x0C, which are structured like this in BK: | ||
+ | |||
+ | ^ Value/Syntax ^ Description ^ | ||
+ | | [''<color #A946F2>aa aa</color>''] | u16 Vertex ID 1 | | ||
+ | | [''<color #00a2e8>bb bb</color>''] | u16 Vertex ID 2 | | ||
+ | | [''<color #f50569>cc cc</color>''] | u16 Vertex ID 3 | | ||
+ | | [''<color #808080>uu uu</color>''] | <color #808080>unknown</color> | | ||
+ | | [''<color #b5e61d>ii ii ii ii</color>''] | u32 Sound + Collision Flags | | ||
+ | |||
+ | Where every Triangle is defined by the 3 indices as 1-2-3, which is important to determine its front facing direction. | ||
---- | ---- | ||
Line 121: | Line 158: | ||
| 6 | 0x258 | ?? | | | 6 | 0x258 | ?? | | ||
| 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 | ?? | | + | | 8 | 0x320 | Vertex alpha regularly gets brighter and dimmer. Param dictates speed of glow. | |
| 9 | 0x384 | Adds lightning sound effect, no visible change. Param does not seem to affect sound speed. Could be alpha related. | | | 9 | 0x384 | Adds lightning sound effect, no visible change. Param does not seem to affect sound speed. Could be alpha related. | | ||
Line 127: | Line 164: | ||
Example (GV Model A): | Example (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> | <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 Scroll) with 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 scroll) with a 21 (15) vertex count ranging from vertex lines 1708 (06AC) to 1729 (06C0). The third effect in the bin is effect 0190 (??) with a 7 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. | + | Loads 3 effects, the first being 78 (Medium Scroll) with 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 scroll) with a 21 (15) vertex count ranging from vertex lines 1708 (06AC) to 1729 (06C0). The third effect in the bin is effect 0190 (Move Star Door) with a 7 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. |
---- | ---- | ||
Line 141: | Line 178: | ||
===== 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. | ||
---- | ---- | ||