[Library] behaviourtree.lua

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

[Library] behaviourtree.lua

Post by drunken_thor »

Hey everyone I ported my favourite BT lib from javascript to lua and thought you might like to use it as well. Check it out!

https://github.com/tanema/behaviourtree.lua
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: [Library] behaviourtree.lua

Post by adnzzzzZ »

1. Did you implement a context/blackboard that can be accessed by nodes of a tree?
2. Are there parallel nodes that simulate concurrent behavior?
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: [Library] behaviourtree.lua

Post by Fenrir »

Nice, I need a better AI for my guards and I think this library will be really useful! :)
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: [Library] behaviourtree.lua

Post by drunken_thor »

adnzzzzZ wrote: 1. Did you implement a context/blackboard that can be accessed by nodes of a tree?
2. Are there parallel nodes that simulate concurrent behavior?
1. Yes you can either pass in an object to the tree run method or set an object on a created tree please see the documentation https://github.com/tanema/behaviourtree ... avior-tree
2. No, as far as I know concurrency does not really exist in lua, but the tree is structured in a way that the tree stops (will not run another node) until success/fail/running statuses are called. This means that you are still able to develop asynchronous behaviour. However getting nodes to operate in parallel in lua I think might be more trouble than it is worth and too invasive for an overall program for just a simple behaviour library.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
drunken_thor
Citizen
Posts: 75
Joined: Wed Oct 01, 2014 12:14 am
Location: Toronto, Canada
Contact:

Re: [Library] behaviourtree.lua

Post by drunken_thor »

adnzzzzZ wrote: 1. Did you implement a context/blackboard that can be accessed by nodes of a tree?
2. Are there parallel nodes that simulate concurrent behavior?
Also I had a read through your blog, you had some really good posts about behaviour trees. I see what you mean by parallel nodes in your blog, and it would be really easy to implement by extending the branch node class. Also same with your wait until, or repeat until decorators could all be done by extending the decorator class. But it seems like you already have a pretty good code base for your own behaviour tree.
Light_world.lua for all your lighting needs
Talkies for all dialog needs
Github
twitter
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: [Library] behaviourtree.lua

Post by s-ol »

drunken_thor wrote:
adnzzzzZ wrote: 1. Did you implement a context/blackboard that can be accessed by nodes of a tree?
2. Are there parallel nodes that simulate concurrent behavior?
1. Yes you can either pass in an object to the tree run method or set an object on a created tree please see the documentation https://github.com/tanema/behaviourtree ... avior-tree
2. No, as far as I know concurrency does not really exist in lua, but the tree is structured in a way that the tree stops (will not run another node) until success/fail/running statuses are called. This means that you are still able to develop asynchronous behaviour. However getting nodes to operate in parallel in lua I think might be more trouble than it is worth and too invasive for an overall program for just a simple behaviour library.
2. I think he means having two running lead-nodes in the same tick, not necessarily running the corresponding lua code concurrently.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 220 guests