Calamari / BehaviorTree.js

An JavaScript implementation of Behavior Trees.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README: Write down how to create own decorators

Calamari opened this issue · comments

commented

I just found this. I am thinking of writing my own decorator and document the process.

The goal ist something like an event-based tree like unreal has them.
(Any ideas on that?)

Awesome project!

Hi. Thanks.

The issues I put up here, are mainly for the rewrite (which is basically finished, and just needs proper testing) that is found in the 2.0 branch. This is also uses ES7 syntax, which makes things more readable. So writing Decorators there is a bit different to the 1.0 version.

Anyhow, to make an event based BT you need to call the BT run method multiple times a second (although I don't recommend to call it as often as on every frame) and attach a blackboard to it (which also could be the agent it handles) so the Decorators can check on the blackboard if a condition is happening. That is the closest way to get a BT to be "event-driven", as far as I know. The examples of BTs of Unreal engine I saw do look similar to what I described.

I am currently on vacation this week, so I am not often responding, but if you still have question, please ask. I like to help :)
What are you building @soundyogi?

commented

Nice Description!
Thanks I will hack around a bit as soon as I get some air.

Why, Well the ue4 BT implementation is just very good and my team got used to it.
(I think event-driven behavior trees are the most advanced concept at the time, also excessive use of decorators is encouraged and your lib is the first I like in that regard.
But unreal engine fucks up our velocity thats why I have to transition to js. (4h for packaging? nu-uh)
Games mainly, but since BTs are so flexible, I cant think of anything you could not do with them.
I actually think they would fit well in traditional apps aswell. DAG for the win.

I like the 2.0 rewrite. Very Clean. I will have to get some more reading done!
Until Then!

ES7 is too radical , I think ES6 is good enough in next two years.

commented

Well the damage is already done :D
And es6 was wayyyyy more radical

I think es7 is a good choice.

So, the damage is definitely done. The v2 is out now.

Since this is a ticket related to this version creation I'll close it. If you like, @soundyogi play around with it. Decorator creation should be relatively straight forward. If something is not working as expected or have another ideas, please reach out or create an issue. :)

commented

Perfect Timing Man I am going to check it out and report back :) 👍