OBD:TRAM: Difference between revisions

6,013 bytes added ,  22 November 2022
first dump of PS2 TRAM; will follow up with TREX
m (Fixing 'motion blur part' table string. It was not aligned to left correctly.)
(first dump of PS2 TRAM; will follow up with TREX)
Line 142: Line 142:
{{OBDtr| 0x160 | int16    |EEDDFF| 06 00      | 6          | compression size }}
{{OBDtr| 0x160 | int16    |EEDDFF| 06 00      | 6          | compression size }}
{{OBDtr| 0x162 | int16    |EEDDFF| 16 00      | 22          | animation type (from anim_types.[[OBD:StNA|StNA]]) }}
{{OBDtr| 0x162 | int16    |EEDDFF| 16 00      | 22          | animation type (from anim_types.[[OBD:StNA|StNA]]) }}
{{OBDtr| 0x164 | int16    |C5FF8A| 16 00      | 6          | aiming type }}
{{OBDtr| 0x164 | int16    |C5FF8A| 16 00      | 22          | aiming type }}
{{OBDtr| 0x166 | int16    |C5FF8A| 00 00      | 0          | from state }}
{{OBDtr| 0x166 | int16    |C5FF8A| 00 00      | 0          | from state }}
{{OBDtr| 0x168 | int16    |C0C0C0| 07 00      | 7          | to state }}
{{OBDtr| 0x168 | int16    |C0C0C0| 07 00      | 7          | to state }}
Line 173: Line 173:
{{OBDtr| 0x186 | uint8    |00D900| 02          | 2          | number of elements in the footstep part }}
{{OBDtr| 0x186 | uint8    |00D900| 02          | 2          | number of elements in the footstep part }}
{{OBDtr| 0x187 | uint8    |00D900| 04          | 4          | number of elements in the particle part }}
{{OBDtr| 0x187 | uint8    |00D900| 04          | 4          | number of elements in the particle part }}
{{OBDtr| 0x188 | char[24] |CACAFF| AD DE      | dead        | unused }}
{{OBDtr| 0x188 | char[24] |CACAFF| AD DE      | dead        | unused (not part of the template) }}
|}
|}


Line 232: Line 232:


