Enemy AI Series 1: The State Machine
ฝัง
- เผยแพร่เมื่อ 5 มิ.ย. 2024
- -- Social --
Discord: the discord server has been shut down, sorry!
Twitter: / garbaj2
-- Links --
Github: github.com/GarbajYT
-- About --
Dummy Model: github.com/GarbajYT/video-gam...
State Machine Template Code: github.com/GarbajYT/godot-bas...
Today we begin a brand new tutorial on this channel where we cover artificial intelligence and how to create AI in your video game projects. In this Godot tutorial, we're learning about the foundation on top of which all game AI is built: The State Machine. - เกม
I sincerely think that state machine is one of the most important topics to learn in game dev.
I agree, it's so useful!
Awesome! Thoroughly looking forward to the rest of this series!
Thanks!
somehow in just love with your tutorial... you are an amazing tutor and a guide... Hope to really amazing stuff from you(greedy). though you have already made some really amazing tuts!!!
Thanks for your support!
@@garbaj you deserve so much more from youtube man
Finally! I've been stuck with trying to make the AI for my game work for weeks and every tutorial just told me what to do instead of actually teaching how it works.
Your video is a godsent. Thank you so much.
11:34 *yanderedev has entered the chat*
lol
Hah!
Just found your channel yesterday and holy shit this is great stuff! I am learning a lot more than I have from other tutorials
Welcome! Glad you're finding my videos helpful
Such an amazing explanation! Can't wait for the rest of the series!
great job explaining some programming basics and common approaches. I'm more of an animator and 3D guy than programming. I've decided to make something in VR using Godot, so I watch every vid you make, because you are such a great teacher. Really appreciate your efforts.
State machine ??
Finally !!
Please make player state machine in the next video, can you make it with 3rd person ? Its more easy to see player action i think
I can’t understand at other video tutorial,
Your explanation was easy to understand
I’m joining your discord !
🥳
Thank you! Also, this state machine can be used for anything, including player characters and 3rd person as well. It's all the same
th-cam.com/video/LaNaTmYq3kY/w-d-xo.html there is a download link for 3rd person controller.
JamesXXXYZ thanks alot !!! Really u know what i looking for 👍🏻
love how you explain everything!
Just trying to do my best!
Thanks, Garbaj. This was really helpful in me making my basic patrolling AI that uses raycasts to detect collisions.
Please continue all of these amazing and clear tutorials please please
Thank u soo much
I have some difficulty in stuff like this
And what u are doing helps me a lot
I can finish earlier as well as learn tons of stuff
Again, Thank u man :-)
Hey! Glad my videos are helping you
Very simple and very helpful, thanks for the tutorials
Glad it helped!
Garbaj != garbage
state isTrue == TRUE
Awesome stuff as usual. One's trash may be another's treasure - would agree considering this video.
Excellent example and discussion - topic & delivery 10/10.
Wow, thanks for the words of encouragement! I'll continue to do my best
This was really easy to understand! Another amazing tutorial.
I watched state machine videos before but never understood the topic State Machines this better
The way your explain is so good
Keep making more videos
Just found this today,man this is what I needed fam
your tutorial is so easy to understand, thanks
I'm glad i found this channel. Plus you update your code.
So happy to see that the first clip of gaming used in a video titled about creating AI, is Halo Combat Evolved. The best enemy AI in any FPS ever!
TYSM YOUR TUTORIALS ALWAYS GET THE JOB DONE 99.99% OF THE TIME
Thank you very much for your educational sharing. I wish you Health and Success.
Thanks, much appreciated
Bro, this is a very good tutorial, this is very well explained! keep making these vids!
Thanks, will do!
You're the best ONE to make Godot tutorials
Thanks!
Thank you for your videos, bro! :)
You're welcome
Im really thankful
Thank you so much for another great tutorial.
You're welcome!
AI gets me excited instead of nervous
Great video!
why is this channel so small? It deserves way more subs i think.
Start sharing this like crazy people! Indie game devs need to know that these tutorials exist!
Thanks for the support! And yes, please share my videos with the world!
Yeah thats what exactly i did last year with gamemaker in 2d fighting game, i use health and stamina to take decision for the AI, if AI health less than 1 then ai will do something or if gun low ammo then ai will do something 👍 keep that good work bro
Subbed and amazed . Love Turkey
Thanks for the sub, glad to help!
Thank you for telling me there is more then IF and ELSE
this is great
PLZ make more and more and more ..... Keep them coming. A BIG SUBSCRIBE FOR YOU !!!
Appreciate the sub! Welcome to the channel
ТЫ красава,успехов тебе
благодарю вас
IT IS SO F GODD TUTORIAL!!!!!!! perfect
Nice :D
If your getting into fairly advanced stuff, its worth looking into Behavior Trees, which dont have a lot of the downsides of state machines. That said there aren't a lot of good implementations of behavior trees on Godot. (The one I use I had to hack extensively to implement a blackboard. One of these days I'll either push the changes back, or upload it myself, but its a bit of a dirty hack that needs some cleaning.
Thank you
You're welcome!
Thank you for the tutorials. Can you please do a ragdoll setup and ingame usage ? Thanks
Hope to do a video on this soon
eres el mejor
Aw looks like this series kinda died, shame. Love your content in general man, keep making awesome videos!
spartans assemble
Pro you grate
It's perfect aside from the fact that the states are still smeared across the logic. The better way would be have different functions as states and run those functions in the match/case (switch) statements. Each function would have their own logic and animation.
Oh wow, I wish I've watched this *before* I implemented my super crappy state machine based on strings rather than enums...
you the best
Thanks!
I have a problem in line 19 if raycast.is_colliding( ): it is saying its a debugging error : Attempt to call function 'is_colliding' in base 'null instance' on a null instance . I'm new to programing so don't know what any of dat means so can u pls help
Can you simulate viewing cone with raycasts? Position should be where the eyes are and in the idle state, enemy should look in random directions. When enemy detect the player he should turn to the player (while moving?).
Yes, you can. It requires some math that I don't understand, but it's definitely possible
Is the game that u played the first made with godot. By the way amazing tutorial
No, that's Halo: Combat Evolved, made by Bungie for Xbox
Oh
Ive been using Godot for years and didnt realize I dont have the give the Enumerator a name lol I usually do something like
enum PlayerState = {
IDLE,
WALKING,
JUMPING
}
then call it like state = PlayerState.IDLE
it's probably a good idea to name them so things don't get mixed up, but yeah you don't actually have to do it
i have a problem in 11:00 the dummy doesnt play the animation when the raycast is collision help
I wish you make tutorial on export game in godot
I made a simple game in godot and after exporting it ..it can't change the menu sean to the game sean
I want to write it in c# , if i follow along your videos and just change syntax to c# , is it enough for it to work? Why wont you write your game code in c#?
I don't know if it's just a matter of changing the syntax. I'm clueless when it comes to C#
Can u do an item or inventory system, i-if it's not to much.
Hope to do this eventually, just gotta learn how
can i make him chase the character? please show me how
this is really good, but how is an enumerator better than an array?
It's not necessarily better, but being able to refer to a state by it's name rather than by it's array index is a little easier to explain in a tutorial
How could you read my mind???
Muahahahaha!
.......plot twist i was thinking the same thing
Ikrr
6:46 how to get that code in my case?
"Can't we just use a bunch of if statements instead?" No Yandere dev, go away
0:45 Squid game?
How to import .blend model in godot?
You first need to export the model to a 3d format (obj, gltf, dae) before you can import it into Godot. A .blend file by itself wont import
@@garbaj Thank you! Which 3d format is better to choose?
First