bonsaistudi0s / Enderman-Overhaul

Enderman Overhaul adds over 20 new endermen variants, each with their own sounds, models, and animations!
https://modrinth.com/mod/enderman-overhaul
13 stars 13 forks source link

[Bug]: Cave Enderman potentially causing high TPS #35

Open Brother-Blue opened 8 months ago

Brother-Blue commented 8 months ago

Bug Description

I've been investigating this on my ATM9 server, and have opened a ticket there as well in case it is something with their pack configurations. https://github.com/AllTheMods/ATM-9/issues/1148

As I mentioned in that issue, cave enderman seem to be contributing a good chunk to TPS issues, even if it's just me on the server and in a dimension without any caves.

Currently experiencing this on ATM9 v0.2.33 and has been that way since v0.2.28. I'm not certain about the mod version but I can find this out later today.

How to Reproduce?

  1. Spin up an ATM9 server
  2. Run the spark profiler, I gave mine a 2 minute timeout

Expected Behavior

No response

Version

-

Mod Loader Version

-

Mod Loader

Forge

Logs or additional context

No response

Code of Conduct

AlexNijjar commented 8 months ago

Interesting. The cave enderman doesn't do anything special compared to all the other enderman. The only additional thing it does is check if it's under the sun every 10 ticks, but that shouldn't cost much at all. And BaseEnderman.tick() is just the normal enderman tick, so nothing is happening there. I'm wondering if it's just a quantity issue. I've had a report that the cave enderman are spawning a lot, so there may just be a lot of them in your world. I'm going to reduce their spawns in the next update. Let me know if that fixes it. Thanks.

Brother-Blue commented 8 months ago

Thank you for the update, I'll keep an eye out for when the modpack pulls the latest updates and get back to you :)

Armandorev commented 6 months ago

Im suffering the same, my server was running fine but after some weeks it became very laggy, and spak gave me this

"net.minecraft.server.level.ServerLevel$$Lambda$37553.0x0000000804781038.accept()47.76% net.minecraft.server.level.ServerLevel.tickNonPassenger()47.76% tech.alexnijjar.endermanoverhaul.common.entities.CaveEnderman.tick()14.95%"

Cave enderman seems to take 15% of the ticks

AlexNijjar commented 6 months ago

send the full spark profile link

VasherMC commented 6 months ago

I've had lag due to significant numbers of mushroom endermen due to them spawning in a modded fungal cave biome with many mushrooms and dirt blocks, where they can easily pick up a block. (I was on version 1.0.2 of the mod, before the spawns were lowered, and had over 250 mushroom endermen). Since endermen that are holding a block don't despawn and don't count towards the mob cap, they can accumulate significantly over time. In addition, they teleported away (and accumulated near the surface), which I think let more of them spawn even with the spawn cost/spawn potential mechanic.

Given that Cave Endermen can pick up blocks in the "#minecraft:base_stone_overworld" tag, ie almost all blocks inside caves, maybe they have a similar issue? Alternatively, the issue may be that the Enderman AI tries to do something for all nearby blocks that it can pick up, which in this case could be a lot of blocks.

Either way I would suggest trying to remove "#minecraft:base_stone_overworld" from the endermanoverhaul/tags/blocks/cave_enderman_holdable.json tag (maybe via datapack) and see if it helps performance.

eydrien-dev commented 5 months ago

I'm also experiencing this.

brave_UVMSosggKY

The reason why neruina is working hard is because of cave enderman as shown in the screenshot (neruina is a mod to take care of ticking entities to kill them if needed) and then it shows the enderman overhaul as the second thread.

I've seen theres a new version 1.0.4 of enderman overhaul, which says to reduce spawns of cave endermans, I will try it and see if this helps.