Appendix: Fuzzy Matching
The animation system uses a semantic based system to request the best animation for a given situation. Animation Tokens are put together to form Animation Names, and when an animation is requested in game, the Fuzzy Match system will use a model's animation that is the closest match for the given request. This allows an animator to incrementally refine the animation quality for an in-game model by providing more and more specific animations, or allows a model with relatively few animations to still function in game.
Rules
-
The first token is required.
To ensure that only contextually proper animations are used, the first token is used to define the most important part of the animation. If the first token cannot be found, no animation is used, rather than playing a potentially incorrect animation.
-
In Art, token order does not matter.
Two animations with the same tokens, but in different orders, will always evaluate exactly the same to the fuzzy match system. The only way to improve matching is to provide more specific tokens in the animation name. It is worth noting that order may still matter for the Animation Priority system.
-
In Data, token order denotes the relative importance.
An Animation with a match on an earlier token will always be favored over any number of matches on later tokens. This lets the caller guarantee they get the animations closest to their intentions, while still being able to request animations with the right flavor if they exist.
-
Tokens in the Animation Name, but not in the request, are less favored.
Every token in an animation name but not in the query adds weight against using that animation. This results in the system favoring shorter, generic animations, over longer names that are generally some other, more specific animation.
Examples
Below are examples, where the header item is the animation requested from the game, and the subsequent animations are those provided by the model. The emphasized Animation Name indicates the best match according to the Fuzzy Match system.
Stand Cover Ready
- Stand Cover
- Stand Cover Ready
Here, both animations are good matches, but Stand Cover Ready is a more exact match.
Stand Cover Ready
- Stand Cover
- Stand Cover Talk
The shorter animation name is favored here, because the Talk token is a mismatch.
Stand Talk Ready
- Stand Ready
- Stand Talk
Talk is earlier in the query, and therefore more important than Ready, so the animation that provides Talk is used.
Stand Angry Talk
- Stand Cover Ready Fidget
- Angry Talk
Because the first token, Stand is required, the system will not use the seemingly good match, Angry Talk, even though the only other option has fewer matching tokens and more mismatching tokens
Stand Talk Cover Ready Fidget
- Stand Cover Ready Fidget
- Stand Talk
Even though the first animation has a higher number of matches, Talk is still a more important token than any of them. As such, the animation that provides it will be used.
Stand Cover Ready
- Stand Cover
- Stand Cover 01
Both animations score equally, because Stand Cover implicitly has the variation token 00. Because the two animations are equivalent except for the variation tokens, the engine will choose one at random every time it needs to play an animation.
Stand Talk
- Stand Ready Talk
- Stand Cover Talk
In this case, both animations satisfy the query equally. One will be chosen arbitrarily, though it will be consistently chosen.