You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description :
AStar provides a way to override its cost calculation from GDScript. Since AStar2D is a wrapper around it with an AStar astar member there is no way to override the _evaluate_cost() and _compute_cost() inside of it
I'm not sure if the best would be to rewrite AStar2D to use its own _solve() which might also slightly improve performance by removing useless calculations. Or completly rewrite AStar2D to not be a wrapper ? Or maybe there is a way to reach astar._estimate_cost() from its wrapper class ?
Wouldn't the best approach be using templates ? With AStar<Vector3> and AStar<Vector2> exposed as AStar and AStar2D ?
It would also mean that it would be easier to then expand to other datat types to support non-spatial pathfinding (such as in GOAP)
Godot version : 3.2.1, also present in 4.0
Issue description :
AStar provides a way to override its cost calculation from GDScript. Since AStar2D is a wrapper around it with an
AStar astar
member there is no way to override the_evaluate_cost()
and_compute_cost()
inside of itSteps to reproduce :
`class CustomAStar2D :
extends AStar2D
I'm not sure if the best would be to rewrite AStar2D to use its own _solve() which might also slightly improve performance by removing useless calculations. Or completly rewrite AStar2D to not be a wrapper ? Or maybe there is a way to reach
astar._estimate_cost()
from its wrapper class ?At least if it's intended that advance uses needing to overwrite those methods should use AStar regardless of 2D/3D, it should be documented here : https://docs.godotengine.org/en/3.2/classes/class_astar2d.html
The text was updated successfully, but these errors were encountered: