Lag spike when switching Animations in a Animator component #10
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: cyro/CherryPick#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have verified that this problem is caused by this mod by removing all other mods. The lag spike does not happen without this mod installed.
When switching Animations in a Animator component which is driving fields, there will be a lag spike proportional to the number of fields driven by the Animator. In this case I am animating the transforms of bones of a SkinnedMeshRenderer.
Example object is in this public folder:
resrec:///U-Nytra/R-C3B2A0F614BAD990CD52D40125811BEB12FB308A6465BAD37A87C503F79D2077
To reproduce:
This happens with other animated SkinnedMeshRenderers too, not just this example one.
Log file: DESKTOP-H976HO2 - 2023.11.11.1231 - 2023-11-13 01_49_24.log
I took a look and narrowed it down as far as "GetNiceName" from the ReflectionExtensions class in FrooxEngine.
When I disable cherrypick but otherwise call "GetNiceName" for all workers, the issue manifests. This might be highlighting an issue that exists in how the Animator works rather than CherryPick.
There must be some caching going on somewhere on the FrooxEngine side whenever GetNiceName is called. This would explain the hitch whenever the Clip is changed if the Animator is calling something that iterates or otherwise has to touch that cache.
I don't have any more specific leads than that I'm afraid. It's starting to look like this is something outside of my control to fix.
Thanks for looking into it. So it seems like it is not a problem with the mod, but rather the mod is bringing to light a problem that already exists in the base game.
I wonder if it is caused by the version of mono / .NET being used by Resonite.
I just wanted to add that is also happening to me and it makes the game unplayable. So I've removed the mod for now to avoid the lag spikes until this is fixed.
Hey fellas, I've made a supplementary mod that fixes this issue. If you wanna go grab Effortless Efficiency, feel free to give it a shot.
The reason for it being a separate mod is that the issue that CherryPick exacerbates is not actually the fault of CherryPick, but of the runtime itself. These issues could be coaxed into existence by any heavy usage of certain types of reflection, so I felt it prudent to not clutter CherryPick with specific fixes.
Interestingly this issue just got created in the main resonite repo https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2699