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.2k stars 242 forks source link

Parallel Task #43

Closed piotr-j closed 9 years ago

piotr-j commented 9 years ago

The docs in Parallel states:

parallel task will succeed if all the children succeed, fail if one of the children fail.

but that doesn't seem to be the case. I have this:

Parallel<Brain> parallel = new Parallel<>();
parallel.addChild(new TaskA());
parallel.addChild(new TaskB());     

I would expect parallel to stop if TaskA fails, but that doesn't happen. Is it a bug or am i misunderstanding something? Full example

davebaol commented 9 years ago

Parallel task waits until all children have finished before it will succeed or fail, see https://github.com/libgdx/gdx-ai/issues/12#issuecomment-135551857

piotr-j commented 9 years ago

I see. Perhaps the docs on the task could be reworded to avoid potential confusion.

davebaol commented 9 years ago

Read my answer on the other thread. Let's keep discussing there.