Naughty dog engine uses Scheme script to define state machines
(define-state complex
:name "move-b-to-f"
:tree
(anim-node-lerp
(anim-node-additive
(anim-node-additive
(anim-node-clip "move-f")
(anim-node-clip "move-f-look-lr")
(anim-node-clip "move-f-look-ud")
)
(anim-node-additive
(anim-node-additive
(anim-node-clip "move-b")
(anim-node-clip "move-b-look-lr")
)
(anim-node-clip "move-b-look-ud")
)
)
Transition matrix: represents the valid states that can be transitioned between (e.g. walk to run is a valid transition)
In Medal of Honor: Pacific Assault, the matrix was represented via wildcard naming
<transitions>
<!-- global default -->
<trans from="\*" to="\*" type=frozen duration=0.2>
<!-- default for any walk to any run -->
<trans from="walk\*" to="run\*" type=smooth duration=0.15>
<!-- special handling from any prone to any getting-up
-- action (only valid from 2 sec to 7.5 sec on the
-- local timeline) -->
<trans from="\*prone" to="\*get-up" type=smooth duration=0.1 window-start=2.0 window-end=7.5>
...
</transitions>
Uncharted/Naughty Dog Used Scheme definitions:
(define-state complex
:name "s_turret-idle"
:tree (aim-tree
(anim-node-clip "turret-aim-all--base")
"turret-aim-all--left-right"
"turret-aim-all--up-down"
)
:transitions (
(transition "reload" "s_turret-reload"
(range - -) :fade-time 0.2)
(transition "step-left" "s_turret-step-left"
(range - -) :fade-time 0.2)
(transition "step-right" "s_turret-step-right"
(range - -) :fade-time 0.2)
(transition "fire" "s_turret-fire"
(range - -) :fade-time 0.1)
(transition-group "combat-gunout-idle^move")
(transition-end "s_turret-idle")
)
)