libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.18k stars 241 forks source link

Provide context to the pathfinder. #58

Open Nauktis opened 8 years ago

Nauktis commented 8 years ago

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.

davebaol commented 8 years ago

You have to inform the graph before searching the path

Nauktis commented 8 years ago

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

davebaol commented 8 years ago

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

scooterman commented 8 years ago

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

davebaol commented 8 years ago

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