User Tools

Site Tools


kirby64_the_crystal_shards:level_settings_blocks

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
Next revision Both sides next revision
kirby64_the_crystal_shards:level_settings_blocks [2020/01/26 20:28]
jesusyoshi54
kirby64_the_crystal_shards:level_settings_blocks [2020/02/18 19:04]
jesusyoshi54 [Vertices]
Line 10: Line 10:
   - Triangle Groups/​Cells   - Triangle Groups/​Cells
   - Surface Normals Groups/​Cells   - Surface Normals Groups/​Cells
-  - Unkown Floats (possibly for star blocks/​breakable geo) +  - Dynamic Geometry Lists 
-  - Unk halfs (possibly for star blocks/​breakable geo) +  - Dynamic Geometry Groups 
-  - Unk halfs 2 (mostly zeroes, ends with 9999) +  - Optional Section?
-  - Unk halfs 3 (Breaking star blocks?)+
   - Collision Header (referred to by Header[0])   - Collision Header (referred to by Header[0])
-  - Camera ​Defines of some sort (referred to by Header[1])+  - Pathing Nodes 
 +  - Kirby Node Params & Camera ​Nodes 
 +  - Node Connections 
 +  - Unk Bytes 
 +  - Unk Floats 
 +  - Camera&​Pathing Header 
 +  - Header_1(referred to by Header[1])
   - Entity List (referred to by Header[2])   - Entity List (referred to by Header[2])
  
Line 23: Line 28:
 <code c> <code c>
 struct Main_Header{ struct Main_Header{
-   0x00: u32 Pointer to Collision Header +   /*0x00*/    ptr    *Collision_Header 
-   0x04: u32 Pointer to Camera Header +   /*0x04*/    ptr    *Camera_Header 
-   0x08: u32 Pointer to Entity IDs+   /*0x08*/    ptr    *Entity_IDs
    }    }
 </​code>​ </​code>​
Line 33: Line 38:
 Collision is handled by several different lists that combine to create the level geometry. Collision is handled by several different lists that combine to create the level geometry.
  
-=== Vertices ===+==== Vertices ​====
  
 Vertices are made up of unsorted s16 tripets of x, y and z position. Vertices are made up of unsorted s16 tripets of x, y and z position.
  
-=== Triangles ===+The vertex array starts with a 0x270F triplet and ends with a single 0x9999. 
 + 
 +==== Triangles ​====
  
 Triangles are made by connecting 3 vertices referenced by their index. (e.g. 0,1,2 is made up of vertices 0,1 and 2 in the list). Triangles are made by connecting 3 vertices referenced by their index. (e.g. 0,1,2 is made up of vertices 0,1 and 2 in the list).
Line 43: Line 50:
 <code c> <code c>
 struct Triangle{ struct Triangle{
-0x0: u16 Vertex[2+/*0x0*/ u16 Vertex[3
-0x6: u16 Quads #not sure +/*0x6*/ u16 Polygon_Number 
-0x8: u16 Collision_Type_1 #(1 forward norm, 2 back norm, 4 no shadow, 8 non solid/warp related?) +/*0x8*/ u16 Collision_Type_1 #(1 forward norm, 2 back norm, 4 no shadow, 8 non solid/warp related?) 
-0xA: u16 Break_flag #(game crashes if not 0xB on hammer geo, has some other numbers for star blocks) +/*0xA*/ u16 Destructable_Group_Index 
-0xC: u16 Break_Particle #(seen in DEDEDE hammer break) +/*0xC*/ u16 Break_Particle #(seen in DEDEDE hammer break) 
-0xE: u16 Halt_Movement #warp related? Maybe dest (kirby cant move while on top of this if 1) +/*0xE*/ u16 Halt_Movement #warp related? Maybe dest (kirby cant move while on top of this if 1) 
-0x10: s16 Col_Param1 #Amount to move kirby while on certain col types or Break Condition +/*0x10*/ s16 Col_Param1 #Amount to move kirby while on certain col types or Break Condition 
-0x12: u16 Collision_Type_2 #see col type list+/*0x12*/ u16 Collision_Type_2 #see col type list
 } }
 </​code>​ </​code>​
Line 66: Line 73:
   * 0x14 - Platform with custom movement (seems to be in some sort of object list separate from normal level geometry)   * 0x14 - Platform with custom movement (seems to be in some sort of object list separate from normal level geometry)
  
-=== Triangle Normals ===+The triangle list begins with a placeholder struct of (0,​1,​2,​3,​4,​5,​6,​7,​8,​9) 
 + 
 +==== Triangle Normals ​====
  
 Triangle normals are stored as a F32 array of 4 values. The first three values are the surface normals while the last is the origin offset. Together the normals should solve the plane equation (see:​[[http://​mathworld.wolfram.com/​Plane.html|link]]). Triangle normals are stored as a F32 array of 4 values. The first three values are the surface normals while the last is the origin offset. Together the normals should solve the plane equation (see:​[[http://​mathworld.wolfram.com/​Plane.html|link]]).
Line 72: Line 81:
 The list of normals always starts with (-1,​-2,​-3,​-4) and this is used to refer to walls. The actual value of the first set of normal is not known to have any significance. Redundant normals are not repeated, but are just referenced multiple times (e.g. two triangles with norm Y==1 and offset==0 share their normal). The list of normals always starts with (-1,​-2,​-3,​-4) and this is used to refer to walls. The actual value of the first set of normal is not known to have any significance. Redundant normals are not repeated, but are just referenced multiple times (e.g. two triangles with norm Y==1 and offset==0 share their normal).
  
-=== Triangle Groups ===+==== Triangle Groups ​====
  
-The triangle groups is a pre-sorted ​list that references each triangle by its index. The triangle group list begins with a flag of 0x8192 and ends with 0x9999. ​The triangle group starts searching for the right triangle ​starting ​at the bottom, and keeps going until it finds the right triangle, ​or it finds an index with the MSB set.+The triangle groups is a list of triangles used to make collision sorting more efficient. 
 + 
 +The triangle group list begins with a flag of 0x8192 and ends with 0x9999. ​Each triangle group is a u16 list of indices to the triangle ​struct array. 
 + 
 +Each triangle group represents one polygon index (0x6 in tri struct). The groups are defined by setting the msb at the last triangle ​in that group. This means any coplanarconnected N-gon will be a single polygon group. Triangle groups are searched in reverse order.
  
 There should be an equal amount of items in the triangle list and triangle group list. There should be an equal amount of items in the triangle list and triangle group list.
  
-=== Normal Groups ===+==== Normal Groups ​====
  
 The normal groups is a list that matches each normal to a triangle. It is formed in pairs with the first item being the index of the normal, and the second item being the index of the triangle. The normal groups is a list that matches each normal to a triangle. It is formed in pairs with the first item being the index of the normal, and the second item being the index of the triangle.
  
-Normal groups are sorted by level H-Position. Only floors & ceilings are referenced by the normal groups, walls are given the first index of the normals list (-1,​-2,​-3,​-4).+Normal groups are sorted by polygon index. Only floors & ceilings are referenced by the normal groups, walls are given the first index of the normals list (-1,​-2,​-3,​-4)
 + 
 +Norm List Structure 
 +<code c> 
 +0x0  u16  Normal_Index 
 +0x2  u16  Triangle_Index 
 +</​code>​ 
 +==== Dynamic Geometry Lists ==== 
 + 
 +A DynGeo list is referenced by certain collision types using 0xA inside the col tri struct. This is so instead of destroying one triangle, all connected geometry is edited as a single rigid body. 
 + 
 +When a triangle is going to be edited, 0xA of the tri struct references the index into this list. This list will then tell the game the index to the array of dynamic geo groups and the number of members in that array. 
 + 
 +<code c> 
 +0x0  u16  Num_Dynamic_Geo_Group_Members #Number of connected triangles 
 +0x2  u16  Index_To_Dynamic_Geo_Group #(0x30 in col header) 
 +0x4  u16  Unk_Index #Gets stored to unk struct 
 +</​code>​ 
 + 
 +The dynamic geo list ends with 0x9999 
 +==== Dynamic Geometry Groups ==== 
 + 
 +Dynamic geometry groups are an array of u16 indices that reference the tri struct array. 
 + 
 +When a triangle is being edited, 0xA in the tri struct points to the dynamic geometry list. From there an index to this dynamic geometry group list is given, and the number of members in that list. 
 + 
 +The dynamic geomtry group only has the references to triangles. The transformation (usually destruction) is applied based on col type or specific code.
  
-=== Collision Header ===+The dynamic geo geoup array ends with 0x9999 
 +==== Collision Header ​====
  
 The collision header is referred to by the first index inside the main header. The collision header has the following format. The collision header is referred to by the first index inside the main header. The collision header has the following format.
Line 99: Line 139:
  0x20: Triangle Norms Cells #processed by 0x80101400. Sorted by H position.  0x20: Triangle Norms Cells #processed by 0x80101400. Sorted by H position.
  0x24: Number Tri Norm Cells #Sorted by H position.  0x24: Number Tri Norm Cells #Sorted by H position.
- 0x28: ​? + 0x28: ​Size of Unk 
- 0x2C: ​Unk Values offset #(Inhale Star Blocks?, ends with 9999) processed by 0x8010DDA4 + 0x2C: ​Destructable_Groups 
- 0x30: ​Unk values offset #(u16 Breaking Star Blocks?) + 0x30: ​Destructable Indices 
- 0x34: ​? + 0x34: ​Optional Param 
- 0x38: ​? + 0x38: ​Optional Param 
- 0x3C: ​Unk Floats + 0x3C: ​Optional Param 
- 0x40: ​?+ 0x40: ​Optional Param
 } }
 </​code>​ </​code>​
  
-===== Camera ​=====+===== Header_1 ​=====
  
-The camera is referred to by the second index in the main header.+The level nodes are referred to by the second index in the main header
 +This section tells the game how to move kirby as you progress through the level and how the camera should act.
kirby64_the_crystal_shards/level_settings_blocks.txt · Last modified: 2021/04/09 18:18 by someone2639