-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pathfinding issue on portal crossover #1719
Comments
I'll take a look. |
@heinezen is there a reason we set the current cost of the start portals to zero instead of making it relative to the start position? |
For the first two results you got: This is because the A* portal search currently terminates immediately after finding a portal in the exit sector. I think the top portal is discovered first because it is closer to the target (orange). Therefore, the pathfinder terminates the portal search there immediately, instead of checking the other options. We could fix this by not terminating immediately and instead do a few more iterations to be sure that it's really the best result.
The problem here is the calculation the heuristic cost for the portal nodes. The pathfinder uses the center position of the portal for its heuristic cost calculation. The ideal path in the second picture would use the portal on the right of the start node (green), but its center position is further down which makes it seem like the path is further from the target location than the portal going upwards. |
It was previously done because that info was expensive to calculate, but we can actually get the info from |
Or using the heuristic cost as you did in your PR ^^ |
So my PR solves the first three results, but not the last one. |
Would using start_integration_field be the better approach? |
@jere8184 Using the start integration field would only be marginably better I think. It's more accurate but also more complicated to check. |
The last one cannot be solved without changing the weighting of the distance cost. Currently, the distance is from portal center to portal center and this is not always accurate. |
I'm not following. isn't the path chosen based on a minimum |
The heuristic cost ist the cost from portal center to target cell, so the left portals heuristic cost are lower because its center is closer to the target. |
@jere8184 With left portal, I mean the portal at the top of the start sector (i.e. red in your screenshot). With right portal, I mean the portal on the right of the start sector (i.e. not the blue portal you encircled but the one that the green cell is on) |
ahh, that makes sense. Should we look into addressing this? |
Maybe we can implement corner portals? |
@dmwever I'm not sure how corner checks would solve the issue at hand in this case. The problem that we see here is mostly an accuracy issue in the high-level pathfinder, i.e. the portal search, with the goal being that we find the sectors that we need to integrate for the low-level search. Going through the corners would make this process far more complicated for the low-level pathfinding, while only creating a benefit for specific edge cases in the high-level search. For optimizing direct approaches, we already have LOS integration. |
S
Wouldn't creating portals between sector corners solve the issue? |
@jere8184 Not sure what you mean. In the comment your citing, I was trying to explain why making portals between corners would make the pathfinding much more complicated, while only maybe solving a specific edge case. |
Oh okay no worries, I didn't read any of this thoroughly I guess a better question is what's next when it comes to this issue, are there any tasks? |
The following pathfinding is a failure, right on the portal line. The algorithm seems to prefer wrapping around black spaces when heading southwest across portal lines.
Here is a last comparison between a movement on the east side of the portal connection (ideal) and secondly the west side (longer).
The text was updated successfully, but these errors were encountered: