How to make the navigation faster?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Icbitic

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)

Did you solve this in the last 3 years?

Chad | 2023-06-21 08:43

:bust_in_silhouette: Reply From: 1234ab

Are you using Navigation2D?
I don’t know much about A* (AStar — Godot Engine (3.2) documentation in English), 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.