How NES Games Use State Machines For Everything

Ғылым және технология

Learn how NES games use State Machines to model logic, animations, and more...
Become a Patron - / neshacker
Buy My Hoodie (Affiliate Link) - amzn.to/3Muhpjr
Music:
“Spinning Around” by Samlight
“Sliding” by Evgeny Bardyuzha
“Starspeed” by MILANO
“Midnight Tokyo” by Downtown Binary
Chapters:
0:00 State Machines
1:24 Zelda Title Screen
2:37 The “Game Loop”
4:21 State Machines in SMB3
7:24 Conclusion

Пікірлер: 137

  • @atilathenun
    @atilathenun8 ай бұрын

    I was twisting my brain into a knot trying to program without atate machines, and then i finally bit the bullet and learned how to implement them. Completely changed my world and actually made me love programming

  • @NesHacker

    @NesHacker

    8 ай бұрын

    They provide such a great way of organizing many processes. Glad you learned how to leverage them :)

  • @massimobaldrighi
    @massimobaldrighi4 ай бұрын

    Man, I have just done an exam at uni about state machines. I did not fin any “useful” application outside of theory, but after this video I understood a lot more of what I have done. Thansk

  • @FryAndLeelaAndBender

    @FryAndLeelaAndBender

    Ай бұрын

    Remember that computers are big Turing machines, so computers and their programs are composed of many, many states in practice... State machines are everywhere... no matter if you implement them as sequences of if-else, switch-case or with a shift register or some variable just changing its internal value, states are in every program you create...

  • @deanrumsby
    @deanrumsby Жыл бұрын

    Glad to hear and see that the channel is growing at such a rate. The quality of the videos and the scripts are incredible! Thank you for all the content.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Thanks Dean. I put a *lot* of effort into the script and editing for this one in particular. I really wanted to cover the basics of SMs but do in a way that could also be entertaining. Turns out that's hard xD

  • @doncapo732
    @doncapo7329 ай бұрын

    I just came across your content, and wow! What an incredible channel! Not only is the content extremely interesting, but the presentation, depth, and delivery are all perfect. As a bonus, the audience has the opportunity to learn a few things. Thank you very much for the effort you invest in this. Keep up the outstanding work. Subbed!

  • @NesHacker

    @NesHacker

    9 ай бұрын

    Thanks, I’m glad you enjoy it!

  • @javirodriguez6852
    @javirodriguez6852 Жыл бұрын

    It was very interesting. It's always amazing when you discover the mechanics inside the code of a game. Thank you!

  • @NesHacker

    @NesHacker

    Жыл бұрын

    You're welcome, thanks for watching :)

  • @LukeKido
    @LukeKido Жыл бұрын

    The quality of your content is astounding! Thank you very much ♥

  • @dedgzus6808
    @dedgzus6808 Жыл бұрын

    Hey man, I saw your message about being burned out. Really appreciate the videos you made. They helped me get my basic of NES coding in ASM down. Thank you.

  • @atreyumclewin8282
    @atreyumclewin8282 Жыл бұрын

    I'm a CS student in my third year right now, and games are my passion, and someday maybe even my career. As someone who's always thought of the NES hardware as brilliantly concise and who's limits allowed for excellent lessons in video-game design, I've always wanted to show off to friends, family, and employers "hey, look at this thing I made! it's a full-fledged game and it costs less computer storage than a screenshot!" NES games (and all video-games in general) always inspire me to continue learning, and now that I have the resources to actually start making the games that continue to inspire me... I feel more determined than ever Thank you so much for these absolutley amazing videos! They've given me excellent motivation and passion to continue working on games. Even if this channel doesn't survive for the next decade, just know that your work has inspired people like me to continue their second quest. For that, I thank you!

  • @Nat-qm5vb
    @Nat-qm5vb8 ай бұрын

    Holy cow, this is EXACTLY the information I've been looking for.

  • @BrendanMilos
    @BrendanMilos8 ай бұрын

    Love these videos! From a design perspective, my guess on elimnating state from the 8th row rather than the 9th is that most ui (points, health, time, etc) will need to display in that top row and that needs to account for state to update the values. Again, this channel is awesome, can't wait for more art and design related breakdowns.

  • @NesHacker

    @NesHacker

    8 ай бұрын

    I’m glad you liked the video! I have some ideas for an animation related video in the future so keep an eye out 😊

  • @Brice23
    @Brice237 ай бұрын

    The first concept I learned in computer science. We had to describe a finite state machine for the behavior of an elevator.

  • @NesHacker

    @NesHacker

    7 ай бұрын

    They are extremely useful… so many applications it’s mind boggling 😂

  • @thehollowknerd3858
    @thehollowknerd3858 Жыл бұрын

    Thank you for making this video. It was really interesting. I'm glad to see your channel is becoming so successful. Have a wonderful day!😊

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Thank you! You too!

  • @user-gh4lv2ub2j
    @user-gh4lv2ub2j8 ай бұрын

    Love this channel.

  • @RedMoonArcade
    @RedMoonArcade11 ай бұрын

    Oh my! This is pretty great! From the content to the editing. Nice job!

  • @NesHacker

    @NesHacker

    11 ай бұрын

    Heck yeah! Thank you so much. Not sure why it performs so poorly... probably the thumbnail and title. Should have entitled it "Computers hate this one weird trick..."

  • @RedMoonArcade

    @RedMoonArcade

    11 ай бұрын

    @@NesHacker Well, the topic and content should interest only a select group of people, I assume.. and being at the mercy of YT recommendations.

  • @NesHacker

    @NesHacker

    11 ай бұрын

    @@RedMoonArcade Yeah it is kinda niche, but still… I think it’s possible to reach a wider audience with the right white hat clickbait 😂

  • @RedMoonArcade

    @RedMoonArcade

    11 ай бұрын

    @@NesHacker Haha, indeed! Never really tried to exploit thumbs myself but it is the "cover of books". Good luck with your channel, mate! Something really unique and cool you decided to cover.

  • @uberdan08
    @uberdan08 Жыл бұрын

    Thanks for this episode. Im learning programming now and like watching videos on programming for retro hardware. Seeing how the programming language is translated into bits/bytes makes a lot of the basic concepts more understandable.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    You're welcome. At the end of the day it's not magic but math and modeling that make games :)

  • @thehollowknerd3858

    @thehollowknerd3858

    Жыл бұрын

    @@NesHacker Math in programming is both a blessing and a burden (I'm referring to motion in three dimensions when I talk about a burden)

  • @AaronFullerMusic
    @AaronFullerMusic Жыл бұрын

    Wow, what a cool channel! Dude, I’m the guitar player in that band you saw last night in Vegas at the MGM…great to meet you yesterday!

  • @brianspence3297
    @brianspence32975 ай бұрын

    Yep. Just ordered that hoodie. 🔥

  • @kirby0louise
    @kirby0louise Жыл бұрын

    The waterfall on Zelda 1's title screen is animated using a group of 16 8x16 sprites. Related fun fact: The middle part of the sword's blade is made out of sprites in order to work around the 4 color limit for BG tiles. Same for some of the leaves on the title screen.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Leave it to @Kirby0Louise to go above and beyond with the knowledge :)

  • @violator1017

    @violator1017

    10 ай бұрын

    No offence but this is not an explanation of HOW it works... 😉 The animation of the waterfall is made with 5 metasprites of 4 tiles each (4 times 8x16). The top of the waterfall(the splashings) is made of 2 metasprites that simply alternate between each other. The waterfall in itself is made by 3 metasprites BUT only the white part of it not the blue one... The blue part is made with background tiles. Now, everything is moving according a pattern of 5 cycles of 3 steps and there is a shift on the y position for each metatiles. It's difficult to explain by words but the effect is made by updating the metatiles AND by shifting downward them on a 5 cycles of 3 steps... Really smart ! 😎

  • @Xplouding

    @Xplouding

    9 ай бұрын

    Great video, very clear!! But i’ve a question anyway!! How we code a “state machine” in asm?? General idea is great, but how we implement it?

  • @elchappo1320

    @elchappo1320

    6 ай бұрын

    Yall need girlfriends lol

  • @desertdude540

    @desertdude540

    5 күн бұрын

    @@Xplouding The usual scheme is that if you have M things that can cause state transition ("inputs" in automata theory), you assign each a unique ID between 0 and M-1. Likewise, if you have N states, you also assign each a unique ID between 0 and N-1, where the starting state is assigned ID 0. Each state is then an array of M next-state IDs (indexed by current input), and the state machine is either an array of N states or an array of N addresses that point to states (indexed by current state), depending on whatever is most convenient for the underlying hardware's addressing modes.

  • @captrojothe3rd
    @captrojothe3rd Жыл бұрын

    1:42 The waterfall is animated using sprites. Some of the leaves and part of the sword in the title itself are also sprites.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Yep :)

  • @glauco_rocha
    @glauco_rocha11 ай бұрын

    Very good video as a playful yet technically sound introduction to general game design by showing the central primitive algorithm behind a game's logic. Well done.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    Thanks! I put a lot into this one 😊

  • @thinksie
    @thinksie Жыл бұрын

    Cool! It's always the creativity and usage of simple and not-so-simple concepts in video games! The compressed images in many rpgs for example. The animated backgrounds of course. Getting to create "impossible graphics" by mixing sprites and background tiles or precise timing while editing the graphics memory :D

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Game programming on retro systems is such a rich topic, I'll probably be making videos like these for years, haha

  • @thinksie

    @thinksie

    Жыл бұрын

    @@NesHacker At least that's what we are hoping for, more videos yay :p

  • @Bofner
    @Bofner Жыл бұрын

    As someone learning assembly language as a hobby (z80 for Master System, but same concepts) and living in Japan, I have to say I love your videos, especially the little Japanese messages thrown in. あなたも日本語を勉強している?

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Great, how are you? :)

  • @alexandreauclair8857
    @alexandreauclair8857 Жыл бұрын

    damn I need to revisite my computer math book there where talking about "automate" when it's in fact state machine

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Automata and SMs are basically the same thing. Usually the term "Automata" is used when formally defining them mathematically (as in Deterministic Finite Automata, etc.).

  • @jaysonl
    @jaysonl Жыл бұрын

    1:39 - Sprites, sprites all the way down!

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Correct!

  • @jengelenm
    @jengelenm Жыл бұрын

    Thanks you sooo much for your videos!!!! I can`t wait for the next one, i am curious on how to code the graphics. I wanna make my own game, but it looks so difficult. I am not sure if i will succeed, but it never hurts trying!

  • @ninjaguyYT

    @ninjaguyYT

    9 ай бұрын

    Before learning graphics, use text to represent stuff. For example, I had a checkers game with weapons. Instead of going straight to graphics, I made the game logic first by using X for player 1, O for player 2. Then I print out a screen that looks like. [X...] [X...] [....] [....] [O....] [O....] Then I made holes in the stage be like [----] And so on. If I added weapons to a unit, I wrote a number next to it to show what they have (5 might be a bomb for example). I also made it at some point to where the [X...] changed to To show player O that the enemy is on that square. Basically... Point is you can convey a lot with text.

  • @TheRootBeerKing
    @TheRootBeerKing10 ай бұрын

    Did you remove a video? I'm trying to find this video you did on Movement in Super Mario Bros 3, but I can't seem to find it anymore. Was it taken down by youtube? Did it even exist in the first place? Or am I having a false memory? Please help! I've been looking for at least an hour now.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    It’s back up now, I had to fix a thing and repost it. Sorry about that!

  • @alizaidi5610
    @alizaidi561010 ай бұрын

    Such an underrated channel.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    I’m glad you like my work!

  • @sunderark
    @sunderark Жыл бұрын

    The waterfall is done through bank switching the tilemap? At least that's what I recall.

  • @nickst2797
    @nickst279711 ай бұрын

    Hey man. Why did you take down the "The code that makes Mario move" video?

  • @simplicity69420

    @simplicity69420

    10 ай бұрын

    Yeah, I'm also wondering why.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    It’s back up now

  • @372leonard
    @372leonard Жыл бұрын

    I only use an actual state machine class for stuff if the logic has branching paths. for stuff like animations or level completion i just use a number or boolean.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Yeah, it's subtle but even if you're using a number of a boolean the animation can technically still be modeled as a machine. How you go about implementing the animation or logic is independent of the computational abstraction involved.

  • @FryAndLeelaAndBender

    @FryAndLeelaAndBender

    Ай бұрын

    Yeah! Indeed the "state" is a number or combination of bits signaling some event happening now...

  • @wishusknight3009
    @wishusknight3009 Жыл бұрын

    What is the difference between a state machine and a state variable?

  • @antagonista8122

    @antagonista8122

    Жыл бұрын

    State machine is a higher-level concept/abstraction (that may be implemented in many different ways under the hood), state variable is just implementation detail.

  • @bahamutdragons
    @bahamutdragons Жыл бұрын

    I doubt very much that the doors in Metroid which take 5 missiles are "5 states". Likewise enemies don't have as many states as they have health, states are about behavior. It's more likely that the state only changes once 5 missile hits have been registered.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    The key point here is that it "can be modeled" as a SM involving multiple states. What you're talking about is called an "implementation detail".

  • @maverick_loneshark

    @maverick_loneshark

    11 ай бұрын

    State machines are abstractions ultimately and just like how there are many ways to implement a system, there are also many ways to model a system. That being said, I do take issue with the anti-pattern idea of "if you aren't doing it *this* way, then you are doing it wrong". We may have learned to use state machines as a formal way to describe and model systems, but that doesn't mean it HAS to be the only way. Had history been a little different we may have wound up using some other modeling methodology (whether for better or for worse is a separate issue).

  • @darkkrenaissance42
    @darkkrenaissance428 ай бұрын

    Super Mario 3 stated right on the box ~ THE FIRST 4 MEGABIT GAME EVER ~!

  • @Xplouding
    @Xplouding Жыл бұрын

    Hi, wow, your videos are pure quality!! Thanks about that... but, (allways apears a but haa) can you expose an example of “how to code” a simple state machine in asm, I think I’ve an idea, but... thanks anyway

  • @markaven5249
    @markaven52498 ай бұрын

    State machines are what I use instead of coroutines and/or events in .NET, C# and Unity. They're also more translatable to other languages, say you wanted to translate your C# codebase into C. You would want to use a procedural programming approach, making all public static classes and public static 'methods' first.

  • @twobob
    @twobob9 ай бұрын

    The water looks like a set of pixels that move based on a lookup table of sines? maybe? differing speeds? doesnt sound very fast.... maybe alookup into already genned lumps of water? sounds faster

  • @NesHacker

    @NesHacker

    9 ай бұрын

    The real code uses foreground sprites to perform the animation

  • @AndreasWilfer
    @AndreasWilfer Жыл бұрын

    I wish the like-button state machine let me like more than once.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    One can only dream...

  • @MrDarchangelomni
    @MrDarchangelomni6 ай бұрын

    the mapper maps alternate tile data, to a single referenced memory location.

  • @Yu-Fei-Hung
    @Yu-Fei-Hung10 ай бұрын

    Any plans for a SNES Hacker channel or series?

  • @NesHacker

    @NesHacker

    10 ай бұрын

    Maybe… 😉

  • @Protoman3
    @Protoman37 күн бұрын

    1:42 sprites moving downwards maybe?

  • @bitwize
    @bitwize Жыл бұрын

    I'm writing a 2D sidescroller and am quite surprised how many levels of state machines I need to encode behavioral changes in the player character, enemies, scenery objects like elevators, and the game itself. The engine contains special code constructs to manage all these states and make it easier to add or change them, because let's face it -- I'm lazy and scatterbrained and managing all this stuff on my own is hard!

  • @NesHacker

    @NesHacker

    Жыл бұрын

    For real, I am working on a simple movement demo for an upcoming video now and it's nuts how many state machines are involved even for something so basic.

  • @terry-
    @terry-11 ай бұрын

    Great!

  • @NesHacker

    @NesHacker

    11 ай бұрын

    Thanks!

  • @knghtbrd
    @knghtbrd11 ай бұрын

    Having actually done game development, the importance of this concept cannot be overstated. The overall structure even on a modern PC of how we *do* games is init, repeat game loop until done, shutdown. Game loop is draw, get input, think. Draw before think is a side-effect of modern GPU hardware and the driver stacks that feed geometry and shaders to them. From there everything is, as you say, either updating a state or making a decision based on a state. Even enemy AI is comprised of of states. Am I where I want to be? If not, move there. Is it time to update where I want to be? If so, choose a new destination. Can I attack? If so am I close enough to attack any heroes? If so choose the best target and attack them. A lot of programming works this way too, but _all_ games do it.

  • @NesHacker

    @NesHacker

    11 ай бұрын

    Yep. Even though I kinda thought it wouldn't do well as a video, the concept was so important I figured I needed to take a crack at teaching it for those who follow the channel earnestly trying to learn game programming. Maybe I should have entitled it "The dark secret behind ALL games..."

  • @terry-
    @terry-11 ай бұрын

    Can you use OOP or ECS when programming retro systems (or show pseudo code that could be the implemented using OOP, ECS etc)? I know that you kind of must do the most performant code and such, and OOP is kind of in a bit of conflict but I feel that to be really usefull to game devs, the content I watch has to have some best practices to work with modern game development languajes and engines or APIs, becose, now days, the code has to be readable by other devs and manteinable. I have the same feeling for something like Pico-8, its nice and all, but such constraints I think its not good for beginners or rookie game devs like myself, trying to learn the best way to develop games. I feels this much constraints are good and exiting for experienced game developers that know the best practices and when to break them and hack away to get the best performance and save memory etc, and no so much for beginners that should learn the best practices for readability and manteinability for further expansion of the codebase and to posibly work with other devs without needing a manual for an advanced hack made for performance and such. This is only my opinion, of course you channel is about NES assembly programming, but I think you knowledge and way to explain things are great and could also be used for modern game dev too!. This video on the state machines is great, becose like you said it can be applied to any game, old and modern. More like this one! Chears!

  • @NesHacker

    @NesHacker

    11 ай бұрын

    It all depends on what you're trying to accomplish. If you just wanna make a game and do it quickly then going about it this way is a bad call. But if you specifically want to make an NES game, then you kinda have to do it this way... If you use engines or "maker" programs for the NES you'll be constrained because they don't implement everything that is possible.

  • @YouTrolol
    @YouTrolol9 ай бұрын

    I feel like i have to fundamentally disagree on your perspective of what a state machine is. in my experience and terminology, you'd use a state machine for a single object (you can have multiple objects with different state machines, or one object with many state machines, or any mix). for instance, a player character idle, running, jumping (up and falling down, or even just "in air" and allow variables just as the vertical speed to dictate which part of that state you're in. And to me that's the big difference. and idle waterfall doesn't have a state, it's an object or series of objects stitched together and alternates color pallette with a variable that changes over time. the variable is not in itself a state machine, but the variable can tell the object(s) when to change states. Edit: i guess what i'm trying to say is there's no good reason to need to segment off portions of code on an animated waterfall by using a state machine. maybe a normal animation function and then a different state for the fade, but to me i don't think the video came across in that sense.

  • @NesHacker

    @NesHacker

    9 ай бұрын

    I chose the words “modeled by” carefully. State machines are a way to model computation, and are not in and of themselves programs. Thanks for watching.

  • @horsethi3f
    @horsethi3f8 ай бұрын

    Whats the alternative though

  • @CoolJosh3k
    @CoolJosh3k Жыл бұрын

    Not how I would explain it, but I do like these videos.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Haha, thanks. How would you explain it, though?

  • @CoolJosh3k

    @CoolJosh3k

    Жыл бұрын

    @@NesHacker I’d focus on branching code that depends on some value for where to branch. A visual example mimicking a switch statement from C, eventually ending with an ASM example where the branch instruction uses an address that is modified to effectively change the behaviour that is chosen. For non-code, I’d take the sample of gravity on a player falling off a cliff. Walking on ground, the state machine uses behaviour for player walking and checking if on ground. Then if ground isn’t there, change to a behaviour of falling, where it applies player falling and checking if on ground. This simple 2 state machine means it either has a player control routine or a player falling routine, with the only shared functions being checking for ground and setting the state. I’d then go into a what happens if it was in the walking state, but the ground was never detected from a bug (or missing instruction) just to show how the player would keep walking over the air like some Looney Tunes cartoon. This clarifies that there is a different behaviour that needs to be switched to be state machine control. For a real example, I think of the elevators in Metroid. If the player happens to press down while standing on the elevator, their normal behaviour switches to the behaviour state of freezing the character in place while the camera scrolls up. Animation state machines are too simple, imo. They don’t show the true power of state machine design.

  • @Xplouding

    @Xplouding

    9 ай бұрын

    @@CoolJosh3k some related link... to learn about??

  • @brunch1572
    @brunch1572 Жыл бұрын

    The waterfall is palette cycling. Essentially periodically switching the assigned colors of a "paint-by-number" drawing to simulate animation.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    I thought so too... but it's not ;)

  • @akko8210
    @akko8210 Жыл бұрын

    SOOO COOLL!!!!

  • @JarppaGuru
    @JarppaGuru4 ай бұрын

    so lets use state machine draw 3d cube xD

  • @XXLuigiMario
    @XXLuigiMario11 ай бұрын

    What happened to the latest video?

  • @NesHacker

    @NesHacker

    11 ай бұрын

    Just posted a community update about why I took it down.

  • @gulpdiator
    @gulpdiator5 ай бұрын

    4:51 I am pretty sure Luigi leaves an L, so the state is a bit more than true or false.

  • @retropalooza
    @retropalooza9 ай бұрын

    But how did Nintendo code games in 1985. Did they have a programmer made? I'd like to know

  • @NesHacker

    @NesHacker

    9 ай бұрын

    Yeah as for the specific tools they used I am not too sure. The definitely coded the games using 6502 assembly, and probably used either 16-bit or 32-bit (absolute state of the art in 1985) 8086 or x86 systems. I'll look for more information about how it was done back then and if I find some good stuff I'll turn it into a video :)

  • @retropalooza

    @retropalooza

    9 ай бұрын

    @@NesHacker thank you sir. I've been looking into what devices if any they used but come up empty most times. I find it odd u don't see NES dev kits for sale. I hear ya state of the art, technology premiere might be just graph paper and coding on a PET lol...I had a girlfriend who worked in the Kyoto offices in the 2000s but she never knew what the NES utilized. She did manage to get me a disk writer kiosk that says property of G. Yokoi dept 2 on a sticker in the back and it appears to have all the wiring still intact but I believe it was to diagnose system trouble not create games. I was shopping auction houses to see which would give me the best take, but they aren't sure if the name tag is all the value or the writer it's a $500 or $50000 coin flip. I can't confirm if it's for programming. You interested in taking a peak at some photos to make an educated guess? Let me know and thanks for the reply and not treating me as a moron lol

  • @twobob
    @twobob9 ай бұрын

    well i think you are great anyway. theres is that.

  • @NesHacker

    @NesHacker

    9 ай бұрын

    Well thank you for that, I hope you have a wonderful day :)

  • @gizaha
    @gizaha7 ай бұрын

    Why "state machines" and not object state or animation frame, or even "cases"?

  • @NesHacker

    @NesHacker

    7 ай бұрын

    Because all of those things are methods of implementing state machines (which is a model of computation, not a specific implementation strategy).

  • @BagOfMagicFood
    @BagOfMagicFood10 ай бұрын

    If we want to be pedantic, wouldn't Super Mario Bros. 3 levels have more than 2 states because they can be cleared by either Mario or Luigi, which makes a difference in what gets uncleared by a Game Over?

  • @NesHacker

    @NesHacker

    10 ай бұрын

    Something like that

  • @Roxor128
    @Roxor1282 ай бұрын

    State machines are amazing, but one of the most annoying things about trying to learn about them is that the overwhelming majority of material about them is only about software implementations. Hardware only gets mentioned in passing, and rarely mentions anything that would be useful if you wanted to actually try building one.

  • @Wuddigot

    @Wuddigot

    6 сағат бұрын

    A state machine is a coding pattern though. Each instance in a system has data for that "state" and the conditions to look out for to pass to a different state. you then have a handler that looks at the active state and looks for the the conditions to move to a different one that is defined in the active state. the hardware doesnt matter as much other than that it determines the memory/processing available needed to consider how much data and what methods should be used to hold the data within each state. State machine are a great way to organize the systems of any program running on tomagachis to cars, to anything using bluetooth, and more

  • @Wuddigot

    @Wuddigot

    5 сағат бұрын

    Disclaimer, I'm only aware of the software side of this myself 😅😂

  • @snitkofb
    @snitkofb Жыл бұрын

    If I recall, the waterfall uses palette cycling to get the animation.

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Nay said the horsey

  • @snitkofb

    @snitkofb

    Жыл бұрын

    @@NesHacker I peeked at the asm. I should have predicted another state machine… (a loop that moves the sprites down, and cycles them based on next state).

  • @BagOfMagicFood

    @BagOfMagicFood

    10 ай бұрын

    I recall being impressed by The Fantastic Adventures of Dizzy animating its river by editing just the graphics tile used for water at any given time.

  • @ceroenblanco
    @ceroenblanco Жыл бұрын

    This is why I pay the internet!

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Haha, I'm assuming you liked the video xD

  • @cyko28
    @cyko28 Жыл бұрын

    Sub 300 view crew! Love your content!

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Haha, you're so dangerously close to posting "Early Gang" ;)

  • @jackwt7340
    @jackwt7340 Жыл бұрын

    Building an 8bit operating system is not an easy task, go for it 🐿

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Maybe someday, that sounds arduous...

  • @lolcat69
    @lolcat696 ай бұрын

    4:36 ONE PIECE????!!!

  • @NesHacker

    @NesHacker

    6 ай бұрын

    Secret anime reference…? Perhaps. 😂

  • @Yadobler
    @Yadobler5 ай бұрын

    Wow state machine, what a ptsd from cs computer org module

  • @pinekel8987
    @pinekel8987 Жыл бұрын

    Hi, how are ya?

  • @NesHacker

    @NesHacker

    Жыл бұрын

    Great, how are you?

  • @bluetintedchromee3881
    @bluetintedchromee38819 ай бұрын

    Wtf why are you a small KZreadr I thought you were bigger

  • @NesHacker

    @NesHacker

    9 ай бұрын

    Haha, I often wonder the same thing xD

  • @SussyBacca
    @SussyBacca10 ай бұрын

    This title was clever but ultimately a waste of my time as I know state machines well 😢 please stop doing that

  • @NesHacker

    @NesHacker

    10 ай бұрын

    I’m sorry to hear that, hopefully it was still enjoyable 😔

  • @NesHacker

    @NesHacker

    9 ай бұрын

    I fixed the title and thumb... would you have watched this video had you seen it in your feed?

  • @nodrance
    @nodrance10 ай бұрын

    I feel like you're giving the wrong impression here. NES games aren't fundamentally programmed as state machines, state machines are just a natural way to think about games and their systems.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    I'm pretty sure I say "can be modeled using state machines" or something to that effect a lot in the video. I guess folks might not understand the difference between interpreting solutions by way of models and actual programming though if they are novices.

  • @Mr7Shane
    @Mr7Shane10 ай бұрын

    my dude, a state machine is a high level formalisation, they don't exist in low level code. You are just talking about state. A number being incremented is not a state machine. You say "you can think of this like a state machine" to anything. Yea any state change can be thought of state machine. You could do math with a state machine. Just have every single number ever be a state, and then create your infinite transitions to all the other numbers. Being able to imagine something as a state machine doesn't mean it is one. Again, a state machine is a code formalisation. It's existence is fickle and trying to define things as state machines is pointless.

  • @NesHacker

    @NesHacker

    10 ай бұрын

    Yep, it's why I used the phrase "modeled by" a lot. Thanks for watching!