AI get stuk in "jump" instead of going around
pwaksman973 opened this issue · 17 comments
Is there an existing issue for this?
- I have searched the existing issues.
Are you using the latest MineColonies Version?
- I am running the latest beta/release version of MineColonies for my Minecraft version.
I am also running the latest versions of other mods that are part of my problem.
Did you check on the Wiki? or ask on Discord?
- I checked the MineColonies Wiki and made sure my issue is not covered there. Or I was sent from discord to open an issue here.
What were you playing at the time? Were you able to reproduce it in both settings?
- Single Player
- Multi Player
Minecraft Version
1.21
MineColonies Version
minecolonies-1.1.1143-1.21.1-snapshot
Structurize Version
structurize-1.0.787-1.21.1-snapshot
Related Mods and their Versions
No response
Current Behavior
NPC get stuck jumping in place forever and never re-path to a valid path.
Here, well is a print, but it is jumping in place
Same happens with this issue: #11208
look for the guard tower (3º and 4º pic), they get stuck jumping on that exact spot.
Right click on the NPC in both cases will make them find a valid path, so whatever is executed with right click event fix it. Could be done if the npc is stuck in the same block after 4 jumps?
Expected Behavior
NPC should have a way to detect that the current "jump" path is not working.
There is the "stuck level" info when printing info about the npc, that is 0, not sure if this was intended for situations like this.
Reproduction Steps
No idea, saw this behavior in 2 places.
Here with Nordic spruce house lvl 2.
and in the guard tower lvl 2 with savana style: #11208
Logs
https://gist.github.com/pwaksman973/c696a3fb0ae0b4eade6babf4f3b15877
Anything else?
No response
Footer
Viewers
- Add a 👍 reaction to the bug report if you are also affected. This helps the bug report become more visible without cluttering the comments.
⚠️ Only add a comment if you have new insights or background information not already mentioned. Off-topic or "+1" comments will be deleted to keep the discussion focused.
Random thing I notice, in the very first pic on this thread, Job: NEEDS_ITEM, shouldn't this be Builder? Current state needs item seems fine.
The Urban Savan guard tower lvl 2 is almost guarantee to happen, is not always but is often enough to be easy to find
Can you give us a path debug picture of this? In creative mode you can see a debug option in the citizen UI
dang, it, saw your message too late :(
Right click on the NPC in both cases will make them find a valid path, I'll wait one to bug out again, I can build another savana guard tower level 2 that get them stuck more often, then I come back to this
Can you give us a path debug picture of this? In creative mode you can see a debug option in the citizen UI
where can I find this? I changed to creative to test but the only difference I saw is that you can change the citzen status
Interesting thing I notice, only the guard assigned to the tower get stuck on that spot, all the other guards that pass by the hut can path just fine. So I guess it buggs out when he is going to unload?
The spot they get stuck on is at th ebottom at the carpet in front of the stairs, right?
@Raycoms Wasn't it the case with that acacia building that they can't navigate downwards under a panel or something. I remember that building...
I'm not sure about the acacia tower yet, but I found why the npc keep jumping on this position here instead of going to bed.
Home style: Nordic Spruce
Level: 2
Most of the time the npc go straight trough the ladder up, but some times it goes around, and end on that spot, maybe it was already idling there.
it is stuck in the loop on EntityAISleep, it calls findBed(), which then calls findBedAndTryToSleep(),
it skips the first condition if (usedBed == null || usedBed == homePos)
Then it fails the check EntityNavigationUtils.walkToPosInBuilding(citizen, usedBed, citizen.getCitizenData().getHomeBuilding(), 12)
and end up on reset bedTick, which will make findBed() go trougth the same flow again.
Now I don't know what happens when you right click on the NPC, but it makes the AI repath and it just go up the ladder as normal. The check on EntityNavigationUtils.walkToPosInBuilding works after right clicking on the npc.
I think I know how they got there, they go most of the time upwards in almost a straight line, but sometimes they go up in a more steep angle, like going in a diagonal from left to right, and they get up almost on the other block at the right, I bet some times they just fall out from the ladder, which would result them getting on that exact spot.
I didn't saw they falling there yet, but it seems to be the case. And them they just keep jumping as if they were finishing going up the ladder.
I just don't understand what happens with the right click that fix it, I guess it stop the current AI and after X seconds it will restart which make them actually calculate a new path instead of being stuck with the old thing waiting for them to get up.
Right click on the guard that is stuck on the guardtower also fixes them, but there there isn't any ladder to climb up, but slabs instead
I'll close this one in favor of: #11208 as duplicate





