NPCs open/close door several times while passing through those, possibly getting stuck in them
BadLucKWyvern opened this issue ยท 5 comments
Around a large village (close to be equal to a bandit base camp) wich has got only one dual doors to enter in, Zombies in the oposite side of the villages are able to find the door, while NPC aren't able, they are just walking on the wall in the direction of the Townhall for food, they are getting hurt by mobs without retaliating, until death
How to reproduce it: Make a large wall ( 50 blocks should be enought) put a townhall behind a side, and put an NPC in the other side, the NPC will not be able to go around the wall for reaching the town hall, while a simple zombie can
how to temporary fix it: Put dual doors everywere around the village... But sometimes bot are too stupid to open doors (the are stuck on it , sometimes they are more than one), i am forced to put pressure plates in the both side of door, making doors useless because mobs are able to pass the doors
NOTE: Using the dual opening door system from Quark mod (opening one door will also open the other one, same for closing)
50 blocks is very very far for minecraft AI to find a path. Zombies actually don't really find a path they wander randomly towards a point until the usual pathfinding AI can find a path for them. I could potentially use that logic for npcs, but I wouldn't like watching drunk like NPCs.
Anyway I have several issues open for pathfinding already and once I have those solved it will solve this for you as well (#763, #727).
I will leave this open for the door opening/closing as I have noticed that a few times and I don't think I have that captured anywhere in issues.
The village's outline is longer than 50 block
Look at the village size in the radar of that picture:
If you do a square long 20 block, that you put a door on the north side, you put the town hall in the middle on this square, and you put the NPC on the south side, the NPC will stick itself the the south side wall in the direction of the town hall
I think i saw the little travel path correction on NPC, i saw some sticking a little wall, stoping moving for less a second, and correcting its path
maybe the path correction range is too small ?
Still wondering how mobs are easly bypass the wall to the door unlike NPCs... Are they attracted by doors ?
it is small because of how pathfinding works in minecraft basing looking for all kinds of possibilities where entity could go and then figuring out if that's a good path. And there's a given limit to number of combinations that it tries. In my testing even if the npc has to walk 20 blocks around the wall the algorithm stops on reaching the max number of combinations. As said I have this on my list of enhancements (basically replace vanilla pathfinding with something more efficient) and we have issues for that so that will be taken care of.
Ok thanks !
By the way i have a last idea about the scalling health problem (the thread that you have closed) i prefer telling it here, because i don't know if you are noticed about replies on closed threads