Это видео недоступно.
Сожалеем об этом.

Enemy AI Series 1: The State Machine

Поделиться
HTML-код
  • Опубликовано: 3 авг 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.

Комментарии • 104

  • @rafaelgpontes
    @rafaelgpontes 4 года назад +25

    I sincerely think that state machine is one of the most important topics to learn in game dev.

    • @garbaj
      @garbaj  4 года назад +5

      I agree, it's so useful!

  • @_mickmccarthy
    @_mickmccarthy 4 года назад +27

    Awesome! Thoroughly looking forward to the rest of this series!

    • @garbaj
      @garbaj  4 года назад +3

      Thanks!

  • @jlewwis1995
    @jlewwis1995 3 года назад +38

    11:34 *yanderedev has entered the chat*

  • @mr0o
    @mr0o 4 года назад +10

    Just found your channel yesterday and holy shit this is great stuff! I am learning a lot more than I have from other tutorials

    • @garbaj
      @garbaj  4 года назад +1

      Welcome! Glad you're finding my videos helpful

  • @ishkapoor7931
    @ishkapoor7931 4 года назад +33

    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!!!

    • @garbaj
      @garbaj  4 года назад +1

      Thanks for your support!

    • @raghavendrabhat6035
      @raghavendrabhat6035 3 года назад +2

      @@garbaj you deserve so much more from youtube man

  • @davidfilus1741
    @davidfilus1741 2 года назад +3

    Such an amazing explanation! Can't wait for the rest of the series!

  • @BrianRogers3D
    @BrianRogers3D 3 года назад +3

    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.

  • @nightcode3171
    @nightcode3171 4 года назад +9

    Very simple and very helpful, thanks for the tutorials

    • @garbaj
      @garbaj  4 года назад

      Glad it helped!

  • @yamen._.m
    @yamen._.m 4 года назад +3

    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 :-)

    • @garbaj
      @garbaj  4 года назад +2

      Hey! Glad my videos are helping you

  • @bity-bite
    @bity-bite 4 года назад +12

    love how you explain everything!

    • @garbaj
      @garbaj  4 года назад +1

      Just trying to do my best!

  • @sigitsatriap6505
    @sigitsatriap6505 4 года назад +18

    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 !
    🥳

    • @garbaj
      @garbaj  4 года назад +5

      Thank you! Also, this state machine can be used for anything, including player characters and 3rd person as well. It's all the same

    • @jamesxxxyz8775
      @jamesxxxyz8775 4 года назад +1

      ruclips.net/video/LaNaTmYq3kY/видео.html there is a download link for 3rd person controller.

    • @sigitsatriap6505
      @sigitsatriap6505 4 года назад

      JamesXXXYZ thanks alot !!! Really u know what i looking for 👍🏻

  • @UlfgrimRaneth
    @UlfgrimRaneth 2 месяца назад

    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.

  • @denizdemir9255
    @denizdemir9255 4 года назад

    This was really easy to understand! Another amazing tutorial.

  • @nomadic_shadow
    @nomadic_shadow 2 года назад

    Thanks, Garbaj. This was really helpful in me making my basic patrolling AI that uses raycasts to detect collisions.

  • @drew230
    @drew230 3 года назад +1

    Just found this today,man this is what I needed fam

  • @shakthinandan7124
    @shakthinandan7124 3 года назад

    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

  • @warriorsimplicity1
    @warriorsimplicity1 4 года назад +1

    You're the best ONE to make Godot tutorials

    • @garbaj
      @garbaj  4 года назад +1

      Thanks!

  • @jesustzinon
    @jesustzinon 4 года назад

    Bro, this is a very good tutorial, this is very well explained! keep making these vids!

    • @garbaj
      @garbaj  4 года назад

      Thanks, will do!

  • @mlnz2991
    @mlnz2991 3 года назад

    your tutorial is so easy to understand, thanks

  • @notplushh
    @notplushh 3 года назад

    TYSM YOUR TUTORIALS ALWAYS GET THE JOB DONE 99.99% OF THE TIME

  • @travisratto5418
    @travisratto5418 2 года назад

    I'm glad i found this channel. Plus you update your code.

  • @vatan2578
    @vatan2578 4 года назад +2

    Thank you very much for your educational sharing. I wish you Health and Success.

    • @garbaj
      @garbaj  4 года назад

      Thanks, much appreciated

  • @NOPerative
    @NOPerative 4 года назад +16

    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.

    • @garbaj
      @garbaj  4 года назад +2

      Wow, thanks for the words of encouragement! I'll continue to do my best

  • @nicholasdellipaoli226
    @nicholasdellipaoli226 Год назад

    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!

  • @pascalcasier959
    @pascalcasier959 4 года назад

    Thank you so much for another great tutorial.

    • @garbaj
      @garbaj  4 года назад

      You're welcome!

  • @arturbrilliant
    @arturbrilliant 4 года назад +2

    Thank you for your videos, bro! :)

    • @garbaj
      @garbaj  4 года назад

      You're welcome

  • @disdis6127
    @disdis6127 3 года назад +1

    Great video!

  • @mahmoud_ali_963
    @mahmoud_ali_963 4 года назад

    Im really thankful

  • @luh034
    @luh034 3 года назад

    why is this channel so small? It deserves way more subs i think.

  • @redsnow579
    @redsnow579 4 года назад +1

    Start sharing this like crazy people! Indie game devs need to know that these tutorials exist!

    • @garbaj
      @garbaj  4 года назад

      Thanks for the support! And yes, please share my videos with the world!

  • @HalfAsleepSam
    @HalfAsleepSam 2 года назад

    AI gets me excited instead of nervous

  • @drbjbpog9956
    @drbjbpog9956 2 года назад

    this is great

  • @classicguy7813
    @classicguy7813 4 года назад +1

    Subbed and amazed . Love Turkey

    • @garbaj
      @garbaj  4 года назад

      Thanks for the sub, glad to help!

  • @NgaeGameStudio
    @NgaeGameStudio 3 года назад

    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

  • @enclonstudio2525
    @enclonstudio2525 4 года назад +2

    ТЫ красава,успехов тебе

    • @garbaj
      @garbaj  4 года назад +1

      благодарю вас

  • @lezharayman9897
    @lezharayman9897 4 года назад +1

    PLZ make more and more and more ..... Keep them coming. A BIG SUBSCRIBE FOR YOU !!!

    • @garbaj
      @garbaj  4 года назад

      Appreciate the sub! Welcome to the channel

  • @heawon78
    @heawon78 4 года назад

    Thank you

    • @garbaj
      @garbaj  4 года назад

      You're welcome!

  • @Evangelion09
    @Evangelion09 2 года назад

    IT IS SO F GODD TUTORIAL!!!!!!! perfect

  • @handsome_lad
    @handsome_lad 4 года назад +1

    Nice :D

  • @christianbatista0
    @christianbatista0 2 года назад

    Thank you for telling me there is more then IF and ELSE

  • @DuhKoreGames
    @DuhKoreGames Месяц назад

    needs a godot 4 update to this series!

  • @shayneoneill1506
    @shayneoneill1506 3 года назад +5

    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.

  • @juancarlosblanco5259
    @juancarlosblanco5259 2 месяца назад

    eres el mejor

  • @unfa00
    @unfa00 3 года назад

    Oh wow, I wish I've watched this *before* I implemented my super crappy state machine based on strings rather than enums...

  • @justalemur5285
    @justalemur5285 4 года назад +1

    you the best

    • @garbaj
      @garbaj  4 года назад +1

      Thanks!

  • @mahmoud_ali_963
    @mahmoud_ali_963 4 года назад

    Pro you grate

  • @ahmadtakhimi6839
    @ahmadtakhimi6839 4 года назад

    Thank you for the tutorials. Can you please do a ragdoll setup and ingame usage ? Thanks

    • @garbaj
      @garbaj  4 года назад +1

      Hope to do a video on this soon

  • @FletcherGaddy
    @FletcherGaddy 2 года назад

    Aw looks like this series kinda died, shame. Love your content in general man, keep making awesome videos!

  • @OmegaF77
    @OmegaF77 2 года назад

    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.

  • @abhishek-farswan
    @abhishek-farswan 2 года назад

    spartans assemble

  • @Chevifier
    @Chevifier 3 года назад

    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

    • @garbaj
      @garbaj  3 года назад

      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

  • @s.s.scriptties
    @s.s.scriptties 3 года назад +1

    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

  • @seopterleo7934
    @seopterleo7934 3 года назад

    Is the game that u played the first made with godot. By the way amazing tutorial

    • @garbaj
      @garbaj  3 года назад

      No, that's Halo: Combat Evolved, made by Bungie for Xbox

    • @seopterleo7934
      @seopterleo7934 3 года назад

      Oh

  • @jamesxxxyz8775
    @jamesxxxyz8775 4 года назад

    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?).

    • @garbaj
      @garbaj  4 года назад

      Yes, you can. It requires some math that I don't understand, but it's definitely possible

  • @ranjithrans
    @ranjithrans 4 года назад +1

    How could you read my mind???

  • @Fropaa
    @Fropaa 3 года назад

    i have a problem in 11:00 the dummy doesnt play the animation when the raycast is collision help

  • @mahmoud_ali_963
    @mahmoud_ali_963 4 года назад

    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

  • @jackthejzsc1629
    @jackthejzsc1629 2 года назад +1

    0:45 Squid game?

  • @gimong5537
    @gimong5537 3 года назад

    can i make him chase the character? please show me how

  • @nightcode3171
    @nightcode3171 4 года назад

    Can u do an item or inventory system, i-if it's not to much.

    • @garbaj
      @garbaj  4 года назад

      Hope to do this eventually, just gotta learn how

  • @judelingan5863
    @judelingan5863 3 года назад

    this is really good, but how is an enumerator better than an array?

    • @garbaj
      @garbaj  3 года назад +1

      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

  • @velot1eksedimoi417
    @velot1eksedimoi417 4 года назад

    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#?

    • @garbaj
      @garbaj  4 года назад +1

      I don't know if it's just a matter of changing the syntax. I'm clueless when it comes to C#

  • @warriorsimplicity1
    @warriorsimplicity1 3 года назад

    6:46 how to get that code in my case?

  • @roflman
    @roflman 3 года назад

    "Can't we just use a bunch of if statements instead?" No Yandere dev, go away

  • @vsevolod_pl
    @vsevolod_pl 4 года назад

    How to import .blend model in godot?

    • @garbaj
      @garbaj  4 года назад

      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

    • @vsevolod_pl
      @vsevolod_pl 4 года назад

      @@garbaj Thank you! Which 3d format is better to choose?

  • @mali-wp8wc
    @mali-wp8wc 4 года назад +1

    First