Dynamic Stealth

Dynamic Stealth

327k Downloads

Some mobs are adding too much AI tasks, according to Performant

SettingDust opened this issue ยท 1 comments

commented
[16:00:36] [Server thread/WARN] [com.performant.coremod.Performant]: Tried to add over 100 AI tasks, pausing ai and aborting
java.lang.Exception: null
	at com.performant.coremod.entity.ai.CustomGoalSelector.addTask(CustomGoalSelector.java:144) [CustomGoalSelector.class:?]
	at com.fantasticsource.dynamicstealth.DynamicStealth.addTasks(DynamicStealth.java:854) [DynamicStealth.class:?]
	at com.fantasticsource.dynamicstealth.DynamicStealth.livingJoinWorld(DynamicStealth.java:740) [DynamicStealth.class:?]
	at com.fantasticsource.dynamicstealth.compat.CompatCNPC.updateCNPC(CompatCNPC.java:25) [CompatCNPC.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1552_CompatCNPC_updateCNPC_LivingUpdateEvent.invoke(.dynamic) [?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?]
	at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:581) [ForgeHooks.class:14.23.5.2854]
	at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:2095) [vp.class:?]
	at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:377) [vq.class:?]
	at noppes.npcs.entity.EntityNPCInterface.onUpdate(EntityNPCInterface.java:297) [EntityNPCInterface.class:?]
	at noppes.npcs.entity.EntityCustomNpc.onUpdate(EntityCustomNpc.java:50) [EntityCustomNpc.class:?]
	at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:1996) [amu.class:?]
	at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:832) [oo.class:?]
	at net.minecraft.world.World.updateEntity(World.java:1958) [amu.class:?]
	at net.minecraft.world.World.redirect$zbp000$updateEntity(World.java:4623) [amu.class:?]
	at net.minecraft.world.World.updateEntities(World.java:1762) [amu.class:?]
	at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:613) [oo.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:767) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:279) [chd.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_231]
commented

This happens with only CNPCs and Performant installed as well (albeit with a different stacktrace ofc)

Ie. the root issue lies in one of those 2 mods, and not in DS

My best guess is that Performant is counting AI task additions on each particular mob, but not AI task removals. CNPCs, unlike most mobs, have a lot of AI task removal and addition going on under normal circumstances, so I can see how that number would add up if they're not properly accounting for removals.

I checked the AI task list of a CNPC both before and after Performant started spamming the error, and at no point did the CNPC have more than 10~15 AI tasks total (there are 2 task lists per mob, both were checked).

Ie. the root issue lies almost certainly in Performant. I suggest posting an issue on their issue tracker and referencing this issue to share the info from it.