behavior3 / behavior3js

Behavior3 client library for Javascript (Behavior Trees for Javascript)
MIT License
402 stars 105 forks source link

Simple implementation example [$20 awarded] #2

Closed Sladix closed 8 years ago

Sladix commented 9 years ago

Could you please write a simple implementation example ? For example an agent behavior that roam randomly and eat when it's hungry ?

I'm very interested in learning and implementing tree behavior in js but must say I don't clearly see how to implement it in a basic architecture.

Thanks :)

--- The **[$20 bounty](https://www.bountysource.com/issues/25025597-simple-implementation-example?utm_campaign=plugin&utm_content=tracker%2F18331363&utm_medium=issues&utm_source=github)** on this issue has been claimed at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F18331363&utm_medium=issues&utm_source=github).
renatopp commented 9 years ago

We already talked via email, I'm going to keep this thread open to remind the need for proper examples.

ruyadorno commented 9 years ago

something similar to the example from statejs would be awesome :smile:

tjpalmer commented 8 years ago

Is this to say that nobody has actually ever used Behavior3?

EskelCz commented 8 years ago

I'd love this as well. Raising the bounty :)

elicwhite commented 8 years ago

I used this library in an AI for the game screeps. Repo and main file here: https://github.com/TheSavior/screeps/blob/master/src/main.js

I had to write my own blackboard to work with the screeps memory system. I also had to change the way IDs were calculated since every frame has an entirely new context. If you are writing a typical program, you probably wouldn't need to do that hackery.

soundyogi commented 8 years ago

It is used here aswell:

http://guineashots.com/democracy/

efbenson commented 8 years ago

I messed around with the current implementation and got it working in node and built a quick example using the code in democracy as a guide. It is built on nodejs, but should work in the browser as well.

https://github.com/efbenson/behavior3Test

EskelCz commented 8 years ago

@efbenson I think this is perfect, thank you! I think you should claim the bounty. Hopefully @Sladix will close the thread and award it. (Not sure how it works really.)

Sladix commented 8 years ago

Dunno how to award the bounty :/

renatopp commented 8 years ago

Nice!

For the bounty, I think you ( @efbenson ) have to go in

https://www.bountysource.com/issues/25025597-simple-implementation-example

and claim de bounty. I don't see any option for me to give you directly.

efbenson commented 8 years ago

Done. Thanks guys.

gocpplua commented 3 years ago

I messed around with the current implementation and got it working in node and built a quick example using the code in democracy as a guide. It is built on nodejs, but should work in the browser as well.

https://github.com/efbenson/behavior3Test

This example is very good