Category : a-star

Trying to implement A* pathfinding for a small game. Running into some strange bugs. Code: class PathNode { private: const PathNode* parent; GameObject position; int g; int h; int f; public: PathNode(GameObject _position, int _g, int _h, const PathNode* _parent = nullptr) { parent = _parent; position = _position; g = _g; // distance between ..

Read more

I’ve looked over several different implementations of A*. The current one I am using is based off of the pseudocode from the Wikipedia page. It finds the path but then the monster doesn’t move so I’m guessing it doesn’t work. It’s also incredibly slow. This is inside the update function which is called after the ..

Read more