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

Include FOW exposure in pathfinding bounds #4407

Merged

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Nov 17, 2023

Identify the Bug or Feature request

Fixes #4406

Description of the Change

FOW can influence pathfinding, but its bounds were not affecting the pathfinding bounds. This caused the walker to exclude cells that were actually valid. This PR fixes that, and also includes debug logging and minor clean up to improve the maintainability a bit.

Possible Drawbacks

None

Documentation Notes

N/A

Release Notes

  • Fixed a bug where pathfinding around FOW would fail even with available paths.

This change is Reviewable

Since FOW blocks movement for player views, it can "push" optimal paths anywhere based on the exposure boundary. So we
have to account for it when calculating the bounds of cells to be considered for pathfinding.

Also we now clear the FOW blocked moves cache instead of the VBL blocked moves when FOW changes.
Instead of getting the current zone renderer, we now get the renderer for the zone that the walker was created
with. This should in practice be the same thing, but reduces the walker's dependence on global knowledge and avoids
potential edge cases.

Also uses that renderer's player view rather than directly checking if the player is effectively a GM. The check can
also be done when building the FOW geometry rather than on every potential cell step.
@cwisniew cwisniew added this pull request to the merge queue Nov 17, 2023
Merged via the queue into RPTools:develop with commit a7a131e Nov 17, 2023
4 checks passed
@cwisniew cwisniew added the bug label Nov 17, 2023
@kwvanderlinde kwvanderlinde deleted the bugfix/4406-fow-pathfinding-bounds branch November 17, 2023 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: FOW pathfinding quits "randomly"
2 participants