FatherToast / SpecialAI

Adds additional AI patterns to mobs to make the game more challenging. 'Passive' mobs will fight back, monsters will break light sources and wooden doors, some mobs gain random extra abilities, and villages are more... village-y.
8 stars 7 forks source link

[Crash] Incompatibility with Roadrunner Entity Tracking mixins when an entity tracking the player decides to mount something #25

Closed Kaleidio closed 1 year ago

Kaleidio commented 1 year ago

https://github.com/Insane96/EnhancedAI/issues/75

Kaleidio commented 1 year ago

java.lang.IllegalStateException: Adding Entity listener a second time: me.jellysquid.mods.lithium.common.entity.tracker.nearby.NearbyEntityListenerMulti@7eb1791c with sublisteners: [me.jellysquid.mods.lithium.common.entity.tracker.nearby.NearbyEntityTracker@6befe50c for entity class:

this fails because it's trying to force the zombie's mount to move as your mod provides mixins that allow mounted entities to control the direction their mount moves. roadrunner does not allow you to process two player search actions at once for the same tracker entity. in this case, your zombie is attempting to register a "track player" on behalf of its mounted entity even though it is also trying to track the player itself simultaneously (which is in this case a boat, even tho that would gracefully fail anyway as the zombie cannot drive the boat)

every entity tracking event must be registered a single time per tick by different entities. for example, two zombies can register tracking events, but one zombie should not track two things at once (event systems are not designed to handle that.)

note this is mostly because roadrunner has turned this part of the ai into an event based system. this was done because it was assumed safe because no vanilla entity code (and barely any mods) even registers more than one tracking goal at a given time. however, yours can if the entity is mounted

FatherToast commented 1 year ago

This should be directed toward Roadrunner. If there is some reasonable change I can make to help SAI play along nicely, then I can do that, but I have no idea how their system works to be able to make that change.

Some additional info that may help: SAI only calls vanilla pathfinding methods, does not use any mixins, and does not modify rider/mount behavior. For most entities (including zombies), it exclusively adds regular non-target tasks.

Kaleidio commented 1 year ago

strange, the issue only happens when entities are mounted whilst your mod is installed. I guess something else is going on. I'll just let roadrunner be because mod development has been abandoned.

Kaleidio commented 1 year ago

additional quick question that you're sure it may not have something to do with call for help?...

FatherToast commented 1 year ago

Hm, it is a shame to hear that, as I would be clueless as to where to even look for something in SAI that leads to the crash, since SAI is not referenced in the stack trace. The call for help thing is really a vanilla task, which is already on some mobs, including zombies.