Hamed YazdanPanah
Hamed YazdanPanah

Reputation: 76

Problem in Unity's navigation system - getting stuck and time-consuming path calculations

I am making a strategy game in Unity. Everything seems to be going well. The only problem that has frustrated me is that when the number of armies and soldiers in the game increases, the navigation system does not work properly. For example, when I want to send 200 soldiers from one location to a new position, the soldiers move one by one towards the target. It seems that the navigation system cannot find a valid path for this number of soldiers in real-time, and this takes time, leading to the issue. Now imagine that at the same time, other enemies want to send their armies to new positions. Naturally, the navigation problem becomes more severe and unbearable. I have another issue as well. While the navigation is calculating the paths for the soldiers, the workers in the empire who are working and walking also get stopped and cannot move until the paths for the soldiers are calculated and they move. Then the workers start moving as well.

This problem has really annoyed me. Please, if anyone has the same issue, like this question so it gets seen, and if anyone can help, I would appreciate it. I apologize for my poor English. Thank you.

I haven't found a suitable solution for this issue. I just set a limit on the number of troops to avoid problems for now. But this definitely isn't a good solution, and this problem needs to be resolved.

Do you know a similar Android game that can manage a large number of soldiers in a 3D environment in a strategy game?

Upvotes: 1

Views: 67

Answers (1)

Altay Turan
Altay Turan

Reputation: 78

Have you tried to use A* algorithm? I used it a couple years ago and it was calculating the ways dynamicly according to obstacles. I'm not sure about is it the best case for an army size but you can give it a shot.

Also please stop apologizing for your English in every answer and post, you are okay :)

Upvotes: 1

Related Questions