GTNewHorizons / GT-New-Horizons-Modpack

New Modpack with Gregtech, Thaumcraft and Witchery
https://www.gtnewhorizons.com/
Other
977 stars 299 forks source link

Entity issues causing TPS problems #5522

Closed richardhendricks closed 3 years ago

richardhendricks commented 4 years ago

Vanilla rules are that mobs that spawn holding something can despawn, but they cannot despawn if they pick up an item. Make sure Special Mobs giving pain swords isn't causing this trigger to happen, ie Brutish.

Maybe allow despawning if the item picked up is a common drop, like rotten meat/bones/etc. Or block picking up those items

Also check infernal mobs, especially ultras - maybe something there is preventing despawning?

Another thing to check - make sure SMs are only doing pathfinding if they are in and next to fully loaded chunks - see https://github.com/GTNewHorizons/NewHorizons/issues/5532

Check roguelike spawners - are they properly limited? Seems like they might be spawning entities even though they shouldn't be due to limits on how many are nearby. Pretty sure they ignore player distance when spawning in mobs - perhaps they shouldn't

Check on AMDI or whatever mod it is that limits the number of entities in a single block - maybe that is causing drops that then can be picked up? Give it a special DamageType so that we can track it. Also, when killed by overpopulation, do not donthe dumb explosions. When killed by overpop, do not drop any new drops. Find out how minecraft marks mobs with carried items

Look at adding some commands to display locations of all entities/certain entities/certain dimensions, and display all currently active chunk tickets, and originating spot.

Next release SM will replace all vanilla mobs with "SM" vanilla types. This will let us control their behavior. Need to confirm this does not block TC furious zombies since players will still need their brains.

Look at adding "SM" style breeding animals to prevent players from jamming a huge number in one spot. Only allow breeding if number of animals within 5 blocks is less than 10. Check on if it is collisions or just existing that is lagging out. Do pathing checks so that pathing doesnt occur if player is too far or there are not 3x3 loaded chunks.

Soul brazier in Thaumic Explorations is acting as a permanent world anchor chunkloader. This violates server policy since it cannot be controlled by server owners. Add an option to disable the chunkloader ability and require a server-approved chunkloader.

richardhendricks commented 4 years ago

https://gaming.stackexchange.com/questions/125577/what-are-all-possible-ways-to-stop-a-zombie-from-despawning

richardhendricks commented 4 years ago

Setup the despawn timer in special mobs to force delete mobs that have lived too long?

That might not be great for smeltery ender pearl farms.

ScriptedPiky commented 4 years ago

On Zeta as well, there end up being a huge amount of zombies holding fallen dropped items in caves. Over time, the ones that don't pickup items will despawn as normally. However, the mobs that somehow end-up dying and dropping their rotten flesh or bones will be picked up and cause those mobs to not despawn. I would also look into SpecialMobs and figure out why some of the mobs automatically die without player interference or contact to the sunlight. I've had 100+ zombies all holding items and never despawning as a result on the Zeta test server. 50 of them were in a single small cavern.

If possible, maybe we can add a server command for OP's that just deletes hostile zombies & skeletons that are not named tagged in loaded chunks or have an automated command (can have player votes as well) to get rid of zombies and skeletons in loaded chunks. The other mobs generally do not have this problem like Endermen. Though Pigman can has this issue if left unchecked.

repo-alt commented 4 years ago

It would be seriously inconvenient if the mob might despawn holding your weapon

richardhendricks commented 4 years ago

Yes I agree we need to be super careful on which we despawn. We can have a list of items that do not stop despawning, items like bones/rotten meat/etc should not force a despawn.

I wonder if our entity limits is causing areas with high densities to kill entities, and then they pick up trash items off the ground.

repo-alt commented 4 years ago

I believe that is exactly what happens

richardhendricks commented 4 years ago

@MrWye noticed problems in Epsilon with unknown entites spawning in the void in the End, something to do with a shaft dug all the way down.

richardhendricks commented 4 years ago

@ScriptedPiky Hmm I don't have op privs on Zetatest, I'll have to ask to be added. Can you provide an XZ location for that cave? Is it a dungeon spawner or roguelike? I suspect roguelikes don't properly limit their spawn numbers, I recall seeing a room jammed with Endermen in a roguelike once.

repo-alt commented 4 years ago

"Unknown entities in the void" now that sounds scary

richardhendricks commented 4 years ago

MrWye found this as the source of lag on Eta

https://prnt.sc/r1cul3

https://prnt.sc/r1cuy5

richardhendricks commented 4 years ago

Gregtech, of all things, limits the number of entities in a block. Our current default is 6. if (tEntityCount > this.mMaxEqualEntitiesAtOneSpot) { tEntity.attackEntityFrom(DamageSource.inWall, tEntityCount - this.mMaxEqualEntitiesAtOneSpot); }

richardhendricks commented 4 years ago

OK, looks like EntityLivingBase doesn't really care what caused the death, you get drops no matter what. If an entity has been hit recently by the player, that does give you the rare drops, but that's it.

Instead of damaging the entity when there are too many, perhaps we should just outright delete them.

BlackAce21 commented 4 years ago

@richardhendricks there is a config option in the spigot.yml file as well labeled "max-entity-collisions" if its not already, this should be set to 1 as the default is 8 and its per tick. Can be helpful for situations like the one in that screenshot, although it doesn't negate the problem completely.

richardhendricks commented 4 years ago

Thanks, I pointed Mr Wye and Rizzok at your suggestion!

ScriptedPiky commented 4 years ago

To further discuss on this matter as of version 2.0.8.0. I may of figured some further evidence and assumptions towards this massive problem. All of the hostile mobs shown in these pictures are Infernal mobs holding an item. For some reason, Infernal Mobs, regardless if placed with the Regen prefix, will continue to stay alive for a majority of the time. It is likely that they spawn and potentially ignore being killed or deleted by the server, and as a result, will continue to live until they eventually fill the mob cap. I killed 60+ entities and am now down to a solid 90 entities around my base (at least for one area cleared of mobs). Quite literally there are hundreds of mobs around my base in caves that do not despawn, are infernals, and fill the mob cap & lag the server. 2020-04-03_17 25 30 2020-04-03_17 30 56 2020-04-03_23 18 54 2020-04-03_23 28 54

wlhlm commented 4 years ago

Is this still a problem with the latest 2.0.8.8 release? Infernal Mobs has gotten an update halfway through the 2.0.8.x cycle (in 2.0.8.6).