-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make parallel behavior? #58
Comments
Hey ho. That is hard to answer on a general term, since I think it depends on how your whole system is structured. Or another way could be one Task that activates the walking animation, if there is nothing more urgent to do, and on the next tree run, when the character is still walking that node will be a failure, since it has not to start walking, and then the btree chooses to also smoke, since the hands are free. Does this ideas help? |
I've been watched some BTS video tutorials that show there's a "parallel node" like "sequence node". but I can't find it with parallel taskhttps://www.youtube.com/watch?v=Uj1pm2T-z8w&list=PLCPL5IYZm1NLVVxJx3-CFTLuHvLbCgmzk&index=5 maybe there's another approach that like you mention. I was thinking it's something ah... kind of like async parallel or maybe promise.all promise.all([task1, task2]).then(next) compare to a sequence node I will use phaser 3 for my game, it's an idle-type game. a simple example that I can imagine is a player moving and casting spells at the same time after finding enemy but anyway I will try two trees, thanks @Calamari |
Thanks for the video. |
I figured, that this is/was not as easy to implement as I thought it would, since that kind of node would need to knowledge of previous runs, which is only available through the introspector by now. |
@crapthings If you like, you can check out the new parallel nodes (they are pretty much as described in the video you mentioned). They should help you build your project. Since I want to test the changes out a bit more, because that branch is based upon the typescript rewrite, it'll stay in the Let me know what you think and/or if you find a bug or something. |
I've cloned the repo and switch to parallel branch Build Result Error: There was a problem with a file build result. {
"scripts": {
"dev": "snowpack dev",
"start": "snowpack dev",
"build": "snowpack build"
},
"devDependencies": {
"@snowpack/plugin-postcss": "^1.4.3",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.5",
"snowpack": "^3.8.8",
"standard": "^16.0.4",
"tailwindcss": "^3.0.12"
},
"dependencies": {
"behaviortree": "file:../BehaviorTree.js",
"dayjs": "^1.10.7",
"lodash": "^4.17.21",
"phaser": "^3.55.2",
"phaser3-rex-plugins": "^1.1.65",
"phaser3-scrolling-camera": "^2.0.2"
}
} |
If you have cloned it locally, you could go with removing it from the "package.json" in your project. |
like walking and smoking?
sorry I'm very new to game dev, I can't figure out how to do this with BehaviorTree.js
The text was updated successfully, but these errors were encountered: