feat: Environment layer pathing [MTT-2412], [MTT-2830], [MTT-1990] #576
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.
Description (*)
Borrowing description from 543, which will be closed.
This is a pathfinding solution that ties player navigation more rigidly with the navigation mesh generated.
A significant change here is the re-layering of Dungeon prefabs. A
Environment
layer has been introduced to distinguish between Ground vs Environment (non-interactive) level prefabs. To prevent these items from being added to the nav mesh bake, Environment prefabs have been identified withNavMeshModifier
components.Navigation is only successful when any "Ground"-tagged object is intersected via raycast, as well as when the intersection point is a valid point on the generated nav mesh. This eliminates any teleports to the tops of any ground colliders, since the point of interest will always be on the navmesh floor.
While testing, it was also discovered that the rogue could dash outside the level. If there was any part of the navmesh that bled outside the bounds of the level (very few cases), the dash could travel to that point.
To combat this, a minor tweak was added to
DynamicNavPath
which eliminates appending the last point to the nav path (since this point could actually be out of bounds).An added bonus from this PR is that the rogue no longer goes through the door, since the visibility check inside
ActionUtils
now uses the Environment layer as a blocking layer (as well as for the mage shot). The collision detection for arrows has also been accounted for.A last benefit from this PR is that the pillars in the boss room area have been modified with a NavMeshObstacle that, when destroyed, fills in the navmesh surface underneath. This means players will path around these pillars when not broken, and can path through these spots when destroyed.
Related Pull Requests
This is work on top of PR 542.
Issue Number(s) (*)
Fixes issue(s): MTT-2412, MTT-2830, MTT-1990
Manual testing scenarios
Questions or comments
Just a comment that
ClientInputSender
is beginning to become too much of a god class. This needs to be broken down to only process input and publish results to listeners.Contribution checklist