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

Pathfinder can lay a path over non-walkable pixels #2663

Open
ivan-mogilko opened this issue Jan 19, 2025 · 0 comments
Open

Pathfinder can lay a path over non-walkable pixels #2663

ivan-mogilko opened this issue Jan 19, 2025 · 0 comments
Labels
context: pathfinding type: bug unexpected/erroneous behavior in the existing functionality

Comments

@ivan-mogilko
Copy link
Contributor

ivan-mogilko commented Jan 19, 2025

Describe the bug
In particular circumstances the pathfinder can create a path that either crosses non-walkable pixels, OR character's walking logic somehow makes a character pass over non-walkable pixels when following this path. Because in AGS characters no longer test for walkable areas while moving, this does not cause them to stop. However the fact itself is a bug. It may in theory lead to unforeseen behavior, if, for example, a script is repeatedly testing a walkable area at the character's position.

This problem was first reported in #1879, where a character would get stuck if such pixel would be the last in a walking path.
The stucking itself was fixed by #2658, but the pathfinder issue remains.

AGS Version
Any version that features a new A* pathfinder, starting since 3.5.0.
Curiously, this seems to not depend on whether character's MoveList is based on fixed-point (in 3.x) or floating-point values (in 4.x). (at least there's no difference in the available test case)

Game
test--360walkstraighterror.zip

This game is based on Sierra template (the character settings, such as walking speed, may be also essential for the test) and contains a walkable area mask provided by the user who reported the #1879.
In game, press Ctrl+A to display walkable areas, then T key to start a test. Player will be teleported to particular location and ordered to WalkStraight towards other position. It will be writing player's position and underlying area to the standard log.

The example log output:
Script : player move from 164,98 to 114,123
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 164,98, area 1
Script : player at 161,99, area 1
Script : player at 161,99, area 1
Script : player at 161,99, area 1
Script : player at 161,99, area 1
Script : player at 161,99, area 1
Script : player at 157,101, area 0
Script : player at 157,101, area 0
Script : player at 157,101, area 0
Script : player at 157,101, area 0
Script : player at 157,101, area 0
Script : player at 154,103, area 1
Script : player at 154,103, area 1
Script : player at 154,103, area 1
Script : player at 154,103, area 1
Script : player at 154,103, area 1
Script : player at 150,105, area 1
Script : player at 150,105, area 1
Script : player at 150,105, area 1
Script : player at 150,105, area 1
Script : player at 150,105, area 1
Script : player at 147,106, area 0
Script : player at 147,106, area 0
Script : player at 147,106, area 0
Script : player at 147,106, area 0
Script : player at 147,106, area 0
Script : player at 143,108, area 1
Script : player at 143,108, area 1
Script : player at 143,108, area 1
Script : player at 143,108, area 1
Script : player at 143,108, area 1
Script : player at 139,110, area 1
Script : player at 139,110, area 1
Script : player at 139,110, area 1
Script : player at 139,110, area 1
Script : player at 139,110, area 1
Script : player at 136,112, area 1
Script : player at 136,112, area 1
Script : player at 136,112, area 1
Script : player at 136,112, area 1
Script : player at 136,112, area 1
Script : player at 132,114, area 1
Script : player at 132,114, area 1
Script : player at 132,114, area 1
Script : player at 132,114, area 1
Script : player at 132,114, area 1
Script : player at 129,115, area 1
Script : player at 129,115, area 1
Script : player at 129,115, area 1
Script : player at 129,115, area 1
Script : player at 129,115, area 1
Script : player at 125,117, area 1
Script : player at 125,117, area 1
Script : player at 125,117, area 1
Script : player at 125,117, area 1
Script : player at 125,117, area 1
Script : player at 122,119, area 1
Script : player at 122,119, area 1
Script : player at 122,119, area 1
Script : player at 122,119, area 1
Script : player at 122,119, area 1
Script : player at 118,121, area 1
Script : player at 118,121, area 1
Script : player at 118,121, area 1
Script : player at 118,121, area 1
Script : player at 118,121, area 1

Expected behavior
The pathfinder should produce a path that does not cross over non-walkable pixels, nor character following such path should walk over non-walkable pixels.

@ivan-mogilko ivan-mogilko added context: pathfinding type: bug unexpected/erroneous behavior in the existing functionality labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: pathfinding type: bug unexpected/erroneous behavior in the existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant