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

Update Navigation #100

Closed
wants to merge 2 commits into from
Closed

Update Navigation #100

wants to merge 2 commits into from

Conversation

berndrakell
Copy link
Contributor

Closes #74

  • Buildings and resources are now included in the navigation mesh. This improves unit pathfinding.
  • Each fixed structure/resource now has an invisible mesh that belongs to the node group which is taken into account for navigation
  • Also the navigation radius of the tank was lowered to make it more manoeuvrable and close the gap between big and small units since the NavMesh is baked for both of them but orients itself on the bigger units
  • Because of how the map generation is implemented in the game there occurred some weird situations where the initial buildings floated and got relocated. To fix this I made the initial NavMesh baking ignore the buildings, and then after a wait frame the mesh is updated. I honestly don't completely understand what happens in the test games setups so my solution is a bit hacky
  • Although I'm not completely happy with the implementation of the solution, I think pathfinding is now much better

kbendler added 2 commits January 10, 2024 15:49
…vigation mesh. This improves unit pathfinding. Also the navigation radius of the tank was lowered to make it more manouverable and close the gap between big and small units since the NavMesh is baked for both of them but orients itself on the bigger units
- Because of the now more detailed NavMesh, the structure placement sometimes bugged out in areas with small navigation triangles because the default tolerance of the .is_equal_approx function was to small.
@Scony
Copy link
Contributor

Scony commented Jan 11, 2024

I haven't checked the details, but the description looks interesting. Thanks for opening this one! And thank you for keeping the PR <200LOC - it will make the review doable, although it will take some time.

@Scony
Copy link
Contributor

Scony commented Jan 14, 2024

I've checked the changes and made some notes - in principle the PR looks well. I see some room for improvement and experiments, therefore I'll merge it locally, and make some changes on top of that.

Scony added a commit that referenced this pull request Jan 14, 2024
@Scony
Copy link
Contributor

Scony commented Jan 14, 2024

Merged and reworked, thanks! Please note that I've hidden that feature behind feature flag as I need to fix few more things that popped up.

@Scony Scony closed this Jan 14, 2024
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

Successfully merging this pull request may close these issues.

Pathfinding: Units tend to get stuck
2 participants