Руководство по графу анимаций/Случайные движения с атрибутом ForceFollow

Материал из CryWiki Russia

Перейти к: навигация, поиск
Эта страница страница помечена как находящиеся в процессе перевода.


Randomized motion with 'ForceFollow' links

This tutorial, will demonstrate how to create an animation graph for motion randomization. For that, we'll use the 'ForceFollow' attribute of links.

  • Create a new view and new states.

CryEngine AGT RandomizedMotion agtutor2 view states.png

The 'FooRandomGate' state is a gate state which forwards the current state to one of linked states when selected.
Other states are just sample animation states for randomization.
  • Set up inputs for testing.

CryEngine AGT RandomizedMotion agtutor2 input.png

We use the Stance input in this tutorial again.

  • Set up the states as follows
  • FooRandomGate

CryEngine AGT RandomizedMotion agtutor2 foorandomgate.png

We use just the Default template because we don't need any animation for this state. Set the 'Stance' criterion to test_random.

  • FooSample0

CryEngine AGT RandomizedMotion agtutor2 foosample0.png

It's a force-followed state. So it doesn't need the 'Allow selection' check.

  • We use the template, 'IdleOneShot'.
  • FooSample1
  • Same above except with a different animation string.
For this, you can use the clone utility.

CryEngine AGT RandomizedMotion agtutor2 clone util.png

  • FooSample2
  • Same above except with a different animation string.
  • Link the states as follows

CryEngine AGT RandomizedMotion agtutor2 links.png

  • Edit the 'ForceFollow' attributes

right-click the dot in the middle of link curve, then a popup shows as follows.
CryEngine AGT RandomizedMotion agtutor2 link edit.png

Set the Force follow chance to 1 for all 3 links. Then all 3 states have the same chance of forwarded.
CryEngine AGT RandomizedMotion agtutor2 forcefollow prop.png

  • After editing, you can see a small digit right beside the dot of the link shows the value of it as follows.

CryEngine AGT RandomizedMotion agtutor2 forcefollow tips.png

Test it using 'ag_' commands

CryEngine AGT RandomizedMotion agtutor2 check result.png

Push 'AI/Physics' button to enable the AI. 'ag_debug _target_name_' 'ag_stance test_random' You can see 3 animations are randomly played* repeatedly.