GithubHelp home page GithubHelp logo

jschomay / elixir-behavior-tree Goto Github PK

View Code? Open in Web Editor NEW
55.0 6.0 5.0 44 KB

Elixir library for building AI's from composable behavior trees

Home Page: https://hex.pm/packages/behavior_tree

License: MIT License

Elixir 100.00%
elixir ai behavior-tree

elixir-behavior-tree's Introduction

jschomay_a_computer_grid_world_where_ai_narrative_and_games_intersect_cropped

Hi, I'm Jeff. I like to explore that special place where games, narrative, and AI intersect. I made the Elm Narrative Engine for making non-linear story games and lately I've been experimenting with generative AI in games.

Play Deadline
Escape the subway before it is too late
Adding Inworld AI Characters to an Existing Game, Part 3: Reflections, Trust, and Pigeons
What I learned from my players and my characters
Adding Inworld AI Characters to an Existing Game, Part 4: Going Deeper
Getting the most out of AI chat bots
Getting Lost in the Forest
Postmortem on Using AI Generative Tools to Create a Forest Maze Game

Follow on LinkedIn

Follow on Twitter

elixir-behavior-tree's People

Contributors

aus70 avatar axelson avatar jschomay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

elixir-behavior-tree's Issues

Implementation of a parallel node

Hi,

I was wondering if with the current API it is possible to implement a parallel node.
I guess with a parallel you will end up with multiple active leaf nodes, end thus to signal fail/success the tree would need to accept some kind of identifier to mark the specific node that finished underneath the parallel.

  Node.parallel([:a, :b, :c])
  |> BehaviorTree.start()
  |> BehaviorTree.succeed(:b)

Currently the tree only accepts BehaviorTree.succeed/1 or BehaviorTree.fail/1.

Is there another way to achieve the parallel node with the current API ?

BehaviorTree.value returns unexpectedly a Node

To reproduce the issue:

tree = Node.sequence([
             Node.repeat_until_succeed(:wait),
             Node.repeat_until_succeed([
               Node.sequence([
                 :pose_question,
                 Node.repeat_until_fail(:evaluate_answer)
               ])
             ])
           ])

tree |> BehaviorTree.start |> BehaviorTree.fail |> BehaviorTree.value

returns:

[
  %BehaviorTree.Node{
    type: :sequence,
    children: [
      :pose_question,
      %BehaviorTree.Node{
        type: :repeat_until_fail,
        children: [:evaluate_answer],
        repeat_count: 1,
        repeat_total: 1,
        weights: []
      }
    ],
    repeat_count: 1,
    repeat_total: 1,
    weights: []
  }
]

but I was expecting :pose_question instead.

Is the tree malformed or am I missing anything?

Thanks!

The repeat_n behavior node does not work properly when nested.

When nesting one repeat_n behavior Node inside another the nested one only runs the first pass. After that the nested Node.repeat_n seems to be ignored.

To Reproduce:
Run the tree in the included zip file

Expected behavior:
Based on the attached tree there should be 5 "Create new membership" log entires for each "Get new pool" log entry.

Nested_Repeat.zip

Debug features: draw tree

It could be nice to get a visual representation of the tree at any given moment, including the current node.

Consider using graphviz format as a possible output.

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.