libgdx/gdx-ai

Provide context to the pathfinder.

Nauktis opened this issue · 5 comments

For the moment the pathfinder finds connection between nodes by calling getConnections() on the IndexedNode.

My problem is that there is no context to decide if a connection should exist or not or to provide a different cost for the connection.

Simple example, you could imagine that some units could go over water cells while other cannot. Or that some agent have a different cost for a specific connection. Problem is, there is no way to tell for which entity (i.e. context) the pathfinding is running.

You have to inform the graph before searching the path

That could be a solution but you can only search one path at a time then.

Current implementation of the indexed A* algorithm imposes this limitation already

@davebaol sending the path request through getCost wouldn't help here? @Nauktis?

Hmmm... PathFinderRequest is used for time sliced pathfinding only.