-
Notifications
You must be signed in to change notification settings - Fork 13
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
Directions ignore input_is_destination #110
Comments
Hi! thank you for your interest! Quick question about your first point : "recalculate()'s input_is_destination flag doesn't seem to affect directions." if so, i think that is why you get the same result when you change the input_is_destination flag and i think it is intended behavior! Maybe test it with a one way map (if you can go from A->B you CANT go from B->A ) Let me know! About your second point : it's been a while since i have been looking at this codebase so im confused with both version 🤣 |
Thanks for the response! I was testing all this by messing with the scene included with the addon from the Godot asset library. This is the one that shows a grid where you can swap terrain types and show the colorful cost map or the directional arrows. The arrows stay the same even if you switch recalculate to set I added a few off the lower-right edge to experiment with connecting points one direction at a time so costs could be different each way, and Part of the confusion with the documentation is that it's not clear what "origin", "destination", "input", and "inspected points" mean. I took them to mean "the points you give to recalculate()", "the points that paths end at", "the points you give to recalculate()", and "the point(s) you give to other functions". |
Hey! if you're using the testscene, i assure you each point is connected bidirectionally to its neighbours ! ;) I myself am confused about the meaning of these words since the beginning but i dont really see how to change that right now, we'll see what we can do ;) |
To help illustrate the issue I see, I've turned my modified When
When
The costs are higher with However, the directions and paths always point from inspected points to origins, regardless of These results can be visualized by clicking "cost map" and "direction map" while running the scene with the modified script. Workaround |
sorry for the infinitely long delay, i think the name is just confusing, it reverses the cost but it does not make the the origin a "destination" the calculus always starts from your origin's points, that's what djikstra does, if you want info on other point you have to calculate again, changing the origin. |
Renaming it and updating documentation seems like a good route. Reading over this thread again, I was under the impression that the directions the path points in (and the order of points on the path) would be reversed, when as you point out, it just changes cost calculation. If it's clear that it doesn't change the result of methods like |
Thanks for the input! I'll go with renaming it soon!
…________________________________
From: Joel ***@***.***>
Sent: Wednesday, December 7, 2022 11:47:52 PM
To: MatejSloboda/Dijkstra_map_for_Godot ***@***.***>
Cc: astrale-sharp ***@***.***>; Comment ***@***.***>
Subject: Re: [MatejSloboda/Dijkstra_map_for_Godot] Directions ignore input_is_destination (Issue #110)
Renaming it and updating documentation seems like a good route.
Reading over this thread again, I was under the impression that the directions the path points in (and the order of points on the path) would be reversed, when as you point out, it just changes cost calculation. If it's clear that it doesn't change the result of methods like get_direction_at_point() or reverse the order of get_shortest_path_from_point(), I think that would solve the issue.
—
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMZTDKTNLXHQMH64ETUYADDWMEHZRANCNFSM5WHAGNHQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
This addon is great! It's definitely going to save me a lot of hassle (and maybe avoid performance issues) compared to replacing A* on my own to handle displaying and checking movement options for players and AI.
There is something weird though:
recalculate()
'sinput_is_destination
flag doesn't seem to affect directions. When I useget_direction_map()
and then check the direction from a cell, it's the same either way. The same is true if I just poll the specific cell withget_direction_at_point()
.get_shortest_path_from_point()
also moves from the given point to the nearest origin regardless of flag value.(Cost, however, is affected as expected for connections with different weights in each direction.
"input_is_destination": true
uses weights going from inspected points to origins, whilefalse
uses weights going from origins to inspected points.)The documentation could also be improved. It currently reads:
This is confusing because it appears to say that
true
makes paths point toward the origins, even though the inspected points are destinations. (Normally, an origin is where you come from and a destination is where you point to.) It also sounds like setting it tofalse
makes paths go from inspected points ("assumed to be origins") to the recalculation origins, which become the destinations -- the opposite of how cost calculation works now.If I understand the intent correctly, matching current behavior with connection weights, it should say,
This can be worked around, but it looks like a bug, so I thought I should report it.
The text was updated successfully, but these errors were encountered: