GithubHelp home page GithubHelp logo

jbt's Introduction

Java Behavior Trees Framework

Small behavior tree framework. Trees can be built using groovy code:

 builder.tree {
     sequence() {
         sequence() {
             delay()
             act_print(arg: 'One')
             act_count_down(locals: ["count_down": 5])
             act_print(arg: 'Two')
             act_count_down(locals: ["count_down": 4])
             act_print(arg: 'Three')
         }
         sequence(debug: [execute: true]) {
             delay()
             act_print(arg: 'Start')
             act_count_down(locals: ["count_down": 2])
             succeed(id: 3,)
             succeed(id: 4)
             running(id: 5)
             fail(id: 6)
         }
     }
 }

Once you have a tree constructed (using builder or by directly wiring up the nodes), the tree is compiled into java bytecode. This bytecode may be used independently of the jbt:asm project (with all that fancy groovy stuff).

The compiled class has one method run() that runs the tree one full step and returns the new behavior state of the tree.

Behavior Nodes

  • Succeed Always returns with success
  • Fail Always returns with failure
  • Run Always return with running
  • Sequence Runs every child in a sequence. Return with failure, once a child fails
  • Selector Runs every child until it returns success
  • Parallel Runs every child parallel. Stops when one children fails or all are succeeded
  • Dynamic Selector Works like a selector, but rechecks all failed children each tick
  • Action Uses a callback to start any action
  • Decorator Uses a callback to control the result of the decorated node

jbt's People

Contributors

synopia avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

cervator

jbt's Issues

Finish, claim bounty :-)

Heya @synopia - been trying to get a hold of you, here's me trying a new way! :D

We're going to declare the Terasology engine v1.0.0 here after the holidays. While the existing behavior trees in the engine work, I know you've put a lot of effort into this second pass.

Do you have any time to get this back up to speed with the latest engine and (I think?) get it working as a module? We've been slowly building up some funds for code bounties and I'd be happy to drop a sizable one on this issue to get it finished, if that helps any :-)

Let me know! I hope all is well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.