Finite State Machines in Godot 4 in Under 10 Minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 เม.ย. 2024
  • In this video we'll walk though the setup and creation of a Finite State Machine (FSM) in Godot 4.
    Finite State Machines are incredibly useful for managing simple states and transitioning between them. For this video we will look at an enemy with the states of wandering, following, and attacking. Then, we'll build the wander and follow states together in Godot.
    Resources:
    Additional State Machine tutorial by GDQuest: www.gdquest.com/tutorial/godo...
    Sprout Lands (Tilemap and character): cupnooble.itch.io/sprout-land...
    Dino (Dino): arks.itch.io/dino-characters
    Ending music: • The 25th Hour - Schlat...
    Chapters:
    00:00 Intro
    00:27 State Explanation
    01:06 Wander State
    01:28 Finite State Machine
    01:59 Godot Time
    02:07 Base State Setup
    02:28 State Machine Initial Setup
    03:55 Idle State Code
    04:40 Testing the Idle State
    05:08 Follow State Code
    05:40 Testing the Follow State
    05:58 Transitioning Between States
    06:34 Afterthought
    07:03 Cow
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 242

  • @ArksDigital
    @ArksDigital 8 หลายเดือนก่อน +135

    I started to notice a lot of traffic coming in from TH-cam and I think I just found one of the reasons why. Thanks for linking my sprites. 😊

    • @Bitlytic
      @Bitlytic  8 หลายเดือนก่อน +31

      Thanks for making such great sprites! They're one of the first ones I reach for when prototyping. I'm happy you don't mind me using them in a video like this

    • @LaBeIIe
      @LaBeIIe 2 หลายเดือนก่อน +3

      I feel like I've used your dinos for prototyping every platformer I've made, you're a legend within my group

  • @rashulsel
    @rashulsel 10 หลายเดือนก่อน +411

    so you are telling me that there is better way to manage code than writing 2000+ lines in single Gdscript?

    • @liondovegm
      @liondovegm 9 หลายเดือนก่อน +32

      ​@@impregnat0rjust write good code lulz
      (obv joke is obv)

    • @mohhamad3237
      @mohhamad3237 4 หลายเดือนก่อน

      😂😂😂

    • @rmt3589
      @rmt3589 4 หลายเดือนก่อน +16

      Can I get a side of garlic bread with that spaghetti code? 🍝 🍝 🍝

    • @sloppyglizzy8313
      @sloppyglizzy8313 3 หลายเดือนก่อน +3

      ⁠@@impregnat0rI mean if you are coding you should take it into consideration yourself. Also, most people don’t start coding with GDScript. Surely some do, but not the majority. In those instances they should already be familiar with scripts working in conjunction with one another. I’ve never thought to put all my lines in one single script, but I also am in school for computer science and have had an advantage of learning good habits because of that.

    • @asdfghjkl-jk6mu
      @asdfghjkl-jk6mu 2 หลายเดือนก่อน +1

      @@impregnat0r also the approach of using dictionaries in this tutorial is an inefficient method.

  • @Bitlytic
    @Bitlytic  10 หลายเดือนก่อน +156

    ERRATA
    - For the state class, the Process and Physics_Process functions are different than the built in _process and _physics_process functions. This should be clearer and I recommend using names like state_process and state_physics_process to avoid confusion.
    - 3:31, the enter and exit functions called off of current_state and new_state should be capitalized

    • @Theburninbeaver
      @Theburninbeaver 6 หลายเดือนก่อน +1

      THANK YOU!

    • @zysdota
      @zysdota 6 หลายเดือนก่อน

      Im confused, so is it supposed to be _process and _physics_process like in the video, or Process and Physics_Process like in the comment?

    • @Theburninbeaver
      @Theburninbeaver 6 หลายเดือนก่อน +2

      @@zysdota The main issue for me was my Exit and Enter functions weren't' capitalized

    • @nicowagner8655
      @nicowagner8655 5 หลายเดือนก่อน

      a good idea. Thank you for your great video. Ill propably input an "EnemyState" extending "State" as for my navigation code i am working with a NavMesh and the export values are already exploding

    • @nicowagner8655
      @nicowagner8655 5 หลายเดือนก่อน +1

      @@zysdotaas far as i understood he is using "Process" because it gives him more control as in the State Manager he then assignes _process()
      state_process is just a better name to differenciate it from the base godot class

  • @lowirq
    @lowirq 16 วันที่ผ่านมา +8

    If I hadn't known Finite State Machines for years beforehand, I would definitely know by now!
    Your concise concept & excellent explanation makes FSMs - an often over-complicated yet rather basic topic - easily understandable by beginners as well as intermediate developers IMHO.
    Awesome content quality I have rarely encountered with video tutorials, and especially on TH-cam.
    Nicely done, keep it up!

  • @OHTASISAN
    @OHTASISAN 9 หลายเดือนก่อน +226

    Just wanna say that you did a great job explaining everything. Lots of youtubers often forget to bridge the gap between what they know and what actual beginners know. In the military we used to call it "barney style". Directions given in a way that a child could understand, and under the assumption that an adult could then branch out and use these tools for a complex mission.

    • @csih2119
      @csih2119 8 หลายเดือนก่อน +10

      this is what everyone needs to adopt!

    • @Afreshio
      @Afreshio 7 หลายเดือนก่อน +6

      I concur. This youtuber has the good stuff in regards to teaching absolute beginners to understand things like State, Finite Machine State, etc.
      This channel is a treasure for indie godot devs.

    • @PhotoBomber
      @PhotoBomber 6 หลายเดือนก่อน +8

      definitely not a beginner tutorial, way too fast and didn't explain a lot of things, or maybe i'm just slow

    • @OHTASISAN
      @OHTASISAN 6 หลายเดือนก่อน +5

      @@PhotoBomber unfortunately tutorials are very general and you wont find perfectly catered material online or even in a classroom the only way you can achieve that is with a 1 on 1 tutor. i will say if it didnt make sense to come back to it after taking some notes and see if it comes together better with a different perspective. remember that learning how to code or really any skill has less to do with curriculum and more with immersion. aka if you want to learn how to code a game, the most efficient way is to actually code a game. along the way you will be able to identify what you know / don't know and then tutorials like this will become much more useful.

    • @PhotoBomber
      @PhotoBomber 6 หลายเดือนก่อน

      @@OHTASISAN I'm using chatgpt to learn to code, it's quite the 1 on 1 tutor, and catered to my preferences

  • @ShinSpiegel
    @ShinSpiegel 10 หลายเดือนก่อน +70

    I really love this tutorial,
    Simple straight to the point and very intuitive.
    Thanks for the amazing tutorial.

  • @88Factor
    @88Factor 7 หลายเดือนก่อน +14

    Please keep doing more Godot tutorials! Even as a total beginner who knows nothing about coding, I was getting something out of this.

  • @Haxses.
    @Haxses. 10 หลายเดือนก่อน +28

    I LOVE your Godot tutorials, I really hope you keep doing them!

  • @itsdabenji9518
    @itsdabenji9518 10 หลายเดือนก่อน +3

    I've watched so many tutorials on state machines and never understood them until now. Thank you very much!

  • @ArtyMartyD
    @ArtyMartyD 26 วันที่ผ่านมา +4

    Unashamed to admit I set the speed of the video to 0.75 and rewound the video dozens of times.

  • @allHailKingJulien
    @allHailKingJulien 10 หลายเดือนก่อน +36

    This is the most beautiful explanation of state machine I have come across. Kudos!

  • @Anisometry
    @Anisometry 3 หลายเดือนก่อน +3

    For anyone who is encountering an "invalid call" error, change the .exit() and .enter() at the bottom of the state machine scripts to .Exit() and .Enter() , this fixed all my issues.

  • @lucasenglish6641
    @lucasenglish6641 6 หลายเดือนก่อน

    I really like how the tutorial is fast paced but still gives enough info to understand the code

  • @TheCrybn
    @TheCrybn 6 หลายเดือนก่อน +2

    You have made the best Godot tutorials i have seen. You explain everything so clearly. Keep up the good work.

  • @kerrycodev
    @kerrycodev 10 หลายเดือนก่อน

    Such a simple and brief, straight to the point tutorial. I'd like to see more states as a part two, like one to circle/strafe around the player and attack, and maybe a second type of attack.

  • @inkweeper
    @inkweeper 3 หลายเดือนก่อน

    Long time had i suffered having no idea how to build such a state machine thing, before I found this.
    This tutorial is of great help. Thanks a lot for your work!

  • @quondamreveries7258
    @quondamreveries7258 7 หลายเดือนก่อน +4

    I want you to know that your Godot tutorials are very good, and that you should continue making more of them.

  • @4dragons632
    @4dragons632 10 หลายเดือนก่อน +9

    I dont even understand state machines yet, I used this purely for knowing how to make something which follows the player. Already its been an incredible help, given a few months of learning I imagine the other parts of this will help me too. For some reason the previous things I'd tried like 'get_root' and copying node path were not working and I don't know why. But this worked, and knowing about groups is good too!

  • @vicentvalls1647
    @vicentvalls1647 6 หลายเดือนก่อน +4

    Man, this tutorials are amazing. I subscribed and I'm waiting for more.
    Thanks

  • @josephsavio1972
    @josephsavio1972 9 หลายเดือนก่อน +1

    I do not comment that much on TH-cam videos. However I wanted to say that I wanted to learn how states machines were implemented on Godot and I never really grasped how. But this video that I found randomly explained perfectly the way. It changed my to make enemy AI. Thank you so much !

  • @saintnight9792
    @saintnight9792 10 หลายเดือนก่อน

    Got to say, this channel is truly underrated and it needs more audience, your videos so far are all I need for my new project using Godot 4. Thanks :)

  • @redshepard5306
    @redshepard5306 3 หลายเดือนก่อน

    I really hope these tutorials continue. I watch it slowed down a bit because you speak quickly, but your concise and informative so I subbed

  • @sloydd1800
    @sloydd1800 5 หลายเดือนก่อน

    This was one of the best videos on FSM. I hope you start to post more. like Player Movement / Attack and how you would handle that in a FSM.

  • @greg214tx2
    @greg214tx2 7 หลายเดือนก่อน +1

    Loved the video! Can't wait to get home to set it up. Thanks.

  • @stesproject
    @stesproject 10 หลายเดือนก่อน

    That's the most intuitive implementation of a finite state machine I've ever seen 👍

  • @theyellowarchitect4504
    @theyellowarchitect4504 6 หลายเดือนก่อน

    One of the best godot tutorial videos. In the past with Unity, I had built a very complicated state machine without any tutorials, and I wish I had seen something such as this, because I wouldn't have so much spagghetti (e.g. once the physics state machine was merged with AI behaviour, tech debt was sealed)

  • @MrDahunta
    @MrDahunta 7 หลายเดือนก่อน

    Nice. Very clean. It is also no problem to introduce more states and transitions between them.

  • @dondernerd
    @dondernerd 10 หลายเดือนก่อน

    Nicely explained.
    Will definitely use this one to show to others on the beginnings of a FSM!

  • @user-rb9uc8rz6y
    @user-rb9uc8rz6y 5 หลายเดือนก่อน

    thank you so much. this guide helped me alot. I ended up re-writing the whole player code but I've finally managed to implement player movement and auto attack system without weird ass bugs. so it was worth it!

  • @zombiecarz
    @zombiecarz 10 หลายเดือนก่อน

    My godot game and game dev skills grow stronger with every video! Thank you so much!

  • @nathanbanks2354
    @nathanbanks2354 6 หลายเดือนก่อน +6

    Good example! Nice and simple. I usually use an enum for the states instead of strings...though this can be mildly difficult in Godot since the enum has to be imported into everything somehow. For one project I had an autoload class just for all the enums, but I'm not sure this is the best way to do it. I like the way the editor knows what the states are called after because these are in the enum. Maybe it's not as simple, but I find it harder to mess up.

  • @omaryahia
    @omaryahia 5 หลายเดือนก่อน

    this is incredible🌟 thank you for all those clean useful concepts
    please make more Godot tutorials

  • @emovard3n
    @emovard3n 9 หลายเดือนก่อน +1

    I did not see such useful video for a while. Al three for Godot actually. Subscribed. So please do more :)
    It really helps me to structure knowledge I already have and get new tricks to use.

  • @tobinrysenga1894
    @tobinrysenga1894 7 หลายเดือนก่อน +1

    Just getting into Godot myself. Interesting use of nodes for the state machine.

  • @laby1827
    @laby1827 5 หลายเดือนก่อน +1

    Thanks for the tutorials ! I'm still new at Godot, you really helped me well !

  • @ashgtd
    @ashgtd 7 หลายเดือนก่อน

    Please keep making more the last 3 videos are amazing.

  • @andreypap3087
    @andreypap3087 9 หลายเดือนก่อน

    Finally! I find tutorial with good code. With early return implementation, value verification and without other smell code. It's simple and brilliant 👏

  • @risingpheonix7740
    @risingpheonix7740 2 หลายเดือนก่อน +1

    Super good video, great outline to start making Finite State Machines in a game. Used this with other tutorials to get a basic Idle/Run/Airborne state machine working in a 2D platformer. Great lesson overall!
    Took a little while to realise i needed to add "owner" as the prefix to a lot of values, as it's not the state nor statemachine that was holding the velocity and gravity variables, but the Player Object instead.

  • @jardorook8259
    @jardorook8259 10 หลายเดือนก่อน

    Thanks for this, really helped to see a bare bones example. Was able to easily adjust for 3D nodes

  • @DiSyllar25
    @DiSyllar25 10 หลายเดือนก่อน

    Great video, I was actually looking to clean up the way I handle state machines in my game, and this video is going to be very helpful!

  • @Slukke
    @Slukke 7 หลายเดือนก่อน

    Excellent guide, well done.

  • @pietricele
    @pietricele 10 หลายเดือนก่อน +2

    Great explanation, as always! 💙

  • @georgea.corman2226
    @georgea.corman2226 4 หลายเดือนก่อน

    Awesome explanation! This helped me out a lot! Good mix of theory, then demonstrating on how to put it into practice.

  • @CeePritch
    @CeePritch 6 หลายเดือนก่อน

    Top marks from me! I particularly like how you've approached decoupling the reference to the CharacterBody in the state by using an exported variable. This was always my gripe with other implementations and didng feel very clean at all.

  • @HamoodyDarbaDoody
    @HamoodyDarbaDoody 6 หลายเดือนก่อน

    Really love your tutorials. Hope you make more, im learning a lot from them

  • @virtual__
    @virtual__ 10 หลายเดือนก่อน +2

    I got into Godot literally yesterday, and I've already watched all your videos on it. You provide perfectly concise and understandable content. Thank you for doing what you do, will be looking forward to more!

  • @jack7cdusm7
    @jack7cdusm7 6 หลายเดือนก่อน

    HEY YO MY MAN
    im one of those that spends hours researching tutorials and i have a very large bone to pick with how the majority of people (even in great istitutions like universities) teaches things.
    and since others already pointed it out im not gonna repeat myself and just say: you u got som good shit goin.
    please keep on making godot/gamedev tutorials im sure your following will grow!
    and of course, thank you very much for the effort you put in making these videos!

  • @priziuss
    @priziuss 5 หลายเดือนก่อน

    This channel motivated me to start learning Godot the explanations are soooo good

  • @princeedhwardhezmi6469
    @princeedhwardhezmi6469 7 หลายเดือนก่อน

    I'm absolutely subbing and keeping this as my note on gd script thanks

  • @KevinNijmeijer
    @KevinNijmeijer 9 หลายเดือนก่อน +2

    Amazing tutorial! I would love to hear your explanation on concurrent state machines as that's still something I'm struggling with. (For instance: Having a bird enemy which can idle, wander, follow and attack, but also be on the ground or flying, without having to make 8 states in a single state machine)

  • @_trion
    @_trion 5 หลายเดือนก่อน

    Dude this is best tutorial for State machines!

  • @flowfrog101
    @flowfrog101 10 หลายเดือนก่อน

    Very quality video for such a small channel. Looking forward to more

  • @davidb4020
    @davidb4020 9 หลายเดือนก่อน

    Used the basics of it in my game. Great video thanks.

  • @ArtyMartyD
    @ArtyMartyD 26 วันที่ผ่านมา

    What I think is great about this tutorial is that you don't need to know about the way each state behaves. I like that this isn't the main focus as each state for each game is different for each game dev.
    At the same time, each state explained here is also extremely versatile due to it's simplicity so if you wanted to you could still use it and just iterate upon it later. But just to know how states work is quite wonderful.

  • @altf4216
    @altf4216 10 หลายเดือนก่อน +9

    man's literally fireship

    • @iothemighty
      @iothemighty 10 หลายเดือนก่อน +1

      not yet.... not enough memes

  • @jamesodonnell4771
    @jamesodonnell4771 4 หลายเดือนก่อน +1

    Wow thanks m8, this worked like a charm for my own project. I can't wait to keep building on it!
    With component architecture, Godot really is so unbelievably intuitive relative to other software.

    • @soundrogue4472
      @soundrogue4472 4 หลายเดือนก่อน

      Wait how did you get past the error with the transition?

    • @jamesodonnell4771
      @jamesodonnell4771 4 หลายเดือนก่อน

      @@soundrogue4472 What do you mean. Signals handle state transitions as per the video

  • @HarbingerSh
    @HarbingerSh 10 หลายเดือนก่อน +6

    Great tutorial! maybe you should make one about context-steering behaviour to make the enemy moves smarter around

  • @Mgbeatz_Icrowdx
    @Mgbeatz_Icrowdx 6 หลายเดือนก่อน

    a good tutorial that doesnt start with a 2hours intro , thank you

  • @NoelCav
    @NoelCav 9 หลายเดือนก่อน

    These videos are great. Cant wait for whatever you ake next.

  • @GameGW935
    @GameGW935 10 หลายเดือนก่อน

    I hope we are going to see more videos like this in the future from you.

  • @underscorerx
    @underscorerx 6 หลายเดือนก่อน

    Great tutorial. Eagerly waiting for your next one

  • @kboltiz
    @kboltiz 4 หลายเดือนก่อน

    As a code architecture and statemachines fanatic, I thank you for this.

  • @Qwasieee_P
    @Qwasieee_P 10 หลายเดือนก่อน

    One of the few good tutorials on godot

  • @zachnewby4739
    @zachnewby4739 4 หลายเดือนก่อน

    Thank you man! I'm going to use this!

  • @PaulGeraskin
    @PaulGeraskin 8 หลายเดือนก่อน

    Thank you, master!

  • @hiiambarney4489
    @hiiambarney4489 10 หลายเดือนก่อน +27

    Good Tutorial. However when it comes to somewhat beginner Tutorials like this one, I'm a big advocate of "Show, don't tell".
    The examples at the very end are certainly worth tackling, if not for code-re-usability and decoupling, which is a hard concept to grasp for game development.
    The Video being this short would certainly not be degraded by 3 more minutes of you showing these concepts, at least briefly.

  • @HeraldOD
    @HeraldOD 2 วันที่ผ่านมา

    Awesome video!
    A neat trick for switching states: using the return value from the state's process function instead of signals.
    That way, you can have @export variables for each state to define its next potential states, and return them to the state manager that does the switching
    This also removes the need for a dictionary!

  • @billwadsworth6102
    @billwadsworth6102 10 หลายเดือนก่อน +2

    Your video are so great! i really want to see more.

  • @FlummoxTheMagnificent
    @FlummoxTheMagnificent 10 หลายเดือนก่อน +2

    Holy shit this is actually really high quality

  • @Seckie
    @Seckie 8 หลายเดือนก่อน +11

    It would be awesome if you could provide the source code for this tutorial so it would be easier to reference ^.^

  • @indierusty
    @indierusty 10 หลายเดือนก่อน

    Thank you a lot! Excellent Explanation

  • @ShiloBuff
    @ShiloBuff 7 หลายเดือนก่อน +12

    This is one of the best tutorials and implementations I have ever seen.
    It's a shame that you haven't posted any recent videos as your content is very helpful. :(

    • @Bitlytic
      @Bitlytic  7 หลายเดือนก่อน +32

      I'm actually working on more videos! I'm just a terrible procrastinator

    • @ashgtd
      @ashgtd 7 หลายเดือนก่อน

      yeah! go go go@@Bitlytic

    • @pliniojrm
      @pliniojrm 7 หลายเดือนก่อน +1

      @@Bitlytic Please make a "Utility AI" tutorial video.
      I know how to create a Utility AI in Unity, but Godot structure is different and really mess with my way of thinking.

  • @TommyLikeTom
    @TommyLikeTom 2 หลายเดือนก่อน

    thanks so much for this. I'm currently splitting up my 2000 line single script into 10 smaller scripts

  • @holygod8440
    @holygod8440 8 หลายเดือนก่อน

    dude this is awsome

  • @lukazgarza4075
    @lukazgarza4075 3 หลายเดือนก่อน

    I don't think I ever learned things regarding Godot or coding as fast as I do here. Also I like your voice.

  • @rockyhitcha9604
    @rockyhitcha9604 6 หลายเดือนก่อน

    How a awesome tutorial! it's clear and useful. I am newbie in program and i can understand from this video. I really hope you keep doing them! I miss you Bro😄

  • @sarahpuspdew
    @sarahpuspdew 6 หลายเดือนก่อน

    hoping you could create a whole tutorial on this project you making a video of! your explanation is superb. thank you.

  • @AgnisNeZvers
    @AgnisNeZvers 10 หลายเดือนก่อน +8

    I used this approach for a while in situations when the `match` switch approach gets too complicated.
    In a project with action platformer controls this approach wasn't enough too. So I blended it with the behavior tree style - states having under states that get checked every frame if that will execute its logic for the current frame. Like PrimaryState (WallSlide, Fly up, Fall, Run, Idle) and JumpGroup( Walljump, JumpBuffer, DoubleJump, JumpDown, Jump). In a hierarchical order.
    Now I'm thinking about ways to improve it.

    • @zarblitz
      @zarblitz 10 หลายเดือนก่อน +1

      For me, the next step was to define hierarchical states so that shared behavior can be defined in ancestor states. For example, WalkState inherits TravelState. TravelState exports a speed property that it uses to determine velocity along with the input_direction property that it inherits from the DirectionInput state. Most of my states also are descended from an AnimationState which exports a property for the animation name, the animated sprite node, and starts the animation in the enter method.
      The downside to this approach in Godot 4 is that since there is no longer any implicit super() call, you need to remember to call that anytime you override one of the state methods, and as well check if the superclass logic returned a new state that you should transition to instead.
      Lastly, there's also no reason your StateMachine class can't also inherit State and be a state of its own with its own child states to further modularize your behavior, especially if there's cases you want to consider some external conditions and don't want to bloat your root state machine.

    • @jethdaflip7741
      @jethdaflip7741 7 หลายเดือนก่อน +1

      ​​@@zarblitz Do you guys use gdscript or C# for your code? Would writing state machines be better in one or the other? Do you have source code for your method? I'm just interested in learning how your method works.

  • @davigamer2144
    @davigamer2144 3 หลายเดือนก่อน

    More videos like this, this is great!!!

  • @sebastienmorin1858
    @sebastienmorin1858 3 หลายเดือนก่อน

    I thought this was a pretty great video. You are explaining things clearly and concisely. I didn't know how to implement it in Godot, and now I do :D So thanks for that!
    The only thing I think it's lacking, is focusing a little bit more on how to export those states outside of the state machine, even if you dedicated like a minute to this at the end of the video. In the video, the calculations for the Idle and Follow state are done inside the state itself, but in general, a state machine is also a tool to pass on an information that needs to be accessible for several systems. I feel like one might come to the conclusion that you need to move your code inside states scripts. When in reality, if you put a signal that emits "new state coming" at the end of the transition of the state machine, you can connect anything (like an Animation handler, a mouvement system etc.) so that they fire when the state is appropriate.
    Minute point nonetheless, I really liked that video, and I'll probably check out what you've done otherwise.

  • @Prog_Guy
    @Prog_Guy 3 หลายเดือนก่อน

    Amazing video man! It would be great if you'd go deeper into state machines, well done!

  • @drakenork
    @drakenork 3 หลายเดือนก่อน

    Great video! Thank you so much ♥

  • @tofuryu3567
    @tofuryu3567 4 หลายเดือนก่อน

    yes! I found the best godot tutorial ever

  • @NoNo-nu1cg
    @NoNo-nu1cg 21 วันที่ผ่านมา

    this video help me alot thank for makeing it :D

  • @JULIUSCOOLX
    @JULIUSCOOLX 9 หลายเดือนก่อน

    It worked perfectly I am going to use everyday and all Night

  • @LunarCelestial
    @LunarCelestial 6 หลายเดือนก่อน

    really hoping to see how to actually make attacks, with this (im new to godot).
    your video has helped me a ton on understanding anything tbh

  • @meraklmuskulpesent8313
    @meraklmuskulpesent8313 10 หลายเดือนก่อน

    Thanks, it really helped.

  • @Rovoary07
    @Rovoary07 10 หลายเดือนก่อน

    Wait more next video, I apreciate.

  • @arnarasyid5393
    @arnarasyid5393 7 หลายเดือนก่อน

    Really great video. But, atm my brain couldn't handle it XD. will go back to this vid later!

  • @phamphuphiphuong
    @phamphuphiphuong 9 หลายเดือนก่อน

    Very good! Please make "items system" tutorial (more scalable and simple like this tutorial)

  • @flamebeard10339
    @flamebeard10339 10 หลายเดือนก่อน +7

    ideally you would want to have the states to be independent of each other, since if you wanted to create a new enemy that instead of following, it runs away when the player you would have to make minor rewrites to your states to make it work. (Instead of using the same wander state, and just changing export variables for example)

    • @entropywilldestroyusall1323
      @entropywilldestroyusall1323 10 หลายเดือนก่อน +1

      In that case is it best for the machine itself to decide which state to transition to?

    • @flamebeard10339
      @flamebeard10339 10 หลายเดือนก่อน +1

      @@entropywilldestroyusall1323 you could either extend the state machine class for more complicated ai, or you could create an event listener that waits for a condition or a set of conditions ( probably just a signal) and then asks the standing to transition to another state

  • @tonnypedersen5915
    @tonnypedersen5915 10 หลายเดือนก่อน

    you can combine it with a Markov chain to determent what state is allowed to come next base on the current state.

  • @AzzuBananas
    @AzzuBananas 6 หลายเดือนก่อน

    I justa wanna ask if isn't better to manage the states from the enemy script, I'm learning how to code like this and I like it, but i think if you manage the transition directly in the enemy script the states are more reusables and don't force to move them to one state to another by default, what do u think?

  • @trulyinfamous
    @trulyinfamous 6 หลายเดือนก่อน

    Thank you for including captions in your tutorial. Almost no tutorials have captions, which can make it harder to follow, and especially harder to hear when the narration is quiet. The tutorial itself is too fast though, and could have used more examples. I got lost as to where the individual scripts went because you went too quickly.

  • @porkman1838
    @porkman1838 7 หลายเดือนก่อน

    Look up automata theory, if you design an automata first then program it into states. Highly recommended, I did it with SDL2.

  • @metapod3435
    @metapod3435 8 หลายเดือนก่อน

    Does this method mean I don't need to implement AnimationTree since it will travel in different nodes with different animations and functions?

  • @ForgeMaster1025
    @ForgeMaster1025 7 หลายเดือนก่อน

    So good’

  • @bjkloss
    @bjkloss หลายเดือนก่อน

    Watching this i felt like the Kel meme from Good Burger. "Yes I know some of these words".
    Im far too green at coding for this but saving it for later when hopefully I can understand more than the first 1.5 minutes.

  • @Fatalhck
    @Fatalhck 3 หลายเดือนก่อน +1

    Awesome tutorial, although the fast pace not typing kind of make it hard to do it at the same time, a lot of times I needed to pause and go back.

  • @billrazor6591
    @billrazor6591 7 หลายเดือนก่อน

    Godot 4 recently received a new add-on called LimboAi. It is designed to make it easier to create state machines for enemies in games. I wonder what would be your opinion about it (as an experienced developer). It looks really cool on paper, but their repository doesn't have much information on how to use this AI system. And I'm a newbie.