Electroblob's Wizardry

Electroblob's Wizardry

18M Downloads

Performance issues when rendering player model likely due to RenderPlayerEvent

laundmo opened this issue ยท 9 comments

commented

Minecraft version: 1.12.2
Wizardry version: 4.3.2
Environment: Server

Issue details: When looking at other Players (or rendering the own player model in the inventory) in multiplayer, there are very noticeable performance drops. The other player did not seem to have anything wizardry related equipped or applied to them. It seems this issue only appears after a while, though we have not yet figured out what the conditions are.

the same issue also happens when looking at the own character in the inventory screen, making just opening the inventory lag a lot.

Note: i have not tested on newer versions, as this is the version included in the modpack. The issue appears with or without optifine.

the following is a screenshot of the LagGoggles result when profiling FPS:
image

sbfyCX3BoT_compressed.mp4

Other mods involved: modpack curseforge, modpack index (searchable)

commented

I used Jprofiler to see what exactly the issue is, it seems to be PlayerAnimator.onRenderPlayerPostEvent
image
image

commented

I seem to have found a workaround, you can set B:spellcastingAnimations=true to false in the ebwizardry.cfg Client section. This disables the animations that are causing the issues.

commented

Yes, disabling that option would be my suggestion for now, but obviously you'll lose the animations feature.

I'm guessing one (or more) of the other mods you have installed is adding a lot of player models or layers. Could you post a mod list?

commented

@Electroblob77 i already linked a mod list at the bottom of my original post, but here you go again: https://www.modpackindex.com/modpack/6258/all-the-mods-3-remix-atm3r

commented

Oh my apologies, I didn't see that. Thanks anyway!

commented

regarding #648

there does not seem to be a noticeable memory leak, even with the spellcast animations enabled. I would have noticed if there was one during profiling.

commented

Are you sure? The reason I ask is that there really isn't anything else in that method that could cause it to take up all that processing time:

@SubscribeEvent
public static void onRenderPlayerPostEvent(RenderPlayerEvent.Post event){
if(!areAnimationsEnabled()) return;
List<ModelBiped> models = playerLayerModels.get(event.getRenderer());
if(models != null){
for(ModelBiped model : models){
for(ModelRenderer box : model.boxList){ // For ModelPlayer, this will include the second layer
// Some models have extra boxes, they (probably) don't need wrapping but we need this check!
if(box instanceof ModelRendererExtended){
((ModelRendererExtended)box).resetRotation();
}
}
}
}
}

Unless the JProfiler readout is including time spent in any methods called within PlayerAnimator#onRenderPlayerPostEvent, in which case can you expand the first entry so I can see what's going on inside?

commented

I'm sorry, i made the mistake of not saving the snapshot. And making a new one is going to be hard since i had to disable this mod entirely due to a server crash related to EntityRemnant causing ticks longer than 60 seconds.

All i can say is that i was keeping an eye on the memory usage due to prior issues with my jvm GC arguments, and it did not reach the allocation or the InitiatingHeapOccupancyPercent of 70%.

commented

Okay, what I'll do for now is fix issue 648, then when I release the fix you can test it and see if your issue still occurs.

Any chance you could report the EntityRemnant crash as a separate issue if you still have it? I can take a look at that as well while I'm at it.