8,013
edits
Paradox-01 (talk | contribs) mNo edit summary |
Paradox-01 (talk | contribs) m (the gist of "Decision path of animation lookup") |
||
Line 9: | Line 9: | ||
* Animation data: pelvis heights, pelvis velocities, bone rotations | * Animation data: pelvis heights, pelvis velocities, bone rotations | ||
* Attack data: damage, self-damage, extends (danger zones for AI awareness) and throws | * Attack data: damage, self-damage, extends (danger zones for AI awareness) and throws | ||
The term '''animation''' is often shortened to '''anim''' by modders following the naming of commands in BSL: chr_wait_animstate, chr_wait_animtype, env_anim, etc. | |||
===Decision path of animation lookup=== | |||
* At first the game builds a pool of anims a character can use. They are loaded from the TRAC file registered in ONCC, including parent TRACs. | |||
* Anims from child TRAC override those of the parent if their combination of state, type and variant is excatly the same. | |||
* On the other hand child TRAC often miss some anims. For example elite striker don't have their own run anims, they must and will use the parent anims of normal strikers. The game was here designed to save resources. See [[XML:TRAC|TRAC]] page for details. | |||
* A character possesses always one animation state. This term derives from state machines but you only need to know that states are the first point in the decision path determining what anims are actually allowed to played at a given moment. | |||
* It follows the full decision path: | |||
** anim '''state''' check | |||
** event (user input / engine input for AI) -> context check -> anim '''type''' check | |||
** anim '''variant''' check | |||
** TRAC '''weight''' check | |||
One detailed example: | |||
Let's say we shapeshifted to an ninja ONCC, are in state Standing and hit the action key for taunt. | |||
The engine recognizes the context (an hostile character to interact with) and looks up anims of type Taunt. | |||
Since we are in combat mode the following anim must be of variant Combat if possible. | |||
Those lookups all boile down to two valid anims, NINCOMtaunt1 and NINCOMtaunt2. | |||
If there are multiple anims avaible at this point the engine has to pick one of them randomly. | |||
However, NINCOMtaunt1 has a TRAC Weight (probability) of 100 while NINCOMtaunt2 has a TRAC Weight value is just 5. | |||
Chances are quite high we will not see the Moon Walk taunt. | |||
Keep in mind that if the engine cannot find an anim of a specific variant it will fall back to use the non-variant anim instead. | |||
Confused how Weights work? Apparently, that Weight value is only one factor of the equation - otherwise NINCOMtaunt2 would never execute. | |||
If there is only one anim to chose from, it will always play no matter what Weight, even if it is zero. | |||
As for multiple anim being a valid choice the calculation seems to be this for an individual anim: weight / sum of all weight. | |||
For NINCOMtaunt2 it means 5 / 105 = 0,047 (4,7%). | |||
edits