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

Serveral pathfinding fixes #10409

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Serveral pathfinding fixes #10409

merged 1 commit into from
Nov 6, 2024

Conversation

someaddons
Copy link
Contributor

@someaddons someaddons commented Nov 5, 2024

Closes #
Closes #

Changes proposed in this pull request

  • Add planks, slabs and carpets as pathblocks
  • Pathblocks no longer increase pathing cost when they have a nonempty collision shape(carpets)
  • Doors and pathblocks are now cheaper to traverse


  • Re-visiting a pathfinding Node no longer counts towards the maximum allowed nodes to visit
  • Pathfinding Nodes now got a visited counter, which limits how many times the cost of a node is allowed to update. Heuristic rebalancing allows an additional revisit
  • Reevaluating the heuristic in pathfinding is now more accurate during search, using the distance to destination provided by the new IDestinationPathJob interface, and are also applied gradually instead of at once
  • Fix a bug where corner nodes could connect to eachother
  • Fix a bug where corner nodes that get their cost updated would not be recognized as such


  • Add fast collision existance check to ShapeUtil
  • PathfindingAIHelper#walkCloseToXNearY now runs the pathjob at least once, even if the entity may still already be in working range
  • Stuckhandler now at minimum walks the entity 20 blocks away when trying to resolve stuck
  • PathJobFindWater now discourages pathfinding from going too far out of its search radius
  • PathJobMoveCloseToXNearY got a slightly adjusted heuristic to prefer staying close to the near position


Testing

  • Yes I tested this before submitting it.
  • I also did a multiplayer test.

Review please

// 1. Navigation Finished
// 2. Navigation is progressing towards a previous task
// 3. Navigation did not try once
boolean isOnRightTask = (nav.getPathResult() != null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final?

@Raycoms Raycoms merged commit 7c4642e into version/main Nov 6, 2024
5 checks passed
@Raycoms Raycoms deleted the pathfindingupdates branch November 6, 2024 12:48
Raycoms added a commit that referenced this pull request Nov 10, 2024
Add planks, slabs and carpets as pathblocks
Pathblocks no longer increase pathing cost when they have a nonempty collision shape(carpets)
Doors and pathblocks are now cheaper to traverse

Re-visiting a pathfinding Node no longer counts towards the maximum allowed nodes to visit
Pathfinding Nodes now got a visited counter, which limits how many times the cost of a node is allowed to update. Heuristic rebalancing allows an additional revisit
Reevaluating the heuristic in pathfinding is now more accurate during search, using the distance to destination provided by the new IDestinationPathJob interface, and are also applied gradually instead of at once
Fix a bug where corner nodes could connect to eachother
Fix a bug where corner nodes that get their cost updated would not be recognized as such

Add fast collision existance check to ShapeUtil
PathfindingAIHelper#walkCloseToXNearY now runs the pathjob at least once, even if the entity may still already be in working range
Stuckhandler now at minimum walks the entity 20 blocks away when trying to resolve stuck
PathJobFindWater now discourages pathfinding from going too far out of its search radius
PathJobMoveCloseToXNearY got a slightly adjusted heuristic to prefer staying close to the near position
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.

2 participants