Skip to content

Make default strategy idle animations a bit more random #323

@robojumper

Description

@robojumper

When playing lots of strategy idle animations for many units at the same time, it can be quite noticeable when units are playing the same animation.

A change somewhere around here can help to alleviate that problem for Unit Pawns:

if(AnimTreeController.CanPlayAnimation(PlayAnimParams.AnimName))
{
PlayAnimParams.BlendTime = 0.5f;
PlayAnimParams.Looping = true;
PlayAnimParams.PlayRate = class'XComIdleAnimationStateMachine'.static.GetNextIdleRate();
AnimTreeController.PlayFullBodyDynamicAnim(PlayAnimParams);
}

if(AnimTreeController.CanPlayAnimation(PlayAnimParams.AnimName))
{
PlayAnimParams.BlendTime = BlendTime;
PlayAnimParams.Looping = bLooping;
PlayAnimParams.PlayRate = class'XComIdleAnimationStateMachine'.static.GetNextIdleRate();
Sequence = AnimTreeController.PlayFullBodyDynamicAnim(PlayAnimParams);
}

Changes in XComAlienPawn for Gremlins etc. would be nice to have too.


Code pointer: SkeletalMeshComponent (via self.Mesh) has a function FindAnimSequence(Name AnimSeqName) that returns an AnimSequence with a property SequenceLength. Randomize between [0, SequenceLength] and set PlayAnimParams.StartOffsetTime.


Potential pitfall: We may end up skipping crucial Notifies. Restrict the random roll to [0, FirstNotifyTime]?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions