0 votes

emmm.English is not my mother tongue, so i am afraid that i cannot express clearly.
I am working on a sandbox game like rimworld, the map is changing all the time. there are many characters moving all the time and the map is in a size of 1024x1024. I don't want to change this. when the player hand out the task the need the characters (about ten).The game suddenly stop for about 0.5s. It was really really terrible the see it.
So.... Can anyone give me some advice on how to make the navigation faster.
(I tested and know the finding a path of 1024 cells long needs 50ms in my computer)

in Engine by (15 points)

1 Answer

0 votes
Best answer

Are you using Navigation2D?
I don't know much about A* (https://docs.godotengine.org/en/3.2/classes/class_astar.html), but it may be significantly faster. The problem is I think that it may be harder to set up, but I don't really know.
What I did was I limited the calls (e.g. only every 5 _process calls it wants to get a new path), but this is clearly not the question here.
IMO your English is perfectly understandable.

by (279 points)
selected by
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 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 webmaster@godotengine.org with your username.