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

Closest node function to AstarFinder.js #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Closest node function to AstarFinder.js #127

wants to merge 1 commit into from

Conversation

Fralleee
Copy link

If end node can't be reached, get path to nearest open node.

If end node can't be reached, get path to nearest open node.
@rohan-deshpande
Copy link

How about this takes a second argument or something and rather than "nearest" node it gets to a node within proximity? It could default to nearest but could be used to make more strategic moves if necessary.

@Fralleee
Copy link
Author

But isn't nearest open node the same as node within proximity?
I'm not sure if I follow :)

Implemented this function to my RTS game so the characters would still path closeby if you clicked on obstacles. That was the intended use and the only one I could think of at the moment.

@rohan-deshpande
Copy link

Cool! I'm using this for a turn based combat system so maybe my use case is slightly different but consider this; what if threat is like cost? So a move to nearest node might also take threat into consideration and instead move them within proximity for defensive positioning rather than get them as close as possible to the original destination.

I've kind of already implemented this but it's pretty specific for my use case, would be good to have a more general solution.

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