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

Partial path finding #28

Closed
wants to merge 7 commits into from
Closed

Partial path finding #28

wants to merge 7 commits into from

Conversation

mikkleini
Copy link
Contributor

@mikkleini mikkleini commented Nov 3, 2019

Solves #27

If path to the end point is not found then at least a path to closest point is returned.
Introduced path finding result enumeration which explain the type of the path:

  • PathFindResult.PathFound - Complete path found from start to end
  • PathFindResult.PartialPathFound - Can't reach the end, but path to closest reachable point is returned
  • PathFindResult.AlreadyAtTheEnd - Already at the end point
  • PathFindResult.StartOutsideBoundaries - Start point or some part of agent is outside of map borders
  • PathFindResult.EndOutsideBoundaries - End point is outside of map borders

However, this broke the compatibility. There's no more "GetPath" function, instead there's "TryGetPath".

Looks like this:
image

@roy-t - please don't merge yet. I have some TODO's there.
I'm mainly thinking about removing agent shape dependent end point boundary check. It might be better to return partial path to end point rather than returning EndOutsideBoundaries error and no path.

Introduced path finding result enumeration to better explain the result for the user application. This however means compatibility is broken.
…ent is too large to reach the end then partial path is returned.
@mikkleini
Copy link
Contributor Author

mikkleini commented Nov 3, 2019

Removed agent shape consideration from end point check. If agent is too large to get to the end which is at the edge of the grid then partial path is returned:

SquareW3 used in example:

image

@giulianob
Copy link

You could keep backwards compatibility with GetPath. Just add back GetPath and make it return null unless it finds a path?

@giulianob
Copy link

Also, what would happen if the agent is currently on top of a cell that is blocked? Is that what the "stuck" result is used for?

@roy-t
Copy link
Owner

roy-t commented Jan 22, 2020

Great work, I've re-implemented this in v2, which is under construction :).

@roy-t roy-t closed this Jan 22, 2020
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.

None yet

3 participants