Finite State Machines in Godot 4 in Under 10 Minutes

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 382

  • @ArksDigital
    @ArksDigital Рік тому +576

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

    • @Bitlytic
      @Bitlytic  Рік тому +111

      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

    • @alt-q1y
      @alt-q1y 11 місяців тому +38

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

    • @ArksDigital
      @ArksDigital 7 місяців тому +29

      @@alt-q1y That honestly almost made me tear up...

    • @captainnelson9833
      @captainnelson9833 7 місяців тому +16

      @@ArksDigital My whole college class uses your sprites! :D They're too cute.

    • @bunnybreaker
      @bunnybreaker 5 місяців тому +3

      Yeah those dinos are super cute. I kinda wanna make a whole game using them (maybe one day) 🖤

  • @lowirq
    @lowirq 8 місяців тому +41

    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 UA-cam.
    Nicely done, keep it up!

  • @MartinB_Art_Design
    @MartinB_Art_Design 9 місяців тому +141

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

    • @mojojojo6535
      @mojojojo6535 6 місяців тому +18

      How else would you learn

    • @micahrobbins8353
      @micahrobbins8353 5 місяців тому +5

      I understand almost none of this. I tried to follow, but my brain keeps tuning out lol

    • @MartinB_Art_Design
      @MartinB_Art_Design 5 місяців тому +4

      @@micahrobbins8353 Do it in bite size amounts.

    • @SamuTheFrog
      @SamuTheFrog 3 місяці тому +23

      I don't think it's ya'll's faults... He does a lot of things in between the cuts and it really disrupts the flow of it.
      I found myself having to watch the same parts over and over again only to realize it's not working because he did something in between the cuts that I didn't notice.
      It's a truly awful way to approach a video like this, in my opinion.
      He's trying to streamline it but what actually ends up happening is critical steps become exceptionally easily overlooked.

    • @MartinKendrik
      @MartinKendrik 2 місяці тому +1

      I assume most people do

  • @rashulsel
    @rashulsel Рік тому +787

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

    • @liondovegm
      @liondovegm Рік тому +40

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

    • @MFJoyBoy
      @MFJoyBoy Рік тому +1

      😂😂😂

    • @rmt3589
      @rmt3589 Рік тому +36

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

    • @H3_remix
      @H3_remix 11 місяців тому +6

      ⁠@@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 11 місяців тому +2

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

  • @Bitlytic
    @Bitlytic  Рік тому +239

    UPDATE:
    For this video, I wasn't able to release the source code because of paid assets, but I have created a new project for my most recent video and it uses nearly an identical state machine. If source code would help, I highly recommend checking that out:
    github.com/Bitlytic/Strategy-GDScript/tree/master/Objects/Scripts/Enemy
    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 Рік тому +1

      THANK YOU!

    • @zysdota
      @zysdota Рік тому

      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 Рік тому +3

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

    • @nicowagner8655
      @nicowagner8655 Рік тому

      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 Рік тому +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

  • @Anisometry
    @Anisometry 11 місяців тому +33

    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.

    • @Ally-uj3di
      @Ally-uj3di 3 місяці тому +1

      It took me forever to discover this. Thank you so much!

  • @OHTASISAN
    @OHTASISAN Рік тому +292

    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 Рік тому +12

      this is what everyone needs to adopt!

    • @Afreshio
      @Afreshio Рік тому +7

      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 Рік тому +13

      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

      @@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 Рік тому

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

  • @ShinSpiegel
    @ShinSpiegel Рік тому +84

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

  • @88Factor
    @88Factor Рік тому +21

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

  • @HeraldOD
    @HeraldOD 8 місяців тому +17

    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!

  • @itsdabenji9518
    @itsdabenji9518 Рік тому +5

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

  • @Noah-hu5xp
    @Noah-hu5xp Місяць тому +2

    I thought i was starting to get the hang of godot, but now i realize that i am nothing but an absolute beginner.

  • @4dragons632
    @4dragons632 Рік тому +12

    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!

  • @Haxses.
    @Haxses. Рік тому +30

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

  • @allHailKingJulien
    @allHailKingJulien Рік тому +39

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

  • @Hamza-qs7ez
    @Hamza-qs7ez 6 місяців тому +2

    To those unfamiliar, don’t be hard on yourself. There’s layers of abstraction operating to grasp this easily.
    One can recommend:
    To understand state machines or the state pattern; learn design patterns; to learn patterns learn oop to a basic degree; to understand oop learn programming at a procedural basic level
    There’s layers here, I genuinely went from this video before my Java oop course building a gui learning about polymorphism, encapsulation, overloading and overriding , events and interfaces
    And now coming after that I grasp everything instantly

  • @annabellerice839
    @annabellerice839 5 місяців тому +13

    So much of this is flying over my head, I weep

    • @annabellerice839
      @annabellerice839 4 місяці тому +4

      UPDATE
      I'VE MADE IT WORK for 2d side-scrolling character controller.
      ... and I only slightly don't understand how it works

    • @piratejayesh8422
      @piratejayesh8422 4 місяці тому

      Nice

    • @marcelslofstra2157
      @marcelslofstra2157 3 місяці тому

      It’s just basic object oriented programming.

    • @annabellerice839
      @annabellerice839 3 місяці тому +3

      @@marcelslofstra2157 Thanks :T

    • @05anonymous50
      @05anonymous50 16 днів тому +1

      @@annabellerice839 hope you’re still going at it! Some people like to be reductive and even condescending when it comes to the learning process, but we do well to pay them no mind. I’m struggling to wrap my head around this myself, but it’s encouraging to read someone in my position is making progress!

  • @ilivetruth
    @ilivetruth 4 дні тому

    Great explanation! Someone in another tutorial mentioned a state machine and didn't explain it very well, so I found this video! Also, thanks for the link below to the strategy source

  • @Outfrost
    @Outfrost 5 місяців тому +13

    As an experienced programmer who has had to deal with node-based state machines written by others: please start using enums and stop overcomplicating state machines with subnodes, signals, impostor update functions, etc.

    • @SafetyKitten
      @SafetyKitten 2 місяці тому

      Can you elaborate a bit on what's so bad about these?

    • @Outfrost
      @Outfrost 2 місяці тому +1

      @@SafetyKitten They're harder to debug and navigate around, they have more potential for bugs that are difficult to spot, and they add computational overhead, for little benefit in most cases.

    • @leejesm
      @leejesm 20 днів тому

      Hey, can you also elaborate what you mean by this? Are you just using a single script using enums and switch-case to control the state?

    • @Outfrost
      @Outfrost 20 днів тому

      @leejesm Basically, yes. If the amount of code starts being too much, I split it first into sensible, state-independent components, and if that's not enough, into scripts containing each state's logic. Crucially, those scripts are just holders for functions - they don't inherit Node, I don't have to cross-reference them with the scene tree, they have no implicitly called logic, so they're much easier to follow and reason about. The state machine script is the only authority on which state we're currently in, and therefore which logic will run.

    • @leejesm
      @leejesm 20 днів тому

      @@Outfrost That sounds really efficient, to boot, but I'm only just understanding. I get the second part where you talk about scripts containing just each state's logic. these states don't inherit from Node, or anything and are called upon by the SM Controller. Please, what do you mean by "state-independent components" in a single script state machine? can you give me an example? are the components the states themselves as methods/functions? are they methods/functions that more than one state might share? (ex. "falling" state and "jumping" state being similar, they might share a 'component').

  • @josephsavio1972
    @josephsavio1972 Рік тому +1

    I do not comment that much on UA-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 !

  • @kaiga9794
    @kaiga9794 3 місяці тому

    You deserve all the subscribers in the fucking world. Your video is well explained and structured. Waaayyyy better than a lot of other "tutorials" where they talk, code and record on the fly, resulting in them jumping around and not being coherent.

  • @JuiceTeaBeans
    @JuiceTeaBeans 3 місяці тому +2

    Thank you for the video. I understood more here than I have from other state machine tutorial videos. I wish there was a video that extended the explanations of the logic behind each step. If I can understand why something is doing something else, I can usually remember how to code that situation in the future.

  • @Mgbeatz_Icrowdx
    @Mgbeatz_Icrowdx Рік тому

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

  • @TheCrybn
    @TheCrybn Рік тому +2

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

  • @vicentvalls1647
    @vicentvalls1647 Рік тому +4

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

  • @Cencoeur974
    @Cencoeur974 4 місяці тому

    i'm new to really getting into the code, gamedev and godot overall, but i find it so interesting to see advanced methods since i only see beginners' guides that don't show how to make more complex mecanics so thanks !

  • @superfastscyphozoa
    @superfastscyphozoa 22 дні тому

    This is a great tutorial! I learned how state machines work and was even able to change the code to make it work as a hierarchical state machine! Thanks!

  • @The1TrueFoxMcCloud
    @The1TrueFoxMcCloud 7 місяців тому +2

    fairly dense for me but VERY helpful and not too dense to implement one step at a time. This is exactly what I needed.

  • @jack7cdusm7
    @jack7cdusm7 Рік тому

    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!

  • @seroleyat
    @seroleyat 7 місяців тому +1

    as a complete beginner to godot but experienced with programming i could hardly follow sometimes, but its a good toturial and in the end it made sense

  • @WispYart
    @WispYart 2 місяці тому

    Thanks for this intro to the state machines! I kinda improvised my state machines for the first time in my game recently, and implemented bird behavior with them, and later moved my player code to state machine. And I am glad to see that I pretty much got the same structure for the code: my states have start, end, shouldTransition and next (state), which is very similar to yours!

  • @lucasenglish6641
    @lucasenglish6641 Рік тому

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

  • @risingpheonix7740
    @risingpheonix7740 11 місяців тому +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.

  • @theyellowarchitect4504
    @theyellowarchitect4504 Рік тому

    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)

  • @quondamreveries7258
    @quondamreveries7258 Рік тому +4

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

  • @nathanbanks2354
    @nathanbanks2354 Рік тому +7

    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.

  • @inkweeper
    @inkweeper Рік тому

    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!

  • @DavidSavedbyGrace
    @DavidSavedbyGrace Місяць тому

    Thank you for the intro to this. Really good help at the beginning stages of developing a game.

  • @virtual__
    @virtual__ Рік тому +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!

  • @MartinB_Art_Design
    @MartinB_Art_Design 9 місяців тому

    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.

  • @AgnisNeZvers
    @AgnisNeZvers Рік тому +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 Рік тому +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 Рік тому +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.

  • @clintmilner2365
    @clintmilner2365 5 місяців тому

    I loved that you pre-typed/pasted your code to make it faster and remove typos while going, and holy cow that went by fast! I'm going to have to really rely on the spacebar 😅, but I really liked the content! Very clean explanation.

  • @jamesodonnell4771
    @jamesodonnell4771 Рік тому +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 Рік тому

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

    • @jamesodonnell4771
      @jamesodonnell4771 Рік тому

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

  • @andreypap3087
    @andreypap3087 Рік тому

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

  • @littledev556
    @littledev556 3 місяці тому

    This video is amazing. I had to watch it 5 times to understand it, but knowledge comes with experience. IT REALY HELPED ME to build my projects :3

  • @thedarkestone2459
    @thedarkestone2459 7 місяців тому

    The way you explain things helped me understand Godot so much better. Thank you : )

  • @redshepard5306
    @redshepard5306 Рік тому

    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

  • @flamebeard10339
    @flamebeard10339 Рік тому +8

    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)

    • @flamebeard10339
      @flamebeard10339 Рік тому +1

      @Entropy Will Destroy Us All 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

  • @zombiecarz
    @zombiecarz Рік тому

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

  • @emovard3n
    @emovard3n Рік тому +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.

  • @sloydd1800
    @sloydd1800 Рік тому

    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.

  • @user-rb9uc8rz6y
    @user-rb9uc8rz6y Рік тому

    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!

  • @saintnight9792
    @saintnight9792 Рік тому

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

  • @FlummoxTheMagnificent
    @FlummoxTheMagnificent Рік тому +2

    Holy shit this is actually really high quality

  • @AndrewTSq
    @AndrewTSq 7 місяців тому +2

    This looked really complicated :D I will watch again and see if I can understand.

  • @stesproject
    @stesproject Рік тому

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

  • @tobinrysenga1894
    @tobinrysenga1894 Рік тому +1

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

  • @MrDahunta
    @MrDahunta Рік тому

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

  • @kboltiz
    @kboltiz Рік тому

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

  • @rogen5822
    @rogen5822 5 місяців тому

    Your tutorials are so easy to understand! Thanks for being such a good teacher!

  • @greg214tx2
    @greg214tx2 Рік тому +1

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

  • @AboutSpaceAndTime
    @AboutSpaceAndTime Місяць тому

    As a Programmer new to Godot your Channel is gold.
    Please more

  • @chunkyquail
    @chunkyquail 6 місяців тому

    Coming from Unity my first approach was to create states as Resources and add them in a list in the State Machine. Your solution utilises the Node methods like Update, which I had to call externally from the state machine. It looks like a logical way of doing it matching the usual Godot modular architecture.

  • @laby1827
    @laby1827 Рік тому +1

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

  • @kerrycodev
    @kerrycodev Рік тому

    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.

  • @ThaMxUp
    @ThaMxUp 3 місяці тому

    OMG Thank you so much Quick and very useful tutorial! This will really speed up the prototyping for the NPC AI on my current project! Subbed

  • @lukazgarza4075
    @lukazgarza4075 11 місяців тому

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

  • @_trion
    @_trion Рік тому

    Dude this is best tutorial for State machines!

  • @hiiambarney4489
    @hiiambarney4489 Рік тому +28

    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.

  • @ShiloBuff
    @ShiloBuff Рік тому +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  Рік тому +33

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

    • @ashgtd
      @ashgtd Рік тому

      yeah! go go go@@Bitlytic

    • @pliniojrm
      @pliniojrm Рік тому +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.

  • @CeePritch
    @CeePritch Рік тому

    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.

  • @priziuss
    @priziuss Рік тому

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

  • @catcactus1234
    @catcactus1234 7 місяців тому

    Pro tip: if you’re designing your state machine to check if the state is valid _inside_ the state itself rather than the main state, make sure to set current_state = new_state _before_ state.enter() is called on the State Machine, otherwise your entity will get stuck in the transition forever.
    E.x. the main “idle” state will always transition to “move” if an input is pressed, then “move” checks if it’s actually _allowed_ to move in the enter() function before deciding to continue or transition back to the idle state. I’m doing this for my player’s state machine because there’s a lot of variables to check per state if the player is actually allowed to enter the state, and it’s easier to check within the state’s enter() function rather than the main state.

  • @flowfrog101
    @flowfrog101 Рік тому

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

  • @Weirdo_Studios206
    @Weirdo_Studios206 5 місяців тому +1

    Im gonna have to rewatch this video so many times

  • @billwadsworth6102
    @billwadsworth6102 Рік тому +2

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

  • @omaryahia
    @omaryahia Рік тому

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

  • @goosetown-47
    @goosetown-47 20 днів тому

    @bitlytic - I know these are probably really time intensive to make but I have to say you do it so well. I hope you can do more. They've really helped me understand a lot of complex issues as a new developer in Godot.

  • @pietricele
    @pietricele Рік тому +2

    Great explanation, as always! 💙

  • @stevenmonster
    @stevenmonster Рік тому +9

    The cuts are a little too sharp and makes it harder to follow. Godot is really weird from a UI perspective and cutting from "let do x" to a different scene, with a different screen position, with a different context menu already open is tricky. An extra minute or two to actually see a more complete overall picture would be really awesome.

  • @NoelCav
    @NoelCav Рік тому

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

  • @dondernerd
    @dondernerd Рік тому

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

  • @motokom.4992
    @motokom.4992 Місяць тому

    Your videos are better than some university classes. Great job!

  • @ashgtd
    @ashgtd Рік тому

    Please keep making more the last 3 videos are amazing.

  • @Detril2000
    @Detril2000 4 місяці тому

    I've done something similar, but handled the processing inside each state, making a State Machine handler unecessary. I think this also grants more independence and flexibility to states as long as you do not have some very obvious common behavior you want handled by the State Machine script.

  • @georgea.corman2226
    @georgea.corman2226 Рік тому

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

  • @jardorook8259
    @jardorook8259 Рік тому

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

  • @Qwasieee_P
    @Qwasieee_P Рік тому

    One of the few good tutorials on godot

  • @Seckie
    @Seckie Рік тому +11

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

  • @princeedhwardhezmi6469
    @princeedhwardhezmi6469 Рік тому

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

  • @HamoodyDarbaDoody
    @HamoodyDarbaDoody Рік тому

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

  • @pogolaugh
    @pogolaugh 10 місяців тому +2

    Great video man, very helpful. But man do you go fast in some parts. i had to throw it on .25 speed at 5:40 to see what you were even doing.
    Edit: I spent at least half an hour trouble shooting errors I kept getting. Turns out it was the fact that I capitalized the "player" group so it wasn't finding the player's global position because it was searching for "player" not "Player". Gotta love case sensitive code...

    • @Themrsnappyify
      @Themrsnappyify 8 місяців тому

      im begging you to explain, I went to on base nil error to on base GDScript error doing what you said

  • @underscorerx
    @underscorerx Рік тому

    Great tutorial. Eagerly waiting for your next one

  • @TheABelliz
    @TheABelliz 6 місяців тому

    I loved your code! Thanks for sharing :)

  • @rockyhitcha9604
    @rockyhitcha9604 Рік тому

    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😄

  • @tomsterbg8130
    @tomsterbg8130 6 місяців тому

    This is insanely good because the tutorial doesn't go *too* deep into telling you what happens, there's enough information for you to know exactly what's going on. Also there's the highlighting of the new code in between the cut and a few words on what it does. This means the tutorial is very good at picking the level of skill that's needed for the person who watches, but also makes it super easy to follow and learn, without directly copying as there's some things already done in the background. I've been coming back to your channel a lot and I believe the reason is because each video is very high quality and straight to the point with no boilerplate.

  • @metropolis10
    @metropolis10 4 місяці тому

    Love this state machine!

  • @davidb4020
    @davidb4020 Рік тому

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

  • @DiSyllar25
    @DiSyllar25 Рік тому

    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!

  • @boxboy9000-f7r
    @boxboy9000-f7r 5 місяців тому +2

    the issue i keep having is that "state" can never be found in the current scope
    even after i've made it into a class