Behavior Tree Starter Kit
aigamedev / btsk Goto Github PK
View Code? Open in Web Editor NEWBehavior Tree Starter Kit
License: zlib License
Behavior Tree Starter Kit
License: zlib License
Hey!
I've been using this code as a reference and I ran into a small problem. I think that the Parallel
behaviour will not reset states correctly for behaviours that terminate (that succeed or fail).
The resetting is left to Behaviour::tick()
, which updates the status of the behaviour. But the Parallel
behaviour will not tick behaviours that were previously terminated.
One fix is to have Parallel
implement onInitialize
and reset the children's state there (or tick them, though this wont interact well with the Repeat decorator).
Line 205 in 8124c3e
Is this intended? What I'm seeing is that following this logic, the Repeater as soon as one of the children is in running phase, will return INVALID as it's status.
This will in turn go back to the base class Behavior that will see that the status != RUNNING, and terminate the behavior.
Since the implementation of a basic Repeater has an empty ::onTerminate seems like nothing is effected if that's a top level node. However the side effects show as soon as it is used to repeat a set of actions further down the tree.
Shouldn't it return a RUNNING state instead?
Maybe I'm misinterpreting the intended behavior, as we want the action to be repeated quickly in the same frame / context?
One of the examples from the aigamedev paper says "shootPlayer" 3 times. If that is a sequence in itself, (like imagine an old sniper rifle: reload, aim, shoot, reload, aim, shoot..) each phase may have a short running period.
If that's not how it is intended ok, but otherwise I see that as a potential problem.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.