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

Add a method to get all points from an AStarGrid2D #6276

Open
barbaros83 opened this issue Feb 11, 2023 · 4 comments · May be fixed by godotengine/godot#91868
Open

Add a method to get all points from an AStarGrid2D #6276

barbaros83 opened this issue Feb 11, 2023 · 4 comments · May be fixed by godotengine/godot#91868

Comments

@barbaros83
Copy link

barbaros83 commented Feb 11, 2023

Describe the project you are working on

turn based rpg game

Describe the problem or limitation you are having in your project

im trying to debug and visualize what astargrid2d is doing, but i dont have a way to access all the points at once.
i realize i could just use the size + offset variables, but it would be better if we can get the underlying stored data.

PS: a get closest point function would also be very useful.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

it would be really helpful, if there was a get_all_points() function, to write debug code and visually see what the AstarGrid2D is doing

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

a new function added to the AstarGrid2D class, that returns an array of all points, something like, get_all_points() -> Array:

If this enhancement will not be used often, can it be worked around with a few lines of script?

i think its an important addition to the AstarGrid2D class

Is there a reason why this should be core and not an add-on in the asset library?

the AstarGrid2D class is already part of core

Bugsquad edit (keywords for easier searching): AStar

@barbaros83 barbaros83 changed the title AstarGrid2D additions AstarGrid2D get all points Feb 11, 2023
@barbaros83
Copy link
Author

@Chaosus

@Calinou Calinou changed the title AstarGrid2D get all points Add a method to get all points from an AStarGrid2D Feb 12, 2023
@Calinou
Copy link
Member

Calinou commented Feb 12, 2023

Shouldn't the Visible Navigation debug menu option have a way to display AStar points (in both 2D and 3D)? This could be toggled separately on the AStar node if needed, similar to how you can already toggle this on TileMap.

@TheDuriel
Copy link

TheDuriel commented Feb 12, 2023

@Calinou AStar2D and AStarGrid2D are not Nodes and do not interact with the Scene Tree. How and where would the points be displayed?

@barbaros83
Copy link
Author

Shouldn't the Visible Navigation debug menu option have a way to display AStar points (in both 2D and 3D)? This could be toggled separately on the AStar node if needed, similar to how you can already toggle this on TileMap.

not sure if that is possible, but even if, it would be useful to have access to the underlying arrays, or atleast a copy of it.

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

Successfully merging a pull request may close this issue.

3 participants