Lag spike when switching Animations in a Animator component #10

Closed
opened 2023-11-12 20:00:44 -06:00 by Nytra · 6 comments
Nytra commented 2023-11-12 20:00:44 -06:00 (Migrated from github.com)

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:

  1. Spawn the item in the public folder
  2. Find the unpacked ProtoFlux
  3. Click the Call button and observe a lag spike each time you click. This button switches the Animation. The lag spike does not happen if you uninstall CherryPick.

This happens with other animated SkinnedMeshRenderers too, not just this example one.

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: 1) Spawn the item in the public folder 2) Find the unpacked ProtoFlux 3) Click the Call button and observe a lag spike each time you click. This button switches the Animation. The lag spike does not happen if you uninstall CherryPick. This happens with other animated SkinnedMeshRenderers too, not just this example one.
Nytra commented 2023-11-12 20:03:02 -06:00 (Migrated from github.com)
Log file: [DESKTOP-H976HO2 - 2023.11.11.1231 - 2023-11-13 01_49_24.log](https://github.com/RileyGuy/CherryPick/files/13330049/DESKTOP-H976HO2.-.2023.11.11.1231.-.2023-11-13.01_49_24.log)
BlueCyro commented 2024-01-28 21:17:52 -06:00 (Migrated from github.com)

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.

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.
Nytra commented 2024-01-29 11:34:01 -06:00 (Migrated from github.com)

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.

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.
hazre commented 2024-02-29 22:42:32 -06:00 (Migrated from github.com)

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.

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.
BlueCyro commented 2024-06-30 22:29:35 -05:00 (Migrated from github.com)

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.

Hey fellas, I've made a supplementary mod that fixes this issue. If you wanna go grab [Effortless Efficiency](https://github.com/BlueCyro/EffortlessEfficiency), 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.
Nytra commented 2024-08-01 00:25:21 -05:00 (Migrated from github.com)

Interestingly this issue just got created in the main resonite repo https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2699

Interestingly this issue just got created in the main resonite repo https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2699
cyro closed this issue 2025-08-21 00:33:51 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: cyro/CherryPick#10
No description provided.