hydrazine-path-finding icon indicating copy to clipboard operation
hydrazine-path-finding copied to clipboard

Strange avian behavior

Open breitwan opened this issue 3 years ago • 1 comments

You asked me to write here from the Minestom discord.

I used the avian function on the bat entity. there was a zombie passenger on it. the bat was supposed to follow the player, but this was very strange. the bat often got stuck in place, did not move diagonally, and sometimes fell down. To be honest, I'm not quite sure what to write here.

Minestom code: https://pastebin.com/e9zp6Tb7 Video (from Minestom): https://discord.com/channels/706185253441634317/715174453398601748/907324854762610698

breitwan avatar Nov 10 '21 10:11 breitwan

It looks like the present Minestom pathing of flying entities implementation is leading the engine to believe that the entity has strayed from the path and so the path engine keeps telling the entity to start from the beginning of the path instead of advancing to the next tile. This looks like it's related to some jumping code that assumes ground-based pathing. I modified the Minestom jumping code in PFPathingEntity,moveTo to:

this.navigator.jump(0.25f);

Effectively reducing the factor from 1, and if you follow the definition of jump Minestom is multiplying that value by a factor of 2.5. Setting a smaller jump value is a temporary workaround that seems to improve the pathing behaviour but it looks like this code (PFPathingEntity in Minestom) needs to be modified to account for flying entities (avian) that don't need to jump.

MadMartian avatar Dec 30 '21 07:12 MadMartian