Topic was automatically imported from the old Question2Answer platform.
Asked By
mason
Hey all,
I’ve created a subclass of AStar2D and tried to override the _compute_cost() and _estimate_cost() functions. I’m trying to make it so A* sees the distance between any two connected nodes as 1. That way, the shortest path is determined only by the number of connections.
It seems to be ignoring the functions I’ve written. Firstly, it fails to calculate the shortest path, and secondly, it doesn’t print “blamo” to the console when computing distance.
What version of Godot are you using? Poking around, it seems that AStar2D didn’t used to allow those methods to be overridden (even though AStar did). However, reading this…
and
…makes me think the necessary changes were implemented in AStar2D and were cherry-picked into both 3.2.3 and 3.2.2.
Ah, perfect. Upgrading fixed the problem. I was running 3.2.1 I think. Thanks for looking into this for me!