Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange avian behavior #5

Open
breitwan opened this issue Nov 10, 2021 · 1 comment
Open

Strange avian behavior #5

breitwan opened this issue Nov 10, 2021 · 1 comment

Comments

@breitwan
Copy link

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

@MadMartian
Copy link
Owner

MadMartian commented Dec 30, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants