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

(dis)allow corner crossing in diagonal mode #30

Open
Yonaba opened this issue Jun 4, 2014 · 1 comment
Open

(dis)allow corner crossing in diagonal mode #30

Yonaba opened this issue Jun 4, 2014 · 1 comment

Comments

@Yonaba
Copy link
Owner

Yonaba commented Jun 4, 2014

When diagonal moves are allowed, an agent when turning around a corner (wall edge) can cross the corner. This behaviour might not be suitable for some games, as it results in unaesthetic paths, especially for agents having a certain size. Although it can be solved with clearance, we shoud be able to allow/disallow the ability to cross a corner when making a diagonal move.

This can be easily implemented by skipping an adjacent neighbor when getting the list of a node neighbors. Assuming dx and dy are the normalized vectors of movement, we check if the node at (currentNode.x+dx, currentNode.y) is walkable. In case it is, we only add it to the list of neighbors if cornerCrossing is allowed.

The ability to (dis)allowCornerCrossing will be added as a new method to the pathfinder interface.

@Yonaba Yonaba changed the title Add ability to allow/disallow corner crossing in diagonal mode (dis)allow corner crossing in diagonal mode Jun 4, 2014
@Abdo023
Copy link

Abdo023 commented Mar 5, 2018

Hello, was this feature added? I can't find it in the pathfinder.lua script, also "myFinder:setTunnelling(false)" doesn't work. Have you abandoned this project? or am I missing something?
I'm not very good at algorithms and I don't fully understand this framework, I'm unable to add it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants