Animation playback speed: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(New page: In TDM, you can change the speed at which an animation plays on an entity just by setting a spawnarg on that entity. The spawnarg to change is <tt>anim_rate_X</tt>, where X is an animation...)
 
(One way to work around a problem caused by slow walk speed)
Line 1: Line 1:
In TDM, you can change the speed at which an animation plays on an entity just by setting a spawnarg on that entity. The spawnarg to change is <tt>anim_rate_X</tt>, where X is an animation name. The value of the spawnarg is the value to multiply the animation's speed by; 1.0 means no change, 0.5 means half speed, and so on.
In TDM, you can change the speed at which an animation plays on an entity just by setting a spawnarg on that entity. The spawnarg to change is <tt>anim_rate_X</tt>, where X is an animation name. The animation's speed is multiplied by the spawnarg's value; 1.0 means no change, 0.5 means half speed, 2.0 means double speed, and so on.


For example, this spawnarg setting would cause the entity to walk at 95% of the usual speed:
For example, this spawnarg setting would cause the entity to walk at 95% of the usual speed:
Line 9: Line 9:
==Caveats==
==Caveats==


* The speed of the walk animation appears to have an effect on how easily AI can climb stairs (and presumably slopes as well). The slower the walk animation is, the lower the stair has to be before the AI will be able to climb it. So don't set the walk animation rate too low.
* The speed of the walk animation appears to have an effect on how easily AI can climb stairs (and presumably slopes as well). The slower the walk animation is, the lower the stair has to be before the AI will be able to climb it. So don't set the walk animation rate too low. You could also try to work around this using [[Pathfinding#Steep_Steps.2C_Slopes.2C_and_Extreme_Pathfinding.21|extreme pathfinding]].
* Walk speed is '''crucial''' for game balance. It is very difficult to blackjack or backstab an AI that walks faster than the player can move without alerting it! So don't set the walk animation rate too high either.
* Walk speed is '''crucial''' for game balance. It is very difficult to blackjack or backstab an AI that walks faster than the player can move without alerting it! So don't set the walk animation rate too high either.
* If the animation itself has a setRate frame command (which accomplishes the same effect as this spawnarg) in the modelDef where it's defined, then the frame command will '''override''' this spawnarg.
* If the animation itself has a setRate frame command (which accomplishes the same effect as this spawnarg) in the modelDef where it's defined, then the frame command will '''override''' this spawnarg.


[[Category:Animation]]
[[Category:Animation]]

Revision as of 10:29, 3 September 2007

In TDM, you can change the speed at which an animation plays on an entity just by setting a spawnarg on that entity. The spawnarg to change is anim_rate_X, where X is an animation name. The animation's speed is multiplied by the spawnarg's value; 1.0 means no change, 0.5 means half speed, 2.0 means double speed, and so on.

For example, this spawnarg setting would cause the entity to walk at 95% of the usual speed:

"anim_rate_walk" "0.95"

You can use this to give different walk speeds to individual AIs, or to tweak the walk speed for entire classes of AI.

Caveats

  • The speed of the walk animation appears to have an effect on how easily AI can climb stairs (and presumably slopes as well). The slower the walk animation is, the lower the stair has to be before the AI will be able to climb it. So don't set the walk animation rate too low. You could also try to work around this using extreme pathfinding.
  • Walk speed is crucial for game balance. It is very difficult to blackjack or backstab an AI that walks faster than the player can move without alerting it! So don't set the walk animation rate too high either.
  • If the animation itself has a setRate frame command (which accomplishes the same effect as this spawnarg) in the modelDef where it's defined, then the frame command will override this spawnarg.