Easy NPC

Easy NPC

2M Downloads

[Bug] Lag spikes when rendering villager NPCs with Fresh animations installed

DedMaxim opened this issue ยท 5 comments

commented

Describe the bug
As the title says. The only thing to add here is that it happens when the game is not paused. When the game paused and looking at villager NPC, either everything just lags a lot or no lags happen at all. I show all of it in a video demonstration.

To Reproduce

  1. Install specified mods and resource packs.
  2. Spawn Easy NPC villager NPC.
  3. Look at it.
  4. Notice lag spikes.

Expected behavior
Smooth fps

Debugging
latest.log

Is the issue happening in combination with other mods? (If yes, please provide a full list)
Environment:
Windows 10 22H2
Nvidia Driver 551.61
Intel Xeon E5-2680v2
Nvidia GTX 1070
4x8Gb DDR3 ECC REG RAM

Minecraft 1.20.1
Forge 47.2.20
Entity Model Features 1.3
Entity Texture Features 5.2.3
Easy NPC 3.11.0
(Resource Pack) Fresh Animations 1.9

Additional context
Video demonstration
https://www.youtube.com/watch?v=zLosxhCba98

commented

After updating to Easy NPC 4.2.0, the issue is no longer present

commented

Thanks for the report. Unfortunately in this case OptiFine is taking over the rendering and so I'm not really able to investigate the issue more in details.
Furthermore Optifine is closed-source, which mean I could not even look up what they are doing exactly which is causing this lag.

I will check however if there is anything I could do from my side, but I doubt it.

commented

I'm not using Optifine. Features, required by Fresh Animations are handled by Entity Texture Features (ETF) and Entity Model Features (EMF), that I listed in the mod list above.
If I try Optifine instead, Easy NPC villager's model just break completely, failing to use any FA's features (on the left is the regular villager and on the right is Easy NPC's villager):
image
image

commented

Thanks for the update. But this not changing the fact, that some other mods taking over the rendering part like in your case Entity Texture Features (ETF) and Entity Model Features (EMF).

I'm not using any custom renderer or animation library, so if the rendering is causing any lags its nothing I could fix on my side.
Pausing the game, disables all animation, so it's expected that here are less renderer lags.

You could try to use spark with sparkc or something similar to record a client profile.
I haven't found anything in my client profiling, like:

[03] |   |   |   minecraft:villager(176/0) - 5.44%/0.03%
[04] |   |   |   |   unspecified(176/0) - 55.03%/0.02%
[04] |   |   |   |   entityBaseTick(176/0) - 14.61%/0.00%
[04] |   |   |   |   livingEntityBaseTick(176/0) - 7.58%/0.00%
[04] |   |   |   |   push(176/0) - 7.01%/0.00%
[05] |   |   |   |   |   #getEntities 176/0
[04] |   |   |   |   freezing(176/0) - 4.82%/0.00%
[04] |   |   |   |   headTurn(176/0) - 2.94%/0.00%
[04] |   |   |   |   travel(176/0) - 1.99%/0.00%
[04] |   |   |   |   mobBaseTick(176/0) - 1.85%/0.00%
[04] |   |   |   |   ai(176/0) - 1.84%/0.00%
[04] |   |   |   |   looting(176/0) - 1.14%/0.00%
[04] |   |   |   |   rangeChecks(176/0) - 0.63%/0.00%
[04] |   |   |   |   jump(176/0) - 0.55%/0.00%
[03] |   |   |   easy_npc:villager(224/0) - 4.28%/0.03%
[04] |   |   |   |   unspecified(224/0) - 50.27%/0.01%
[04] |   |   |   |   entityBaseTick(224/0) - 12.12%/0.00%
[04] |   |   |   |   push(224/0) - 9.16%/0.00%
[05] |   |   |   |   |   #getEntities 224/0
[04] |   |   |   |   travel(224/0) - 7.71%/0.00%
[04] |   |   |   |   livingEntityBaseTick(224/0) - 7.02%/0.00%
[04] |   |   |   |   freezing(224/0) - 6.53%/0.00%
[04] |   |   |   |   ai(224/0) - 1.80%/0.00%
[04] |   |   |   |   mobBaseTick(224/0) - 1.72%/0.00%
[04] |   |   |   |   headTurn(224/0) - 1.43%/0.00%
[04] |   |   |   |   looting(224/0) - 0.77%/0.00%
[04] |   |   |   |   rangeChecks(224/0) - 0.76%/0.00%
[04] |   |   |   |   jump(224/0) - 0.71%/0.00%

As you could see here the NPC villager use about 4.28% of the client resource, compared to a real villager which is using 5.44%.
So I'm not really able to see why this mod should causing the lag spikes.
However I see some parts which could be optimize to save additional 0.5% - 1% of resource, but not sure if this will help a lot in this specific case.

commented

Hm, I see. I'll pass this issue to EMF/ETF then