0 votes

Hello,

I have recently started using this engine with a couple of friends to make a game. Today we run into an issue. The Navigation2D#get_simple_path method seems to not take into account the dimensions of the various shapes it encounters while calculating the path, this causes entities to get stuck in our game. They get moved with the move_and_slide method.

I invested some of my time researching this issues and it seems as if it even dates back to as far as 2015 with various GitHub issues mentioning it but not one (at least I didn't spot one) offered a solution. I even read a post that said that a fix was planned for Godot 2.2, so quite some time ago. - Is there a better solution than implementing our own pathfinding algorithm or is there an ETA for a fix?

Thanks for your time.

in Engine by (14 points)

1 Answer

0 votes

It is recommended that your navigation polygon(s) include a safe margin towards walls, in order to take the agent's size into account. This isn't ideal because you have to choose it carefully depending on which variety of agents you have, and it has to be manually taken into account when setting it up. However that's a good solution for now and has been working fine for my 2D game with AIs :)

I think 3D has a margin parameter for that same purpose, maybe it just needs to be added in 2D. I think this issue refers to it https://github.com/godotengine/godot/issues/1887
No ETA AFAIK, someone just needs to do it.

by (28,876 points)

Thank you for the answer. I tried it and it worked ok-ish for me. I replaced it now with an AStar based system, which is significantly slower, but I let the entities queue navigation jobs and process them on another thread.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.