Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized Anim Graph by enabling Fast Path #37

Merged
merged 4 commits into from
Aug 9, 2020

Conversation

AHGS-Jens
Copy link
Contributor

Anim Graph uses fast path instead of running blueprit logic if it is able to access variables directly. So in order to enable this I made wrappers for the enums used by the Anim Graph that updates bool values for each state of the enum that can be used to check if it is in a specific state.

In addition some structs was brought out of the Grounded and AimingValues structs. as Fast Track does not work when accessing structs within structs.

The net effect of this should be improved performance which I tried to measure using stat anim with 25 character constantly running around.

Getting accurate numbers is a bit difficult as performance seem to fluctuate quite a bit, but some of the gains are considerable enough that it certainly isn't down to margin of error.

Before ms After ms Difference ms Percent change
PerformAnimEval 11,10 10,39 -0,71 -6,40%
ComponentAnimEval 7,09 6,91 -0,18 -2,54%
EvaluateAnimInst 7,00 6,81 -0,19 -2,71%
EvaluateAnimGraph 6,99 6,81 -0,18 -2,58%
BlendPosesInGraph 6,97 6,78 -0,19 -2,73%
ProxyUpdate 3,51 2,97 -0,54 -15,38%
EvaluateAnimState 3,34 3,21 -0,13 -3,89%
StateMachineUpdate 2,11 1,64 -0,47 -22,27%
AnimGameThreadTime 2,11 2,1 -0,01 -0,47%
AnimDecompression 1,85 1,8 -0,05 -2,70%
AnimSeqGetBonePose 1,67 1,71 0,04 2,40%
BlendSpaceGetAnimPose 1,70 1,61 -0,09 -5,29%
PostAnimEval 1,17 1,14 -0,03 -2,56%
ExtractPoseFromAnim 1,17 1,13 -0,04 -3,42%
StateMachineFindTrans 1,12 0,95 -0,17 -15,18%
SkinnedMeshCompTick 0,94 0,97 0,03 3,19%
(N) LocomotionCycles 0,79 0,48 -0,31 -39,24%
UpdateKinematicBones 0,92 0,71 -0,21 -22,83%
AimOffset 0,63 0,64 0,01 1,59%
AnimTickTime 0,67 0,65 -0,02 -2,99%
BlendPosesPerBone 0,62 0,63 0,01 1,61%
UpdateAnimation 0,66 0,64 -0,02 -3,03%
NativeUpdateAnimation 0,56 0,52 -0,04 -7,14%
UpdateRBJointsMotors 0,47 0,51 0,04 8,51%

AHGS-Jens and others added 3 commits July 26, 2020 01:51
… the AnimGraph.

- Moved structs used by AnimGraphs out of the big structs as Fast Path only work when accessing variables on the base struct, structs within structs does not work.
@dyanikoglu
Copy link
Member

dyanikoglu commented Aug 4, 2020

That was something I did in my private repo, but didn't have enough time to migrate it here. I will review your code and probably merge it this weekend. Sorry for the delay, and thanks for the contribution!

@dyanikoglu
Copy link
Member

@AHGS-Jens Everything looks fine to me, can you solve the merge-conflict before I can merge this?

# Conflicts:
#	Source/ALSV4_CPP/Private/Character/Animation/ALSCharacterAnimInstance.cpp
@AHGS-Jens
Copy link
Contributor Author

Resolved the conflict and gave it a spin in the demo level, seems to work fine, but haven't done any further testing than that.

@dyanikoglu dyanikoglu merged commit 66c65b2 into ShadowfallStudios:master Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants