Руководство по графу анимаций/Другие советы и «подводные камни»

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

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

Other tips & pitfalls

Which animation graph an Entity is to use is specified at entity level. It is specified in .lua files in "GameScriptsEntities"*.

  • Normally, having separate nodes for 'walk' and 'run' is not recommended if you are using LMGs (Locomotion Manager Groups).

All range-based criteria have a hysteresis* behavior. In other words, even if there is some overlapping in a range, the current state is always favoured. To avoid having to input Action, Item and Stance values all the time manually in 'State Query', you can use the 'preselection' system. You can have a _preselections.xml associated with an AG, *.xml and describe there your pre-selections.

<verbatim><PreselectionLists Filename="AnimationsGraphsfullbody.xml">
 
<Preselection Type="Basics" name="IdleHealthy">
  <Selection Input="Action" value="idle" />
  <Selection Input="Health" value="100" />
  <Selection Input="Item" value="pistol" />
  <Selection Input="Signal" value="none" />
  <Selection Input="Stance" value="nav" />
  <Selection Input="Vehicle" value="none" />
  <Selection Input="waterLevel" value="5.0" />
  <Selection Input="Wound" value="none" />
</Preselection>
 
</PreselectionLists></verbatim>

The combination of a null node and a forcefollow link* is useful to "trick" the state selection. For example, you may want an animation to begin to be loop-played when some input combination is given, but it remains in that state until one of just two inputs in the combination is changed. In other words, changing other inputs in the combination does not stop the animation.

Guarded input: It is a safeguard for the case that you want to make sure a specific input is not ignored. The animation graph has the need to always come up with a state that matches the inputs as closely as possible. If the code sets the inputs and no state matches, it will start ignoring inputs with a lower priority. It's important to note that it absolutely cannot ignore guarded inputs.

CryEngine AGT OtherTipsPitfalls agtutor4 guarded input.png

Structure property : All states with the same structure will be time/phase-aligned when blending. So, in case of walk and run blending, the correct portion of the cycle will be blended in.

CryEngine AGT OtherTipsPitfalls agtutor4 structure prop.png

Which animation graph to use is specified in the entity level. So it is specified in .lua files in "GameScriptsEntities".

Some extra properties don't work in the states with no animiation. The problem is, as you can see in AGSetInput.cpp, the real job of the 'CSetInput' is done in CAGSetInputNode::EnteredState(). But for states with no animation, they never reaches the entered state. So If you want the 'SetInput' to work in those states, you can move the job performed in CAGSetInputNode::EnteredState() to CryEngine_CAGSetInputNode::EnterState(). For example, the 'CAGSound' class was actually implemented as such. AttachmentEffect: You can see available particle effects in DataBase View. It should be a full path to a specific effect. For example, "explosions.rocket.cliff". It has a structure of 'libraryname dot itemname dot effectname'. If you use InStateUntil="0.98"* in the animation graph template, then that state will not be left until the animtion proceeds to the 98% of the whole period. And that template must use LoopAnimation="0". In other words, looping is not compatible with that.