For an animation that has a keyframe for every bone at each game tick, a 518-frame duration corresponds to 8.6<span style="text-decoration:overline;">3</span> seconds, whereas 213 frames = 3.55 seconds. Typically, however, rotation tracks will have significant keyframe reduction, e.g., Konoko's "Rising Fury!" lasts 80 frames but the pelvis rotation has only 23 keyframe intervals. Assuming 4:1 keyframe reduction for typical animations, this means that the 16-bit offset won't be an issue (for size-6 animations) unless the animation is longer than about 30 seconds.
For an animation that has a keyframe for every bone at each game tick, a 518-frame duration corresponds to 8.6<span style="text-decoration:overline;">3</span> seconds, whereas 213 frames = 3.55 seconds. Typically, however, rotation tracks will have significant keyframe reduction, e.g., Konoko's "Rising Fury!" lasts 80 frames but the pelvis rotation has only 23 keyframe intervals. Assuming 4:1 keyframe reduction for typical animations, this means that the 16-bit offset won't be an issue (for size-6 animations) unless the animation is longer than about 30 seconds.
==PS2 implementation==
The PS2 implementation optimizes TRAM storage by splitting off combat-relevant data (extents etc) to a new instance type, TREX (Totoro Animation Extra, see below). As a result, the TRAM size (with header) is reduced from 392 to 80 bytes.
{|cellpadding=3 cellspacing=0 style="line-height:13px"
{{HexRow|0x00|
|01|C8|03|00|01|00|00|00|01|45|06|00|00|00|00|00|
|FF|FF|FF|FF|FF|FF|FF|FF|00|00|00|00|FF|FF|FF|FF|
|00|00|00|00|FF|FF|FF|FF|FF|FF|FF|FF|C8|C8|C8|C8|
|00|00|00|00|00|00|00|00|00|00|00|00|C8|C8|C8|C8|
|°È°°°°°°°E°°°°°°
}}
{{HexRow|0x10|
|E0|EE|0F|00|20|F0|0F|00|80|F4|0F|00|A0|F4|0F|00|
|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|
|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|
|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|
|àî°° ð°° ô°° ô°°
}}
{{HexRow|0x20|
|C0|F4|0F|00|40|F7|0F|00|90|00|08|00|00|00|00|00|
|FF|FF|FF|FF|FF|FF|FF|FF|C8|C8|C8|C8|FF|FF|FF|FF|
|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|C8|C8|C8|C8|
|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|C8|FF|FF|FF|FF|
|Àô°°@÷°° °°°°°°°
}}
{{HexRow|0x30|
|00|00|00|00|01|00|00|00|06|00|16|00|16|00|00|00|
|FF|FF|FF|FF|FF|FF|FF|FF|EE|EE|EE|EE|C5|C5|C5|C5|
|C8|C8|C8|C8|00|00|00|00|DD|DD|DD|DD|FF|FF|FF|FF|
|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|8A|8A|8A|8A|
|°°°°°°°°°°°°°°°°
}}
{{HexRow|0x40|
|07|00|50|00|00|02|AD|DE|00|00|FF|FF|00|01|02|13|
|C0|C0|FF|FF|FF|FF|FF|FF|71|71|71|71|FF|FF|00|C0|
|C0|C0|00|00|FF|FF|FF|FF|FF|FF|FF|FF|AA|AA|D9|C0|
|C0|C0|80|80|A6|A6|A6|A6|B8|B8|B8|B8|82|82|00|C0|
|°°P°°°-Þ°°ÿÿ°°°°
}}
{{HexRow|0x50|
|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|AD|DE|
|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|
|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|CA|
|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|FF|
|-Þ-Þ-Þ-Þ-Þ-Þ-Þ-Þ
}}
|}
{{Table}}
{{OBDth}}
{{OBDtr| 0x000 | res_id  |FF0000| 01 C8 03 00 | 968        | 00968-KONCOMpunch_heavy.TRAM }}
{{OBDtr| 0x004 | lev_id  |FFFF00| 01 00 00 00 | 0          | level 0 }}
{{OBDtr| 0x008 | link    |00FF00| 01 45 06 00 | 1605        | link to 01605-.TREX (combat-relevant data) }}
{{OBDtr| 0x00C | int32    |FFC8C8| 00 00 00 00 | 0          | runtime only; pointer to animation name }}
{{OBDtr| 0x010 | offset  |FFFFC8| E0 EE 0F 00 | 0x000FEEE0  | .raw-address of the [[OBD:TRAM/raw0x0C|height]] track (Y-position of the pelvis above the root) }} <<<<< yes
{{OBDtr| 0x014 | offset  |FFFFC8| 20 F0 0F 00 | 0x000FF020  | .raw-address of the [[OBD:TRAM/raw0x10|horizontal velocities]] of the character root }}              <<<< yes
{{OBDtr| 0x018 | offset  |FFFFC8| 80 F4 0F 00 | 0x000FF480  | .raw-address of the [[OBD:TRAM/raw0x20|shortcut data]] }}                                            <<<< yes
{{OBDtr| 0x01C | offset  |FFFFC8| A0 F4 0F 00 | 0x000FF4A0  | .raw-address of the [[OBD:TRAM/raw0x28|footstep data]] }}                                            <<<< yes
{{OBDtr| 0x020 | offset  |FFFFC8| C0 F4 0F 00 | 0x000FF4C0  | .raw-address of the [[OBD:TRAM/raw0x30|position data]] (for basic prediction) )}}                  <<<< yes
{{OBDtr| 0x024 | offset  |FFFFC8| 40 F7 0F 00 | 0x000FF740  | .raw-address of the [[OBD:TRAM/raw0x34|rotations]] (of all body parts) }}                            <<<< yes
{{OBDtr| 0x028 | bitset32 |C8FFC8| 90 00 08 00 | attack, atomic, dontAim| flags (same as PC/Mac 0x03C) }}
{{OBDtr| 0x02C | bitset32 |FFC8FF| 00 00 00 00 | 0          | used body parts; used mostly by aiming overlays (same as PC/Mac 0x048) }}
{{OBDtr| 0x030 | bitset32 |FFC8FF| 00 00 00 00 | 0          | replaced parts; used by non-aiming overlays (same as PC/Mac 0x04C) }}
{{OBDtr| 0x034 | int32    |FF00FF| 01 00 00 00 | 1          | unknown }}
{{OBDtr| 0x038 | int16    |EEDDFF| 06 00      | 6          | compression size }}
{{OBDtr| 0x03A | int16    |EEDDFF| 16 00      | 22          | animation type (from anim_types.[[OBD:StNA|StNA]]) }}
{{OBDtr| 0x03C | int16    |C5FF8A| 16 00      | 22          | aiming type }}
{{OBDtr| 0x03E | int16    |C5FF8A| 00 00      | 0          | from state }}
{{OBDtr| 0x040 | int16    |C0C0C0| 07 00      | 7          | to state }}
{{OBDtr| 0x042 | int16    |FF0080| 50 00      | 80          | number of frames (frame rate hardcoded at 60 Hz) }}
{{OBDtr| 0x044 | bitset16 |FFFFA6| 00 02      | 0x0200 <nowiki>=</nowiki> COM| variant (same as PC/Mac 0x170) }}
{{OBDtr| 0x046 | char[2]  |FFFFA6| AD DE      | dead        | "varient end"; ignored by the engine }}
{{OBDtr| 0x048 | uint16  |71FFB8| 00 00      | 0          | atomic start }}
{{OBDtr| 0x04A | uint16  |71FFB8| FF FF      | 65535      | atomic end }}
{{OBDtr| 0x04C | uint8    |FFAA82| 00          | 0          | unknown }}
{{OBDtr| 0x04D | uint8    |FFAA82| 01          | 1          | number of elements in the shortcut part }}
{{OBDtr| 0x04E | uint8    |00D900| 02          | 2          | number of elements in the footstep part }}
{{OBDtr| 0x04F | uint8    |C0C0C0| 13          | 19          | number of bodyparts? }}
{{OBDtr| 0x050 | char[16] |CACAFF| AD DE      | dead        | unused (not part of the template) }}
|}
At the time of writing, some of the above data hasn't been confirmed, and the nature of 0x034 and 0x04C is unclear.
<!--
{{OBDtr| 0x04C | uint16  |0000BF| 00 00      | 0          | end interpolation }}
{{OBDtr| 0x04E | uint16  |0000BF| FF FF      | 65535      | maximal interpolation }}
{{OBDtr| 0x17C | uint16  |804040| FF FF      | 65535      | action frame }}
{{OBDtr| 0x018 | offset  |FFFFC8| 80 F4 0F 00 | 0x000FF480  | .raw-address of the [[OBD:TRAM/raw0x14|attack part]] }}
{{OBDtr| 0x01C | offset  |FFFFC8| A0 F4 0F 00 | 0x000FF4A0  | .raw-address of the [[OBD:TRAM/raw0x1C|motion blur part]] }}
{{OBDtr| 0x030 | offset  |FFFFC8| 00 B9 80 00 | 0x0080B900  | .raw-address of the [[OBD:TRAM/raw0x2C|particle data]] (trails, dust, etc.) }}
{{OBDtr| 0x03C | offset  |FFFFC8| 00 00 00 00 | unused      | .raw-address of the [[OBD:TRAM/raw0x38|sound data]] }}
-->


{{OBD_File_Footer | type=TRAM | prev=TRAC | next=TRAS | name=Totoro Animation Sequence | family=Character}}
{{OBD_File_Footer | type=TRAM | prev=TRAC | next=TRAS | name=Totoro Animation Sequence | family=Character}}


{{OBD}}
{{OBD}}