Weird pathfind 1.9 > 1.11 #1038

Open
File14 opened this Issue Jan 6, 2017 · 13 comments

Projects

None yet

3 participants

@File14
File14 commented Jan 6, 2017

Hello!

I'm currently working with a minigame called ZombieSurvival I use Citizens2 to setTarget at the players. I have noticed a weird pathfinding bug in 1.9 > 1.11 because this bug did not exist in 1.8(If I run the minigame at spigot 1.8 and a supported citizens version the bug does not appear).

Bug:
Let's see if I can explain this...
If I stand on the second floor, the zombie rather chooses to be at the first floor but as near me as possible. Picture: https://i.gyazo.com/6b338a1ea77ef2a76130fcce26018c7a.jpg

Why doesn't he walks around the house, up the stairs and to me because the setTarget is aggressive. Screeenshots: https://i.gyazo.com/9a670fc2c826ce05649b16c729147405.png
https://i.gyazo.com/478f8d68175254ba2a340346253286ed.png
https://i.gyazo.com/99a3d7a0ebbeedaa8179e3a717d7947b.png

When the zombies stays under me instead of walking up to me: https://i.gyazo.com/8c988dbf788a300f431066484f880aff.png

Maybe I need to add something to my code to prevent this? Because I had to add stuckAction to prevent the teleporting (which wasn't an issuse in 1.8 as well).

Little bit of my code:
npc = registry.createNPC(EntityType.ZOMBIE, "Zombie"); npc.spawn(loc); np = npc.getNavigator().getDefaultParameters().stuckAction(null); np.updatePathRate(10); np.range(180); np.stuckAction(null); npc.setProtected(false);

@Namnodorel

Have you tried to set the PathFindingRange higher? Maybe the zombie is unable to detect a better path because it may not scan on such a high range...

@File14
File14 commented Jan 6, 2017

@Namnodorel
How to set it higher? I have set np.range(180) isn't that enough?

@File14
File14 commented Jan 6, 2017 edited

"Maybe the zombie is unable to detect a better path because it may not scan on such a high range..."

Well, is it possible in 1.8 so why not in 1.9, 1.10 or 1.11 then?...

@File14
File14 commented Jan 6, 2017

@fullwall Any ideas?

@fullwall
Member
fullwall commented Jan 6, 2017 edited

Can you try with the new pathfinder? (navigator.getDefaultParameters().useNewFinder(true))

@File14
File14 commented Jan 6, 2017 edited

The new pathfinder is very buggy. https://i.gyazo.com/fed28720683b602c8ec1ebf2923fc4ea.gif
The old one is better

@File14
File14 commented Jan 6, 2017

@fullwall Can you tell me why it's broken in the 1.9 > 1.11 but not in 1.8?

@fullwall
Member
fullwall commented Jan 6, 2017

@File14 probably because Minecraft's pathfinder changed and became more complex in 1.9.

@File14
File14 commented Jan 6, 2017 edited

@fullwall ah ok, so you didn't make this path finding system? Because I thought you made it and you broke it :p

@fullwall
Member
fullwall commented Jan 6, 2017

@File14 the new pathfinder is from Citizens, the old one is Minecraft's. There seems to be some bugs with stairs with the old one. The new one should pathfind properly but it still uses Minecraft's movement system so there are some bugs with the spinning. If you turn on pathfinding debugging you should see if it's working or not.

@File14
File14 commented Jan 6, 2017 edited

@fullwall ah ok. But let's say you do fixes. Will your fixes only be made for 1.11? Becuase people are using my minigame from version 1.8 > 1.11 :/

@fullwall
Member
fullwall commented Jan 6, 2017

@File14 I can fix it for 1.10 and 1.11.

@File14
File14 commented Jan 6, 2017

Ok hmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment