Тёмный

Behavior tree AI in under 10 minutes! Godot 3.5 Tutorial 

bitbrain
Подписаться 15 тыс.
Просмотров 55 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 126   
@killax1000
@killax1000 2 года назад
I'm making a game where you employ NPCs to do things like chop trees, mine, craft, whatever. This couldn't be more perfect.
@teo2805
@teo2805 Год назад
Can we get a part two/followup? I'm a bit confused on a few things that were explained too fast. Like, why do I need an inverter "HasNoTreeAvailable" with a "HasTreeAvailable" check after? Could you make some enemy AI examples using your addon too? Or could i look at more examples from your game
@bitbraindev
@bitbraindev 7 месяцев назад
Working on a much more basic and thorough tutorial for Godot 4 that will explain everything in detail 🙌
@PaperMouseGames
@PaperMouseGames 6 месяцев назад
@@bitbraindev Are you still working on this? I would love an updated more in depth version of this video!
@bitbraindev
@bitbraindev 6 месяцев назад
Yeah. Good things take time.
@PaperMouseGames
@PaperMouseGames 6 месяцев назад
@@bitbraindev glad to hear it! Looking forward to it ☺
@bitbraindev
@bitbraindev 2 года назад
Thank you a lot for watching! Subscribe to my channel for more gamedev stuff and let me know in the comments what you want me to do next! ⚠ EDIT: as raised by Gareth Somers, at 5:45 we also have to wrap the condition inside a SelectorComposite as shown in the video (I forgot to mention it)
@MrTony2371
@MrTony2371 Год назад
Thank you for your addon. It looks cool and promising. However, this tutorial doesn't help a lot in understanding the core functionality of behavior trees. it would be cool if there is a more detailed explanation of each step you've done. "Let's add SequenceStarComposite node..." - Why not simple SequenceComposite node? "Let's create similar setup for lumberjack" - *selects Selector node as a root, while in previous setup SequenceStarComposite was a root node* Why so? "...tree should be empty, except for the script..." - What exactly each line of the script does? "...tick the box for Access as Scene Unique names?" - Why? What does it actually do? And a lot of cursory staff about the topic. What's the point of making 10 min tutorial if the only thing it teaches is how to copy your actions to recreate the same scene you provided?
@bitbraindev
@bitbraindev Год назад
My tutorials are less about teaching but more "Stackoverflow style" solutions to problems. People can always research the theory behind stuff thenselves - there are literally thousands of great explanations out there how behaviour trees work in theory. The aim of this tutorial is to actually use them in a game.
@MrTony2371
@MrTony2371 Год назад
@@bitbraindev I got your point. Anyway, Ill be trying to create ingame AI with your addon. Thank you!
@ThunderThoster
@ThunderThoster Год назад
I love it! Considering I started learning Godot one month ago and game development in general, I believe it will take me some time to completely understand how the code works, although I checked the code and have an inkling of an idea. But before that even happens, gotta practice a lot of mechanics. Either way, thank you for the video; I will come back to it when the time comes :D
@Luisa-mu9yw
@Luisa-mu9yw 2 года назад
This is literally what I've been struggling with today!! Really cool, thank you! :)
@MegaZumo
@MegaZumo 2 года назад
This is the best behavior tree Godot tutorial, the other ones are really simple. Great job! =) Btw I've seen on the assetlib two BehaviorTree plugins, is there a reason why you decided to create your own?
@bitbraindev
@bitbraindev 2 года назад
Great question! I actually tried all available addons in the asset store and none of them were simple enough for me. Either, they were lacking the "selector star" functionality and important decorator nodes or they were visual only. Also, the documentation for them was rather lacking. My addon is directly based on the demo project from ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-YHUQY2Kea9U.html - however, I have plans to introduce also a visual debugger for my addon and actively develop it for better debugability.
@MegaZumo
@MegaZumo 2 года назад
@@bitbraindev I see, I will use your addon then. I have been studying the code and it was very easy to understand. Do you have any plans to upload it to the assetlib?
@bitbraindev
@bitbraindev 2 года назад
@@MegaZumo ​ it is there already! Just type 'bee' and it should show up.
@MegaZumo
@MegaZumo 2 года назад
@@bitbraindev nice!
@PMX
@PMX 2 года назад
3:14 WlakToClosestTree seems to be "closest in a straight line", but "closest by walking distance" (ie taking into account the path it can actually use) would probably be what the user expects. Of course, that's more expensive to calculate, but you can limit the calculation to the closest (in straight line) 10-20 trees for a good enough heuristic.
@TheSlimHim
@TheSlimHim 2 года назад
Can you explain why you made your own behavior tree instead of using one already in the plugins? I haven't explored behavior trees in Godot yet so I was wondering if what else is available is lacking.
@bitbraindev
@bitbraindev 2 года назад
Great question! I added an explanation here: github.com/bitbrain/beehave/blob/godot-3.x/README.md#-yet-another-behavior-tree-addon
@TheSlimHim
@TheSlimHim 2 года назад
@@bitbraindev Thank you! That's was super helpful!
@beidero
@beidero 2 года назад
This is a very intersting video, I always like AI stuff. In a past tutorial I made on my youtube I did something similar but in pure C#, and it was quite efficient. I am a programmer so I think I prefer having it in my text editor over being a node, but I guess for most people it would be the other way around. Either way a great tutorial
@kevinhougesen1473
@kevinhougesen1473 Год назад
I also prefer it in text editor since I'm also not a standard game dev, but I think this way is preferred because Godot itself updates the changes if you move the files in the 'res://' folder. That way you don't have to update a lot of scripts if changing the organizing structure of the game.
@slothinahat
@slothinahat 2 года назад
This is so cool I was just trying to do this in my own game!
@KyleLuce
@KyleLuce 2 года назад
Oh nice you wrote a behavior tree plugin! I was thinking of doing this eventually, so you probably saved me a bunch of time :)
@vinicios181000
@vinicios181000 Год назад
Thank you for the tutorial and the lib, however you go too much fast... Quick tutorials are great to explain simple things, but honestly I watch this video many times and just wasnt sucessfull to understand the whole thing
@bitbraindev
@bitbraindev Год назад
Thank you for your feedback! In future, I will try to do less content per video but go slower/more in depth!
@mirage3dee
@mirage3dee 2 года назад
Well done. Beautifully simple implementation.
@DocMinemomo
@DocMinemomo Год назад
Nice Tutorial~ It helps me alot! But I still have a problem in Beehave Version 1.2.0 , When I added a ConditionLeaf node or ActionLeaf node , There is a "Condition.gd" Script attached on them, I already know that I can add my own script by click "Extend script", but Is there any way to generate a script contains tick function and classname automatically?
@ezrawallet
@ezrawallet 2 года назад
I’d love to see complex enemy pathfinding in another video - my top down game often has enemies get stuck on corners when they chase the player and it can be kind of easy to cheese them.
@bitbraindev
@bitbraindev 2 года назад
I am actually planning to build exactly that as a separate tutorial soon! The pathfinding in this demo is rather poor because the NavigationAgent2D in the Godot 3.5 RC while recording the tutorial was incomplete. Now, they fully cherry-picked also the navigation mesh and collision stuff from Godot 4 which definitely makes things easier.
@_gamma.
@_gamma. 2 года назад
@@bitbraindev will that also show creating the various nodes for use in the tree? Love the addon but I’m having some trouble wrapping my head around it
@Noobrzor
@Noobrzor 2 года назад
bitbrain? More like petabytebrain! Thanks for the tutorial!
@bitbraindev
@bitbraindev 2 года назад
01010100 01101000 01100001 01101110 01101011 01110011 00100001
@andrewallbright
@andrewallbright 2 года назад
(1) event driven behavior trees... How do they work? (2) backchaining... Is it just a way of building a behavior tree or is it a way of simulating a GOAP? (3) when is it appropriate to represent my behavior tree as a tree graph in code? (4) why do some behavior tree implementations combine actions and conditions (sometimes called an action's precondition)?
@bitbraindev
@bitbraindev 2 года назад
Wonderful questions!
@andrewallbright
@andrewallbright 2 года назад
@@bitbraindev I have so many questions. I've spent time thinking and researching on behavior trees. They're magical things really.
@Bargeral
@Bargeral 2 года назад
The name "Beehave" does not show up in the godot asset store when searching Behavior or Tree. Might want to adjust it a bit. eg: Beehave (Behavior Tree)
@bitbraindev
@bitbraindev 2 года назад
Great suggestion! Thank you.
@FlorianHanke
@FlorianHanke 2 года назад
This is a very well done tutorial, thank you! One small improvement I'd make is to have nodes initialize themselves with relevant values (e.g. the stash_area), so the root does not need to know about what subnodes need. The way I'd do this in the _ready function of the root, it'd visit all subnodes and if they have for example an "initialize" method, it would call that with itself as param. Then, when a subnode's initialize is called, it could pick whatever relevant value (e.g. stash_area) and set it on itself.
@bitbraindev
@bitbraindev 2 года назад
Great thinking! Another idea I had was to follow the "signal up, call down" methodology more. And then using an event bus to communicate information from within the behaviour tree outwards.
@kerlisgray3539
@kerlisgray3539 2 месяца назад
I rreally like concept of making games but getting money from it is the difficult part.
@clecioespindolagamedev
@clecioespindolagamedev Год назад
Hj, can I use your tutorial as a base to create a portuguese version of this content? I won't do the same, but use it as a reference, adding my concernes and tips. And of course crediting your channel.
@GarethSomers
@GarethSomers 2 года назад
At 5:45 you appear to add a SelectorComposite but don't mention it (afaik).
@bitbraindev
@bitbraindev 2 года назад
Yeah, this is a small video script issue that I only noticed after uploading! We have to wrap it into a selector condition to make the entire condition work properly and I forgot to mention it during the recording. I hope the video makes sense regardless! Thanks for raising this. I will add a small footnote on the pinned comment!
@BeThoR94
@BeThoR94 2 месяца назад
First of all, I want to thank you for this great tutorial. I have a question though, I think I might be misunderstanding how each node works, but the documentation explains that when a child of a sequence node returns "running" both sequencecomposite and sequencestarcomposite Tick Again. Looking at the code in the demo project I can see that the behavior is as explained in the video, but I think that is not reflected in the documentation. Can you clarify this point? Please.
@bitbraindev
@bitbraindev 2 месяца назад
The logic is wrong in the demo. The documentation is correct.
@ВикторТаланцев-д8ж
Вы забыли добавить логику, что если мишень уже занята другим рабочим, то он не имеет права его трогать, иначе 10 лесорубов режет коноплю, это не хорошо, как и другое поведение, если лесоруб знает, что ящик полон, то не уничтожайте его, а сбрасывайте на пол и отправляйтесь отдыхать.
@bitbraindev
@bitbraindev 2 года назад
That makes sense! For anybody unaware: I haven't considered that certain trees might be "busy" already by other workers. Additionally, boxes should be dropped on the ground rather than being destroyed, when there is no more space available.
@Necrincito
@Necrincito 4 месяца назад
Hello, Tutorial system (trees) that fall when felling, with which the player plays the felling animation, when the number of times (felling) reaches the tree, it plays an animation that makes it fall and drop objects. Could you create a video tutorial, showing the entire procedure? please
@Necrincito
@Necrincito 4 месяца назад
Game 2d
@jazpaa
@jazpaa 8 месяцев назад
This tool looks great, but I find the tutorial somewhat confusing, perhaps because it is so fast. Then again, I'm kind of a newbie, haha. An updated tutorial would be sweet though.
@bitbraindev
@bitbraindev 8 месяцев назад
The tutorial certainly is not aimed at absolute beginners. I wish there was an easier way to highlight this. Perhaps I should start using terms such as 'Beginner' and 'Intermediate' in the video titles.
@megalukes
@megalukes 10 месяцев назад
Hey there, bitbrain. Is there a tutorial about behaviour trees you would recommend for an absolute beginner? I've considering using behave for managing NPC conversations in my project, but I still feel I lack a good foundation about all of these nodes like selectors and decorators. Thank you so much!
@sassafras2336
@sassafras2336 10 месяцев назад
Any word on a 4.x tutorial? Love the plugin but struggling with limited resources as a newbie
@bitbraindev
@bitbraindev 10 месяцев назад
There will be a 4.x tutorial, no idea when though.
@WilsonSilva90
@WilsonSilva90 Год назад
The source code for the starting project is no longer accessible. Did you make it private?
@bitbraindev
@bitbraindev Год назад
it should be accessible again! Had to do some changes to the assets! github.com/bitbrain/godot-tutorials
@davisantos5672
@davisantos5672 Год назад
If I find this tutorial useful? I'd hug you
@olmrgreen1904
@olmrgreen1904 2 года назад
Awesome video! Thanks!
@longuemire748
@longuemire748 3 месяца назад
Thank you for this tutorial. Excuse me, but it's easy to transpose to another tree behaviour? I'd like to do it with limbo on Godot?
@bitbraindev
@bitbraindev 2 месяца назад
That should be doable, yes.
@longuemire748
@longuemire748 2 месяца назад
@@bitbraindev thank you, i bought the sunnyside world pack but i can't find the png: "sunnyside_world_chatacter_anim_GOBLIN.png". Did you make it?
@mohokhachai
@mohokhachai 7 месяцев назад
I spent 5 years in Opsive studio
@CirculensProductions
@CirculensProductions 7 месяцев назад
Beautiful tutorial, it helped me so much to understand the chapter 6 of game ai pro book
@BartoszBielecki
@BartoszBielecki Год назад
Couldn't we add a tool based on node (like shaders) API?
@yayvey
@yayvey 10 месяцев назад
This is still very valuable information. Thank you!
@Rioni
@Rioni Год назад
Is there some way to always run a node at the end of the sequence? I was using a always succeed decorator, but that doesn't work when the node is running. I'm not sure if what I want is even possible or if I should check other approach
@bitbraindev
@bitbraindev Год назад
This will work by using a parallel node: github.com/bitbrain/beehave/issues/58
@Rioni
@Rioni Год назад
@@bitbraindev Oh cool! This feature highly interests me, once I finish the current PR I'll slowly look into that one, I think I can add some help there
@zephy6446
@zephy6446 2 года назад
Hey loved the video! What godot theme is that?
@bitbraindev
@bitbraindev 2 года назад
Here you go! github.com/bitbrain/godot-dash
@zephy6446
@zephy6446 2 года назад
@@bitbraindev Its so freakin nice thank you bro!
@alextkd2003
@alextkd2003 11 месяцев назад
Please more tutorials about this plugin 🙏🙏
@dbseraph
@dbseraph Год назад
is there a simple way to replace the grayscale assets from the project file with the color assets from your asset pack, or a guide for which ones to replace them with? the names don't seem to all match. also for the grayscale goblin anim sprite?
@bitbraindev
@bitbraindev Год назад
I may need to write up a guide how to replace it. My future tutorials will use an open-source spritesheet/sprites that is not proprietary.
@xcoder2205
@xcoder2205 11 месяцев назад
When will there be a tutorial for 4.x?
@bitbraindev
@bitbraindev 11 месяцев назад
Hopefully soon!
@adamprogramming1111
@adamprogramming1111 Год назад
If i destroyed trees and went to another scene and came back they restore their state. How can i make them continue through changing scenes?
@bitbraindev
@bitbraindev Год назад
You will need to build a savegame system! Or keep the scene in-memory.
@nobodyinparticular80
@nobodyinparticular80 Год назад
Woah, this went over my head @_@
@horohoro1836
@horohoro1836 2 года назад
Good work. Thank you ^^ (abo auch direkt dagelassen ;D)
@EnexileRaven
@EnexileRaven Год назад
Great video! Questions, it appears the assets are gray and blurry. what happened?
@bitbraindev
@bitbraindev Год назад
The assets are paid and cannot be stored on Github, so you'll have to buy them if you want the original ones: danieldiggle.itch.io/sunnyside I will try to use free assets for future tutorials.
@AdamBechtol
@AdamBechtol Месяц назад
Thanks.
@mythology100
@mythology100 Год назад
@bitbraindev been studying and practicing your addon for developing enemy AI for a top-down shooter game. Has been boggling me why Godot 4 does not have such a system backed into it, but this has been a welcoming lesson. Still need to understand a few more things to make a better enemy AI behavior. Wishing you the best in the future!
@bitbraindev
@bitbraindev Год назад
Thanks a lot! If you have any ideas or feedback on the addon feel free to create a discussion or issue on Github: github.com/bitbrain/beehave/discussions/new?category=ideas
@DenzelWashingMachine
@DenzelWashingMachine 2 года назад
Works in 3.5 until the end. Lumberjack and Trader both have the proper .gd script but Forester does not have a gd script and uses behave root as default. The other two ai work as intended but the forester glitches out at front of his house. Not sure this is intended but otherwise good tutorial.
@bitbraindev
@bitbraindev 2 года назад
This tutorial will not work with Godot 3.4.x and below, as it is using new components of 3.5 under the hood!
@KaletheQuick
@KaletheQuick 2 года назад
Ok, but lets not just gloss over how cute thes goblins are :3
@bitbraindev
@bitbraindev 2 года назад
These are created by Daniel Diggle! danieldiggle.itch.io/sunnyside
@AFE-GmdG
@AFE-GmdG Год назад
This is a really cool and helpful addon! Thank you for your hard work. How does this work in Godot 4? Do you already upgrade the addon to it or do you have a time planned?
@bitbraindev
@bitbraindev Год назад
The addon supports Godot 4, yes! However, the tutorial codebase is not upgraded (yet)
@kunai9809
@kunai9809 2 года назад
little question: can I count on you that you maintain this plugin and I don't have to worry that it will be unusable at some point? Or rather, how likely is that. I understand that you probably won't give any guarantees :D
@bitbraindev
@bitbraindev 2 года назад
This plugin will be maintained long-term, as I am actively using it in my RPG which will be in development for many more years. Oh, and it also supports Godot 4 already!
@kunai9809
@kunai9809 2 года назад
@@bitbraindev niiice
@_gamma.
@_gamma. 2 года назад
Will have to check out this addon, love the name!
@KlausWulfenbach
@KlausWulfenbach 2 года назад
Do you really need to make the inverter a node, or could you add an exported boolean to condition nodes that inverts the logic?
@bitbraindev
@bitbraindev 2 года назад
Of course you could but it would make things less obvious. During debugging, to fully understand what is happening you'd need to check every node and see if it had the flag activated or not. The goal here is to make things explicit within the node tree view itself.
@vojtastruhar8950
@vojtastruhar8950 Год назад
This is mind blowing. Great job!!! Can't wait to try this out
@bitbraindev
@bitbraindev Год назад
Thank you! New tutorial hopefully dropping next week.
@sirnad7813
@sirnad7813 2 года назад
We need more about AI movement ❤✊
@sparky8251
@sparky8251 2 года назад
I'd love to see a rimworld style behavior tree setup, where there is a global list of things to do and each villager will attempt to do them in a specific order based on user set priorities. Is that even something this addon can handle?
@bitbraindev
@bitbraindev 2 года назад
Technically, yes. However, it would require an additional abstraction on the setup side.
@sparky8251
@sparky8251 2 года назад
If you ever make a tut on it, I'd appreciate it at least :)
@mohokhachai
@mohokhachai Год назад
😎
@matt1871
@matt1871 2 года назад
I'd love to see an in-depth travelling NPC merchant/trader video. It's really something I'm struggling to find a good video on! I loved this one, thanks so much 😄
@API-Beast
@API-Beast Год назад
Oh, wow, this is really good! Good job dude.
@bitbraindev
@bitbraindev Год назад
Thank you! I am working on an updated video for Godot 4 that dives a bit more into the mechanics of behaviour trees.
@languagelearningexperience6814
@languagelearningexperience6814 2 года назад
Awesome explanation
@AdemOmerovicBA
@AdemOmerovicBA 11 месяцев назад
My man, you made an add-on for a thing that I needed ❤
@bitbraindev
@bitbraindev 11 месяцев назад
Glad beehave is useful to you!
@adibrahman9297
@adibrahman9297 2 года назад
Awesome 👍🏾
@andrewgrinn3435
@andrewgrinn3435 2 года назад
Nice
@ezenki9484
@ezenki9484 2 года назад
what is this godot ui that you are using, great tutorial btw
@bitbraindev
@bitbraindev 2 года назад
Here you go! github.com/bitbrain/godot-dash
@ezenki9484
@ezenki9484 2 года назад
@@bitbraindev is it possible to install it without the steam version of godot or is it only available for the steam version
@bitbraindev
@bitbraindev 2 года назад
@@ezenki9484 this should work for any Godot installation. If you have difficulties, please raise an issue on the Github issue tracker, please!
@ThunderPlayStudios
@ThunderPlayStudios 2 года назад
this video is gold
@bitbraindev
@bitbraindev 2 года назад
Thank you!
@KlausWulfenbach
@KlausWulfenbach 2 года назад
So I installed 3.5 RC 7, and everything works pretty well. But I'm totally tattling to the other commenters that there's 40 leftover warnings by the end. Mostly "The argument 'blackboard' is never used in the function 'tick'. If this is intended, prefix it with an underscore: '_blackboard'".
@bitbraindev
@bitbraindev 2 года назад
These warnings are normal and are purely about code style. Nothing to worry about.
@JamesKelly89
@JamesKelly89 2 года назад
I love your accent. I could listen to you reading the phone book (for Gen-Z: it's a literal paper book full of names and associated phone numbers).
@bitbraindev
@bitbraindev 2 года назад
Thank you!
@jumpsneak
@jumpsneak 2 года назад
Basicly reinventing programming for people who do not want to be programming in code
Далее
I Took An iPhone 16 From A POSTER! 😱📱 #shorts
00:18
Finite State Machines in Godot 4 in Under 10 Minutes
7:16
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
Просмотров 524 тыс.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 598 тыс.
5 Games Made in Godot To Inspire You
5:01
Просмотров 34 тыс.
The Best Games from GMTK Game Jam 2024
23:45
Просмотров 456 тыс.
Godot 4: Enemy AI using Behavior Trees (BeeHave)
21:04
The 7 Greatest TIPS for Any Godot Developer
5:19
Просмотров 54 тыс.