OBD:CRSA: Difference between revisions
Jump to navigation
Jump to search
(minor nicification) |
m (I'm only guessing, but...) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{OBD_File_Header | type=CRSA | prev=CONS | next=DOOR | name=Corpse Array | family=Level | align=center}} | {{OBD_File_Header | type=CRSA | prev=CONS | next=DOOR | name=Corpse Array | family=Level | align=center | onistuff=crsa}} | ||
Line 16: | Line 16: | ||
{{OBDtr| 0x004 | lev_id |FFFF00| 01 00 00 06 | 3 | level 3 }} | {{OBDtr| 0x004 | lev_id |FFFF00| 01 00 00 06 | 3 | level 3 }} | ||
{{OBDtr| 0x008 | char[12] |00FF00| AD DE | dead | unused }} | {{OBDtr| 0x008 | char[12] |00FF00| AD DE | dead | unused }} | ||
{{OBDtr| 0x014 | int32 |00FFFF| 11 00 00 00 | 17 | | {{OBDtr| 0x014 | int32 |00FFFF| 11 00 00 00 | 17 | number of "fixed" corpses }} | ||
{{OBDtr| 0x018 | int32 |FF00FF| 11 00 00 00 | 17 | | {{OBDtr| 0x018 | int32 |FF00FF| 11 00 00 00 | 17 | number of "used" corpses }} | ||
{{OBDtr| 0x01C | int32 |FF8000| 14 00 00 00 | 20 | array capacity }} | {{OBDtr| 0x01C | int32 |FF8000| 14 00 00 00 | 20 | array capacity; always the same in original Oni }} | ||
{{OBDtrBK}} | {{OBDtrBK}} | ||
{{OBDtr2|0x000 | char[ | {{OBDtr2|0x000 | char[32]|FFC8C8| _lvl_3_Intro_TCL_A_corpse.dat| ignored; the name of the source file }} | ||
{{OBDtr|0x020 | int[32] |FFC8C8| | | runtime only }} | |||
{{OBDtr| 0x0A0 | link |FFFFC8| 01 36 02 00 | 566 | link to 00566-TCTF_lite_1.[[OBD:ONCC|ONCC]] }} | {{OBDtr| 0x0A0 | link |FFFFC8| 01 36 02 00 | 566 | link to 00566-TCTF_lite_1.[[OBD:ONCC|ONCC]] }} | ||
|- ALIGN=CENTER VALIGN=TOP | |- ALIGN=CENTER VALIGN=TOP | ||
Line 62: | Line 63: | ||
|ALIGN=LEFT|bounding box for the whole corpse | |ALIGN=LEFT|bounding box for the whole corpse | ||
|} | |} | ||
;Array capacity | |||
:The array capacity is larger than the number of "fixed"/"used" corpses to allow the engine to store new corpses at runtime. "Fixed" means that those corpses are never overwritten/deleted at runtime, all new corpses are stored after the "fixed" ones. This means that "fixed" <= "used" <= "capacity". | |||
;Bones | ;Bones | ||
Line 77: | Line 79: | ||
;Authoring | ;Authoring | ||
:The script command [[make_corpse]](filename) creates a separate corpse file in the Oni folder. | :The script command [[make_corpse]](filename) creates a separate corpse file in the Oni folder. The pose of this corpse is taken from the player character (the [[Dev Mode]] shortcut Ctrl+F7, "Play dead", would have come in handy here). The format is roughly as above. The contents of the files thus created can then be inserted as elements in a level's CRSA. | ||
{{OBD_File_Footer | type=CRSA | prev=CONS | next=DOOR | name=Corpse Array | family=Level}} | {{OBD_File_Footer | type=CRSA | prev=CONS | next=DOOR | name=Corpse Array | family=Level}} | ||
{{OBD}} |
Latest revision as of 19:49, 23 May 2013
|
The first image shows the header and the beginning of the first element. The second image the end of it.
Offset | Type | Raw Hex | Value | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x000 | res_id | 01 35 02 00 | 565 | 00565-.CRSA | ||||||||||||||||||||||||
0x004 | lev_id | 01 00 00 06 | 3 | level 3 | ||||||||||||||||||||||||
0x008 | char[12] | AD DE | dead | unused | ||||||||||||||||||||||||
0x014 | int32 | 11 00 00 00 | 17 | number of "fixed" corpses | ||||||||||||||||||||||||
0x018 | int32 | 11 00 00 00 | 17 | number of "used" corpses | ||||||||||||||||||||||||
0x01C | int32 | 14 00 00 00 | 20 | array capacity; always the same in original Oni | ||||||||||||||||||||||||
First element (black outline) | ||||||||||||||||||||||||||||
0x000 | char[32] | _lvl_3_Intro_TCL_A_corpse.dat | ignored; the name of the source file | |||||||||||||||||||||||||
0x020 | int[32] | runtime only | ||||||||||||||||||||||||||
0x0A0 | link | 01 36 02 00 | 566 | link to 00566-TCTF_lite_1.ONCC | ||||||||||||||||||||||||
0x0A4 | matrix |
|
|
transform matrix for the pelvis (in world space) | ||||||||||||||||||||||||
0xD4-0x434 : transform matrices for the other 18 bones | ||||||||||||||||||||||||||||
0x434 | AABB |
|
|
bounding box for the whole corpse |
- Array capacity
- The array capacity is larger than the number of "fixed"/"used" corpses to allow the engine to store new corpses at runtime. "Fixed" means that those corpses are never overwritten/deleted at runtime, all new corpses are stored after the "fixed" ones. This means that "fixed" <= "used" <= "capacity".
- Bones
- Here is one of the few places where the bone count 19 is apparently hardcoded.
- I.e., custom characters with weird bone counts won't work. See, e.g., TRIA
- What's in a bone?
- The transformation matrix (3D rotation/scale/shear/mirror and translation)
- can be seen as four 3D vectors X, Y, Z, and R in world space.
- If a bone mesh has a vertex at (x, y, z) in its native coordinates,
- then the actual position of that vertex in the level will be R + x X + y Y + z Z
- That's the transformation defined by the 3x4 transform matrix.
Reminder : the 2nd coordinate of X, Y, Z, and R is the height.
- Authoring
- The script command make_corpse(filename) creates a separate corpse file in the Oni folder. The pose of this corpse is taken from the player character (the Dev Mode shortcut Ctrl+F7, "Play dead", would have come in handy here). The format is roughly as above. The contents of the files thus created can then be inserted as elements in a level's CRSA.
ONI BINARY DATA |
---|
CONS << Other file types >> DOOR |
CRSA : Corpse Array |
Level file |