Game Engine Architecture

(Ben Green) #1
573

((look-tree base-clip look-lr-clip look-ud-clip)
;; This means "whenever the compiler sees
;; code of the form (look-tree b lr ud),
;; replace it with the following code..."
(anim-node-additive
(anim-node-additive
(anim-node-clip base-clip)
(anim-node-clip look-lr-clip)
)
(anim-node-clip look-ud-clip)
)
)
)
)

The original “move-b-to-f” state could then be redefi ned in terms of this
macro as follows:


(define-state complex
:name "move-b-to-f"
:tree
(anim-node-lerp
(look-tree "move-f"
"move-f-look-lr"
"move-f-look-ud")
(look-tree "move-b"
"move-b-look-lr"
"move-b-look-ud")
)
)

The (look-tree ...) macro can be used to defi ne any number of states that
require this same basic tree structure but want diff erent animation clips as
inputs. They can also combine their “look trees” in any number of ways.


Rapid Iteration


Rapid iteration is achieved in Uncharted with the help of two important tools.
An in-game animation viewer allows a character to be spawned into the game
and its animations controlled via an in-game menu. And a simple command-
line tool allows animation scripts to be recompiled and reloaded into the run-
ning game on the fl y. To tweak a character’s animations, the user can make
changes to the text fi le containing the animation state specifi cations, quick-
ly reload the animation states, and immediately see the eff ects of his or her
changes on an animating character in the game.


11.11. Action State Machines

Free download pdf