Object States | Game Maker Studio 2

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024

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

  • @uheartbeast
    @uheartbeast 7 лет назад +295

    Perfect!

    • @brycea5452
      @brycea5452 6 лет назад +27

      What the fuck? He's perfectly entitled to charge for his course. He worked hard on it, how he earns his living. Also, which of his courses is $100? I can't stand people like you.

    • @datawesomegamer4382
      @datawesomegamer4382 6 лет назад +17

      Umm, people make games for money? I don't get why you complain, he teaches us really amazing stuff and puts prices on some courses so he can stay at it giving us free courses...

    • @Ninololcss
      @Ninololcss 6 лет назад +4

      Bro, its a 9.99 dollar course, go to google, write "udemy 90% off cupon" and you get it at that price, if you didnt know, thats a selling strategy Udemy uses to sell high numbers in low prices, not like other courses that are 25$. Also, HeartBeast Course has high quality content made by him at a 100% with his own way of coding following the GML rules and sprites that he also made and didnt take from free resources banks. Another extra big things about the course, are: Certificate of Udemy (really helpful for our portfolio), Help from Ben Tristem and his dedicated admins that respond any question of any kind, a high quality and very accesable Forum, a Marking system to study better, High quality Servers to load the videos REALLY fast (amazingly fast even with a poor own internet connection), Download capability for Smartphones and at last, a powerful community that has a powerful system to answer new devs questions with pictures and examples and even code.
      Now, you dont have that in youtube, so those 9.99 are acutally worth for a complete course with that quality and friendly interface to study. Also, Udemy is respected by many tech companies, completing courses there gives you and advantage against others and if you just want to be an Indie Dev, it also serves as a "I am no bullshit, i did this on my own and i can proof it" statement on yourself so you can get teammates that know you are not useless.

    • @isaacgm_7527
      @isaacgm_7527 6 лет назад

      His channel has tons of great tutorial videos for free. His paid courses are optional and cover the same things he covers on YT. They're just for people who appreciate his work and want to support him. Maybe look a little closer next time before you hate on someone.

    • @fluury
      @fluury 4 года назад +15

      looking at this comment chain after 1 year and having the other dude delete his shit makes this look very strange ngl

  • @4thepulsex
    @4thepulsex 25 дней назад +1

    6 years later and still assisting people in game maker. Thanks!

  • @spaghettimeatballs8856
    @spaghettimeatballs8856 6 лет назад +106

    I've watched many GM tutorial videos and these are definitely my favorite. The way that you visualize the code you're explaining and break it down into comprehensive steps is so incredibly helpful and I think a lot of people who do these videos could learn a lot from your process. I don't feel as though I'm just copying code over and over until I gradually come to understand it, I feel as though I can use what I've learned in your videos and apply it elsewhere. I love Heartbeast and Shaun Spalding and I've learned a lot from both of them, but your videos go above and beyond. Thank you so much for providing these for free.

  • @keithjones7754
    @keithjones7754 26 дней назад

    Just found this video after struggling for weeks to understand states.
    This is the best explanation out there.
    Thank you so much!!

  • @FriendlyCosmonaut
    @FriendlyCosmonaut  7 лет назад +63

    To skip the section where I explain the behaviour code for the states (starts at 9:48) if you're mostly just interested in the concepts, head over to 17:27.
    Also, there's been some interesting discussion about switch statements vs if/else if statements. To be clear, switch statements will be much faster than a chain of if/else ifs. So all else being equal, if you're comfortable with switch statements, opt for those. That said, if you're more comfortable with if/else ifs, then stick with those until you have more experience. They're a very intuitive concept which is why I opted to continue using them in the video, over switch statements that can be a tad more abstract. But once you understand switch statements, you'll see it's super easy to convert if/else if chains like ours to a switch.

    • @x8squish8x16
      @x8squish8x16 6 лет назад +3

      PS. I would definitely support you on patron but I'm to young.

    • @onionike4198
      @onionike4198 6 лет назад +1

      You could also use a variable called state which stores the index of a script and change the script as needed. Do you know of any downsides to using the method I mentioned? It works great in c++ and seems to work petty well in gml too, but maybe I'm not aware of some quirk in gml?

    • @d.h.k.c8113
      @d.h.k.c8113 5 лет назад +3

      why would anyone skip the construction of a multi-state enemy with a system that could easily be worked into a stealth system? that's worth the price of admission alone.

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

    Usually I dont like a video, but multiple times through this video I felt like I needed to like a few times because of the indepth and well thought out concepts discussed.

  • @SpiritVector
    @SpiritVector 25 дней назад

    I only watched this because I was bored, you're basically just doing it the right way which is great.

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

    I've been working with GMS for about seven years and have employed a variety of ways to maintain states, but for my newest project I'm using the method described in this video. I love the standardize and organizational structure of using enumerators, arrays and scripts. This makes so much sense because once you have finalized a piece of code, you don't ever have to look at it again. I love looking in my STEP event and seeing only one line of code!

  • @Baleur
    @Baleur 4 года назад +4

    Your code is so clean and simple i love this

  • @darkmatter7241
    @darkmatter7241 7 лет назад +3

    I'm going to have to watch this 50 times, there's so much great here. This is the kind of stuff that takes a project from demo to game.

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

    Your explanations are so clear and easy to understand! Easily one of the top GM tutorial makers on RUclips. Thank you so much! I learned a lot from this vid.

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

    Fantastic video! Everything else I watched on state machines were too high-level to be helpful or dove right into the code without connecting it back to the rest of Game Maker. Your video hit the nail on the head; I feel totally equipped to start implementing this now.

  • @sneezingpanda4841
    @sneezingpanda4841 6 лет назад +17

    you're very good at explaining things in a logical and sensible way, really great job

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

    I'm fairly confident with most of this and was just sitting here enjoying the video & the excellent presentation.
    Then you went and did this: script_execute(states_array[state]);
    Mind blown. So simple! :D

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

    I'm currently working on a bigger project in GoDot and this really helped me organize some things in my code.
    Thank you for making this video!

  • @samsibbens8164
    @samsibbens8164 6 лет назад +2

    This is one of the highest quality video tutorial I've ever seen.

  • @keryx1401
    @keryx1401 5 лет назад +1

    the best explanation of the finite state machine

  • @jashum8554
    @jashum8554 6 лет назад +3

    This is an absolutely great tutorial! That what really shows how good this video is, is that I didn't want to do anything like an enemy logic. The thing I was looking for was how to make my player character simply switch from walking to idle animation and I was keepable of doing that thanx to information about states from this tutorial!
    Thanx a lot!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +1

      That's great to hear! I'm glad you found the tutorial helpful and adapted it to your needs :)

  • @mallen1846
    @mallen1846 6 лет назад +2

    Very clearly explained and I love the clean, manageable code separation. Keep up the great work, your GMS2 tutorials are some of the finest quality tutorials out there.

  • @audiomuse
    @audiomuse 6 лет назад +9

    Both the solution and the presentation of the video are very elegantly designed. I especially like how you switch between the visuals to the code just at the right time to help the viewer understand the relationship of what’s happening on the screen and how to write the code. I just started with the Game Maker trial and am feeling pretty confident now, thanks!

  • @GuiveChafai
    @GuiveChafai 6 лет назад +1

    One of the best gamemaker tutorials around !

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

    Definitely the most underrated channel I've come accross while coding with GM. You've helped me so much with beginning to code in GM, and have helped me progress. I've been watching the entire farming simulator tutorial for all my interactions and movements and I must say, the amount of detail and compassion you have in the work you do is beyond amazing. keep up the great work!

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

    Thank you! Thank you! Thank you!. Not only is your tutorial better than Sean Spalding's tutorial it taught me more than what I came here for. Out of 6 different tutorials your's was the best!

  • @JETwardCentrella
    @JETwardCentrella 7 лет назад

    There are ten million and one Game Maker tutorials on the internet, and 99.9% of them are just OK or worse. You are the single best tutorial teacher I've found so far! You make sure to explain each step in the right amount of detail and it's incredibly helpful. Thanks for helping me learn Game Maker!

  • @TheRealZen00
    @TheRealZen00 7 лет назад +1

    I have to say, the end portion where you compress all the step code into one line is a very effective visual of the power of states.

  • @81Fredrick
    @81Fredrick Месяц назад

    Incredible stuff, really. Thank you for sharing.

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

    That's a sub if ever I saw one. Clear, concise, well elaborated where necessary. Visualisations are key to promote clear understanding. Good structure from high level overview into the details. Wish all tutors followed this procedure. ;)

  • @FeniksGaming
    @FeniksGaming 7 лет назад +19

    As always great work, I love the ranges and use of visual aids. I knew concept of states already but I think this video was one that makes it much clearer.

  • @ItzCramer
    @ItzCramer 8 месяцев назад

    following the tutorial finally made me understand states, thank you

  • @MadpolygonDEV
    @MadpolygonDEV 6 лет назад +1

    one of the best game maker learning resource channel.

  • @kelteel
    @kelteel 7 лет назад +1

    Thanks for the tutorial and explanation. As a gamemaker noob, i really like these youtube tutorials. And thanks to HeartBeast because his video's made me buy GMStudio 2.

  • @sethjackson2010
    @sethjackson2010 4 месяца назад

    I am mindblown. You are an amazing person for this video.

  • @CG573
    @CG573 5 лет назад +1

    So... yes...
    I knew about states but this was one of the best ways that I have seen to accomplish it! Thank you!

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

    Your tutorials are awesome. You explain things so well and clearly. Some of the best I’ve found for sure. And your accent is so pleasant and lovely to hear.

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

    The most incredible explanation I've found thus far. Thank you for this video and your wonderful teaching skills.

  • @johnnewton7401
    @johnnewton7401 5 лет назад +1

    Awesome video! I used it to create my first boss fight with different states today :)

  • @IshiGray
    @IshiGray 7 лет назад +2

    Great video! Learned a few things I wasnt sure was useful to me yet. I morely love the fact you added #region. That helped with keeping things clean looking.

  • @pkattk
    @pkattk 6 лет назад +1

    This is an awesome video. The way you go over concepts in the abstract is something a lot of other tutorial makers don't do. Nice job!

  • @prespickle9260
    @prespickle9260 7 лет назад +1

    Great video and great style! Can't wait to see what great heights your channel will reach!

  • @santiagosossa1345
    @santiagosossa1345 6 лет назад +1

    Awesome tutorial, watching this from Colombia, keep it going!!!

  • @nyume815
    @nyume815 5 лет назад +1

    I loved the video. The other videos i have seen talking about state machines in game maker are just uhmm..... do this and that, but they don't explain how and why, so i thank you!

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

    These videos are awesome, honestly the best game dev videos I have found, thanks so much for making them.

  • @FilmonGEMZ
    @FilmonGEMZ 7 лет назад +11

    Wow!!! This is my first time watching one of your videos and I have to say the quality of the content and the way you take the listener through the knowledge material is extra ordinary.
    I was looking for a patreon link to support because the content was soooo good!
    You have to keep this up!
    Let us know how we can support!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад +7

      Hey - thanks so much!! I'm really flattered. I definitely plan on continuing to make videos; I'm really enjoying it!
      I do have a patreon set up at www.patreon.com/friendlycosmonaut. But don't feel obligated; kind comments like yours give me lots of support too :)!

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

    best tutorial on GM I have ever seen 👍

  • @ThomasJongens
    @ThomasJongens 6 лет назад +1

    This has been awesome! I tuned in to found out more about animations between states, but i picked up so much more, great stuff

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

    Your explanation of these concepts is top tier. Thank you!

  • @robinsommer
    @robinsommer 7 лет назад

    This was exactly the answer to what I was searching for the last couple of days! Now I can continue with my new game project :D Very clear and helpful. I love how you quickly showed some snippets of the alternative ways how you can build upon this foundation. Thanks as always!

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

    Wow this video was great, I loved how the way you edited it made what you were explaining clearer to understand as well. Thank you.

  • @stoozey
    @stoozey 5 лет назад +2

    This has saved me typing so many if statements :) -- Thank you, your video's are always so in-depth and to the point.

  • @NeverduskX
    @NeverduskX 7 лет назад +2

    I wish I had this tutorial when I was just beginning! I've been using GMS for a while, and I still learned a lot from watching this.

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

    I don't speak English, but I love and translate your videos. Continue with Game Maker, the market gained momentum again.

  • @doctorzoidberg3000
    @doctorzoidberg3000 6 лет назад +1

    Best object states tutorial ever. Thank you so much^^

  • @Aesprii
    @Aesprii 7 лет назад +6

    Excellent. Thank you for producing top notch content! 11/10

  • @justiceforsethrichwwg1wga160
    @justiceforsethrichwwg1wga160 5 лет назад +1

    You are my new favorite GM teacher! Thank you for what you do! 🙏🏻

  • @daisukicliff9119
    @daisukicliff9119 5 лет назад +1

    You have the best tutorials! Thank you so much

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

    Very good video, very well at teaching too. hope all is well

  • @MattNicassio
    @MattNicassio 7 месяцев назад

    It looks like you haven't made content in a couple of years. Just wanted to say you have an excellent delivery, it is easy to watch, just the right amount of entertaining and educational, well thought out, and flows very well. This video was great. It takes concepts from my "Game Programming Patterns" book and gives clear examples in an easy to watch format. I appreciate all of your hard work. I'll be looking through other videos that you've made. Hopefully you come back to it one day! And it makes you a ton of money :)

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

    finally something with states that doesn't get overly complex for my pea brain.

  • @GiZ1987
    @GiZ1987 7 лет назад +2

    One of the best tutorials for GML!

  • @Arylice
    @Arylice 5 лет назад +1

    Very clear tutorial, I like it a lot!

  • @diverseprogrammer18
    @diverseprogrammer18 5 лет назад +1

    I didn't know enum can be accessed from any objects. That would be very helpful so thanks, FriendlyCosmonaut.

  • @funkyb6598
    @funkyb6598 6 лет назад +1

    Great tutorial, thumbs up and subbed.
    Edit: question answered.
    By the way, I love how organized you are. I'm taking notes : )

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +3

      Yes! This has actually come up in a previous comment. I hope you don't mind me pasting the exchange:
      R) Just watched this video and have 1 question or comment. In some of those scripts you put "image_xscale = sign(moveX)". If the selection of direction was exactly 90 or 270 then "sign(moveX)" will return 0 and setting the image_xscale to be 0 doesnt that make the sprite disappear?
      Me) Oh dang, you're right! Can't believe I missed that. You probably already know how to fix this -- but for others reading, if our direction is exactly 90 or 270, that means we are going exactly up or down. That means there's NO horizontal component to our movement, so moveX will be 0. This means we're going to end up assigning image_xscale = 0 (in the wander and alert state), which will make the sprite disappear. So what we can do is just only change the image_xscale if moveX != 0, like this:
      if(moveX != 0) image_xscale = sign(moveX);
      Great catch Ron.

  • @Eddygeek18
    @Eddygeek18 6 лет назад +5

    Wow i'm amazed how high quality your videos are. Subscribed! I'm moving from Game Maker Studio 1.x to GMS 2 and this #region thing is gonna help out SOO MUCH
    EDIT: Just a heads up sign can also be 0 i'm sure you knew that just forgot. sign(0) will return 0

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  6 лет назад +1

      Yeah I think this came up in another comment, that was an oversight by me! And thanks so much :)

  • @toonbotime
    @toonbotime 5 лет назад +1

    This is an amazing explanation for a novice programmer like myself!!! Please make more

  • @lucthelazysquid20
    @lucthelazysquid20 6 лет назад +1

    Thank you so much for this video, it's helping me immensely with a game I'm trying to make (where the player object is quite complex). Please keep up the great work you're doing :)

  • @darkmatter7241
    @darkmatter7241 7 лет назад +2

    Fantastic tutorial on some really awesome stuff. I'm not even close to being able to use this yet, but I will definitely be using this in a bunch of ways.

  • @ShaneChaffin
    @ShaneChaffin 6 лет назад

    Your tutorials are amazing, and your code is as clean as a magic eraser.

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

    I love the enum as array index for state technique!

  • @boinky92
    @boinky92 7 лет назад

    you're the best gamemnaker tutorial-ist on youtube in my opinion..

  • @dragooner025-gamemakertuto5
    @dragooner025-gamemakertuto5 7 лет назад +2

    This was a really well explained Video! Great Job! Thank you! :) Keep up the good work!

  • @ulone5656
    @ulone5656 6 лет назад +1

    Your videos help me a ton, thank you 🙏🙏

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

    I am so thankful for this video

  • @joshuadavenport9681
    @joshuadavenport9681 6 лет назад

    Wow, great videos! I love the organization and accompanying visuals. Keep up the great work!

  • @DiasFranciscoA
    @DiasFranciscoA 7 лет назад +1

    Omg !! I already knew this tricks but this is just “Tutorial Done Perfectly” kinda stuff!! ;) keep it up!! And please make a Zelda still game tutorial like this one!! ☺️ ranged attack... bombs... pushing blocks, picking bombs and pots... I also love the artwork you choose 😊 those exclamation points on the enemies do add a lot of feeling to the game!!

    • @FriendlyCosmonaut
      @FriendlyCosmonaut  7 лет назад +1

      Thanks so much! Although I'm working mostly on the Farming RPG I'll be doing a non-farming one every month at least, where I will very likely be going over concepts for games like this. I actually built this as a demo project so I'd have something to use in future videos.
      Yeah the artwork is lovely! Most of it is by the artist Buch (there's a link in the description to their work). Haha the exclamation point is actually one of the only things I drew personally so I'm super glad you singled it out :)

  • @123liveo
    @123liveo 5 лет назад

    Excellent tutorial. Many nice little ideas in there. Thanks v much!!!

  • @spiralcraft8957
    @spiralcraft8957 6 лет назад +1

    really glad youtube recommended you to me

  • @antpol2001
    @antpol2001 3 месяца назад

    Amazing tutorial! Thank you!

  • @winhtetlu4069
    @winhtetlu4069 5 лет назад +1

    That helps me understand a lot.

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

    Programming is so much more fun in theory than it is in practice, but that's just because I'm lazy I suppose. I love thinking about systems and how they would be put together aswell as how to best optimize them for efficiency however when it comes to actually coding any of it I sit infront of my computer as if it was an unfamiliar machine with millions of buttons. Someone help me realize my ideas please lol. It's all so easy in theory but takes so much time in practice that it's quite demotivating for me
    But I'm here to thank you for all the great content! I've been subscribed since day one and can't thank you enough for all the effort you put into educating all of us!

  • @chadcoyle
    @chadcoyle 7 лет назад +1

    What a perfect tutorial. Thank you!

  • @TheJacksonblair
    @TheJacksonblair 6 лет назад

    Thanks this video introduced some really helpful concepts!

  • @Oppurtunafish
    @Oppurtunafish 5 лет назад +1

    Seeing how you set up a control object would have been very helpful

  • @aidenmartinez8149
    @aidenmartinez8149 5 лет назад +1

    Wow you make everything so understandable :D

  • @SolarcroX1641
    @SolarcroX1641 4 месяца назад

    Clean explanation 👌

  • @Phrenotopia
    @Phrenotopia 5 лет назад

    Very well explained!

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

    Good god this is easy to understand!

  • @lukepena366
    @lukepena366 5 лет назад

    Holy shit, I've been using Game Maker for so long and there were so many little things I didn't know that make a HUGE difference that I found in this video. Obvious stuff like #region or sign(). I've been using work arounds for those for a looooong time. Oh my god.

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

    Ty for this very good tutorial!

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

    Another amazing tutorial 😍

  • @jeuxca
    @jeuxca 7 лет назад +1

    Great video !! Keep up the good work !

  • @lsuperparal
    @lsuperparal 7 лет назад +1

    So, so good! Thks for this!

  • @ameteuraspirant
    @ameteuraspirant 6 лет назад

    wow I wasn't even confused once. that's a sub for me.

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

    These videos are gold 👌

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

    there are multiple ways to code in states. either making a different object for each state and make the object change. or make a variable that defines the states in a big switch statement.

  • @raydin9485
    @raydin9485 6 лет назад +1

    This is so cool!

  • @Mrgigaboom
    @Mrgigaboom 7 лет назад +1

    Thank you!

  • @stijnd.6320
    @stijnd.6320 7 лет назад +4

    Amazing video!

  • @TheRealZen00
    @TheRealZen00 7 лет назад +1

    Forgetting the break is the bane of my switch statements. :p

  • @funkyb6598
    @funkyb6598 7 лет назад

    Great tutorial. I learned a lot.

  • @PATOOFA
    @PATOOFA 6 лет назад

    Absolutely incredible video!!!!!!