-
Notifications
You must be signed in to change notification settings - Fork 20
Jetpack/Jump-Aware Pathfinding #138
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ust calling per-team repeatedly, so doing it like this is more flexible
Went back to SCENEGRIDSIZE
… options for crawling
… etc) Added lua bindings and plumbing to allow configurable jumpHeight from actor. Crabs right now are assumed to have 0 height, Humans are assumed to have 20, and anything else has infinite.
…sn't seem so accurate just now
This reverts commit 153ac21.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the capability to the pathfinder to intelligently generate paths based on the actor's jump height (i.e, how far vertically they can fly using their jetpack).
Previously, actors would pathfind without any sort of awareness of the ground. They pathfinder would generate a path through air assuming that everything can fly. Then a series of hacks were applied to clean up the path: we'd move all the points in the path down to the ground, and then the Lua AI would try to reconstruct "jumping" by moving the points back up where necessary.
This would very often generate paths are are impossible for the actor to follow, for example pathing up-and-around an entire building. This frequently led to bugs where actors would fly up-and-down on the spot without actually making any progress towards their destination. It would also generate very bad paths even when the actor has adequate jetpack strength, due to the varied hacks to cleanup the path.
With this change, actors now generate paths that stay on the ground naturally during the pathfinder itself, instead of needing to cleanup the path. They also generate jumps within the pathfinder, meaning that the actor understands much better how to navigate upwards. For example, actors will now try to use intermediate platforms to work their way upwards, if in a long vertical shaft with stopping points to stand on. Likewise. if an actor sees that it's absolutely impossible for them to jump up to a ledge to enter a base, they will now dig through the walls if necessary.
The pathfinder also has support for NoGrav areas, so all actors understand that they can pathfind up through movators, even without jetpacks. Support for flying pathfinding is still included, for example for dropships.
Just now it's hardcoded to assume that crabs have zero jump height, that humans have a fixed jump height, and that everything else (dropships, rockets, etc) are flying. Before merge I will add code to automatically calculate a jump height based on the actor's mass and their jetpack fuel and thrust.Now the game uses an internal miniature iterative physics sim to calculate jetpack jump heights automatically. This is dynamic, so even takes into account the current actor's inventory mass.