Skip to content

feat: Environment layer pathing [MTT-2412], [MTT-2830], [MTT-1990] #576

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 2 commits into from
Mar 30, 2022

Conversation

fernando-cortez
Copy link
Collaborator

@fernando-cortez fernando-cortez commented Mar 21, 2022

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 with NavMeshModifier 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

  1. Select the rogue.
  2. Pick a point on top of a pillar or out of bounds.
  3. Press dash action.
  4. Rogue will travel to the last point inside the level before the spot chosen.

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

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@fernando-cortez fernando-cortez added the 1-Needs Review PR needs attention from the assignee and reviewers label Mar 21, 2022
LPLafontaineB
LPLafontaineB previously approved these changes Mar 21, 2022
@LPLafontaineB LPLafontaineB added 2-One More Review One review in, one to go and removed 1-Needs Review PR needs attention from the assignee and reviewers labels Mar 21, 2022
SamuelBellomo
SamuelBellomo previously approved these changes Mar 29, 2022
@fernando-cortez fernando-cortez changed the title feat: Environment layer pathing feat: Environment layer pathing [MTT-2412], [MTT-2830], [MTT-1990] Mar 30, 2022
@fernando-cortez fernando-cortez added 1-Needs Review PR needs attention from the assignee and reviewers and removed 2-One More Review One review in, one to go labels Mar 30, 2022
@fernando-cortez fernando-cortez merged commit 9d189c7 into develop Mar 30, 2022
@fernando-cortez fernando-cortez deleted the fix/environment-layer-pathing branch March 30, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-Needs Review PR needs attention from the assignee and reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants