bitbrain / beehave

🐝 behavior tree AI for Godot Engine
https://bitbra.in/beehave
MIT License
1.85k stars 116 forks source link

Beehave doesn't output print statements (help needed) #303

Closed ca3gamedev closed 7 months ago

ca3gamedev commented 7 months ago

I will leave this issue here, because mainly I want it indexed by google, so It can help others new users.

My issue is that there's not proper documentation on how to get signals working so far. The tutorial seems to miss the setup stages, so I was unable to understand how to set up the tree so the leafs can do their job.

So far what I understand is that I need a root node, and then a sequencer node or a selector node. Then I need to create a new node and a new script with a derived class from the leafs nodes.

But my issue is that I don't get any output if I do just the tick function. Any help or explanation on how to set up the trees and leaves would be greatly appreciated.

EDIT : Added a screenshot of my tree. tree

LeoDog896 commented 7 months ago

What's the source code of IDLE CHECK and IDLE Action?

ca3gamedev commented 7 months ago

IDLE CHECK

extends ConditionLeaf

func tick (action, blackboard):

    return RUNNING

IDLE ACTION


extends ActionLeaf

func tick(actor, blackboard):

    print("IDLE TEST")

    return SUCCESS
LeoDog896 commented 7 months ago

IDLE CHECK

extends ConditionLeaf

func tick (action, blackboard):

  return RUNNING

IDLE ACTION


extends ActionLeaf

func tick(actor, blackboard):

  print("IDLE TEST")

  return SUCCESS

The reason why IDLE TEST isn't printing is that your previous node is RUNNING. If your sequence is atomic, it would work as expected.

ca3gamedev commented 7 months ago

Ah, seems I got it.

SUCESS and FAILURE are condition checks, are done once.

RUNNING is a loop condition, and should be used to keep the leaf running.

Thanks!!!!!

ca3gamedev commented 7 months ago

Added final advice to people lurking here.

You need a selector node, which will be the parent of a sequence node. The selector will pick the sequences based on their failure return check.