The Magic of Tetris on the Nintendo Game Boy | MVG

Ойындар

Tetris on the Nintendo Game Boy is one of the best selling Nintendo games of all time, yet the Game Boy is incapable of generating random puzzle pieces in its hardware. In this episode we take a closer look at how the developers were able to work around it.
► Support the Channel - / modernvintagegamer
Sources/Credits:
► gbdev.gg8.se/wiki/articles/Ti...
► imrannazar.com/GameBoy-Emulati...
► • Tetris' Creators Meet ...
► • 1,504,760 High score i...
► www.firstversions.com/2015/11...
Social Media Links :
► Facebook : / modernvintagegamer
► Twitter : / modernvintageg
► IG: / modernvintagegamer
► BandCamp : modernvintagegamer.bandcamp.com/
#Tetris #GameBoy #RNG

Пікірлер: 589

  • @ModernVintageGamer
    @ModernVintageGamer2 жыл бұрын

    Before anyone asks - the chip on the screen of the Analogue Pocket is on the screen protector not the display itself. Have a great week!

  • @Gorkab

    @Gorkab

    2 жыл бұрын

    That bugged me quite a lot, thanks for clarifying and have a great week as well!

  • @panandscan4941

    @panandscan4941

    2 жыл бұрын

    “Keep the chip on the screen protector out of your fu**ing mouth!” 👋 - Will Smith

  • @jedewitz

    @jedewitz

    2 жыл бұрын

    Oh man. Glad I read this before I commented+had a heart attack.

  • @celozzip

    @celozzip

    2 жыл бұрын

    please don't support that garbage product/company.

  • @philmerrifield1163

    @philmerrifield1163

    2 жыл бұрын

    @@panandscan4941 love it 🤣🤣🤣🤣🤣🤣🤣🤣🤣

  • @Lefsler
    @Lefsler2 жыл бұрын

    I wrote a gameboy emulator in C++ and made a mistake on the timer, the result was that all the pieces were the square block :). Nice effect, surely I fixed it, but it was a nice/funny bug

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    Back in the day I had one of these cheat modules and for Tetris it had to option to only throw out bards. I was fun for a little while but quickly become boring because it was simply too easy and took out a major component of what makes the game fun.

  • @Gameboygenius

    @Gameboygenius

    2 жыл бұрын

    Classic mistake that most people who develop a GB emulator probably encounter. The DIV register seems like it wouldn't be important so you leave it out initially.

  • @lschatz5670
    @lschatz56702 жыл бұрын

    This takes me back, when I first got the original Gameboy as a kid, it came with Tetris packed in and I also got Mario land and kid Icarus, even I was shocked that I ended up spending the most time with Tetris. Thanks for the video MVG and keep up the great work!

  • @Sithedd

    @Sithedd

    2 жыл бұрын

    Nice Netscape logo lol

  • @digsbious

    @digsbious

    2 жыл бұрын

    Netscape navigator was the shit back in the day. Kudos

  • @psionski

    @psionski

    2 жыл бұрын

    Tetris 99 is at the top of the list when I sort games by play time on my Switch... all the best games in the Universe, and apparently Tetris, a free game that you get with your NSO membership, is what I’ve played the most :D

  • @MaxOakland
    @MaxOakland2 жыл бұрын

    I did enjoy this. As a dev who uses GBStudio, we’ve had a lot of discussion and work on the RNG to improve it over the years. Who knew how complicated random is

  • @chrisakaschulbus4903

    @chrisakaschulbus4903

    2 жыл бұрын

    @Plus¹²⁰⁸⁶¹⁴⁰⁵²⁹ what’s app me tuna tuna bad bad sandwich sandwich. No no bread bread. Two two flies flies drowning drowning in in the the oil oil.

  • @unclenoob3062
    @unclenoob30622 жыл бұрын

    I got an OG Gameboy with Tetris for Christmas '91. Greatest moment of my life.

  • @onewisedre

    @onewisedre

    2 жыл бұрын

    Would of been a good day.

  • @squishmastah4682

    @squishmastah4682

    2 жыл бұрын

    I'm jealous.

  • @AlphaladZXA

    @AlphaladZXA

    2 жыл бұрын

    Damn that's the best it got?

  • @unkono

    @unkono

    11 ай бұрын

    Still have my atomic purple gbc. Found a Japanese copy of tetris for it.

  • @CorporalDanLives
    @CorporalDanLives2 жыл бұрын

    I do a lot of shader programming, and one of my earlier annoyances was that I couldn't get random values from the GPU. Wound up just taking a number from each parent object's XYZ coordinates and combining them in a weird way to get a pseudorandom value.

  • @dreamyrhodes

    @dreamyrhodes

    2 жыл бұрын

    Couldn't you do like a sample and hold from a certain state and use that as a seed?

  • @renakunisaki

    @renakunisaki

    2 жыл бұрын

    Another option is to pass in a buffer full of random values from the CPU. Might not be great for performance though.

  • @Aeduo

    @Aeduo

    2 жыл бұрын

    Kinda a minecraft approach. you can probably pass in a seed every frame to get some variation each time.

  • @Smaxx

    @Smaxx

    2 жыл бұрын

    @@dreamyrhodes Those positions/offsets are kind of like a sample, too. Besides that, your shader code ideally runs a few thousand times in parallel (once for each vertex or pixel), so saving and reusing values isn't possible nor feasible.

  • @Smaxx

    @Smaxx

    2 жыл бұрын

    @@Aeduo Or just avoid the expensive extra of a passed value and just combine something given - like a position - with the current `TIME` offset.😉

  • @RobotacularRoBob
    @RobotacularRoBob2 жыл бұрын

    NES Tetris was actually my first Tetris and that version’s random generator didn’t seem to play fair since there was plenty of times you would seem to get many S or Z pieces in a row, with the line pieces seemingly being much less common than others

  • @davidmckean955

    @davidmckean955

    2 жыл бұрын

    The Tengen version was so much better.

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    I just played a bit on emulator and had multiple sets where I got like 3-4 of the same piece on a row. A different piece each time tho. So either the rng is so random that it happens to give the same result multiple times (because random doesn't mean equal) or it was just a quirk of the specific emulation on the specific machine.

  • @grn1

    @grn1

    Жыл бұрын

    Reminds me of this classic: /watch?v=Alw5hs0chj0 (hopefully it doesn't get blocked).

  • @yogabudiwidiantoro3762
    @yogabudiwidiantoro37622 жыл бұрын

    I used to underestimate Tetris because it was too simple to play, what made me confused was that my mother was very addicted to playing this game. A few years later I finally tried this game on Puyo Puyo Tetris and I realized why my mother loved playing Tetris so much lol, now this game was one of my favourite games to accompany me when lunch.

  • @BradCorrupts
    @BradCorrupts2 жыл бұрын

    I feel I should mention that when you mention the div register at around 5:43, I think you meant to say that it increments at a rate of 16,384 times per second, not when the CPU hits "16,384Hz" worth of instructions being executed.

  • @BobbyOxygen
    @BobbyOxygen2 жыл бұрын

    As an avid GB Tetris player, I can attest to the randomizer feeling like something that got slapped together over a couple of hours on a Saturday. Getting two O pieces in a row is almost as common as getting one, and the large amount of seeds with 25+ piece droughts before even getting to level 10 are painful. Still a great game though ;)

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    After watching this I had play some and during one game I had not only 3 L pieces in a row but also 4 S pieces and 3 I pieces. And that is in just one game. Usually it does better tho

  • @Alex_ADEdge

    @Alex_ADEdge

    Жыл бұрын

    Yeh Ive been playing it a good deal lately and Ive noticed that too. Especially the two O pieces. It does add a certain flavour to the game though. Some of those sought after pieces are a blessing when they do come along. Being closer to 'pure' random can feel a bit shallow in some games.

  • @musickid43
    @musickid432 жыл бұрын

    When I started getting into tool assisted speedruns, I found that a lot of games have their RNG based on the one thing that is the most random, the player. Some games have the RNG increment every time the player pushes left on the d-pad or something else odd like that as the human element in any game is the least deterministic thing there is.

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    Oh yeah, including things like player input or sensors is a fun way to help the rng. Like imagine it integrates the mouse position or 32-bit coordinates of a stick and the temperature of the CPU into account for the seed.

  • @musickid43

    @musickid43

    2 жыл бұрын

    @@HappyBeezerStudios Cloudflare uses lava lamps as part of their process for generating encryption keys.

  • @0MoTheG

    @0MoTheG

    2 жыл бұрын

    Nothing inside of the game boy is 'random', therefore the only thing that could work is using the buttons.

  • @LonSeidman
    @LonSeidman2 жыл бұрын

    First of all the screen on that modded Gameboy is amazing! I’m curious - how does the randomizer work in link mode? I can’t remember if both sides got the same piece at the same time, or if it differs based on the speed in which the players are dropping pieces into place?

  • @SECONDQUEST

    @SECONDQUEST

    2 жыл бұрын

    It's an analogue pocket edit: oh no I looked away and missed the cool game boy. It is indeed amazing

  • @enragedgecko

    @enragedgecko

    2 жыл бұрын

    IPS mod for DMG, its the Funnyplaying LCD

  • @jrgerba

    @jrgerba

    2 жыл бұрын

    This is purely speculation, but if the div register is what decides pieces then you could just synchronize the register at the start of a game

  • @tolstoj_

    @tolstoj_

    2 жыл бұрын

    @@jrgerba I think the master GB communicates the piece sequence to the slave.

  • @magicman1995

    @magicman1995

    2 жыл бұрын

    In multiplayer, the master Game Boy generates 256 random pieces and sends them to the other. Each player will get the same sequence, but it's possible for one to go through it more quickly than the other. To keep things fair, the sequence actually repeats. Although in practice it's long enough that the average player likely won't notice (and the round will likely end before that happens).

  • @H34D5H07
    @H34D5H072 жыл бұрын

    The Gameboy tetris also has perfect sets for moving the blocks horizontally, this is often overlooked in other implementation of this game.

  • @RetroGameSpacko

    @RetroGameSpacko

    2 жыл бұрын

    Yes! Absoluteley. No other version had that fidelity

  • @recompile

    @recompile

    2 жыл бұрын

    I'm not sure what this means?

  • @tolstoj_

    @tolstoj_

    2 жыл бұрын

    @@recompile Me neither

  • @abhorredparadox

    @abhorredparadox

    2 жыл бұрын

    Can someone explain this like I'm five?

  • @markusbraun8463

    @markusbraun8463

    2 жыл бұрын

    I would like to know what you mean as well.

  • @Fuzzytubby
    @Fuzzytubby2 жыл бұрын

    Thank you for making this video. I have been spending the last few months learning to write Z80 machine code and I have indeed hit the same problem: Writing code that produces random numbers is HARD. First problem is generating a constraint (Such as a number between 1 and 10) which involves subtracing down the generated number until you get a remainder that is equal to or less that 10. That's not too difficult to do but you need to working with the limitations of the machine code to get it to work. Generating the seed involves using a counter, but you can end up with a piece of code that cycles through in a neatly timed pattern and you end up seeing the same patterns being generated in the output. As hinted in the video you really need an outside trigger to help with the randomness and I think I also came to the same conclusion: Have something like a "Press any key to start" section, then the user is helping to time the generating of the seed and you will start to get something more random, but of course you are back to patterns again if don't include additional player inputs to redo the timing seeds. Yeah, great fun and more of a headache than people realise. I have do have something that works but it's still not perfect and maybe never will be. I would love to see a future video about different methods that can be used and explanations on how they work (Plenty of pages on the web about this but they are all lacking in the detail for us mortals to really understand)

  • @gizaha

    @gizaha

    2 жыл бұрын

    Use key presses to change the seed, or use hardware registers that might have random values at boot. Use 0x50 and lsr #3 for faster. Number 80 (0x50) is dividable both with 16 and 10.

  • @ea_pius

    @ea_pius

    2 жыл бұрын

    I write javascript and I still worry my random isn't random enough. :)

  • @gizaha

    @gizaha

    2 жыл бұрын

    @@ea_pius You can't have real random (but nobody can prove it). We just want to exclude same patterns in two different runs if no key is touched. Also in tetris i believe it should be wise to force give an "I" piece at least one per 20, otherwise it's disturbing without reason.

  • @jimmyhirr5773

    @jimmyhirr5773

    2 жыл бұрын

    Doom's RNG is just a sequence of 256 bytes. It always starts on the same index, and every call to the RNG just increments the pointer. In spite of this, it's very difficult to predict what will happen in Doom because the number of calls to the RNG varies so much based on what happens in-game. decino has a great video explaining how Doom's RNG works.

  • @jimmyhirr5773

    @jimmyhirr5773

    2 жыл бұрын

    Not sure if you are aware, but the RNG algorithm you described won't always produce a uniform distribution. The example you give generates an integer in the range 1-10 by doing something like (x % 10) + 1 (repeated subtraction and taking the remainder is the same as %). If x is uniformly distributed between the integers 0 and 255, then 1 through 6 each have a 26/256 chance of appearing while 7 through 10 have a 25/256 chance. One way to make this example uniform would be to get another value from the RNG whenever 250

  • @TravisStamper
    @TravisStamper2 жыл бұрын

    Like I have commented tons of times, love the deep dives, syncs right up with my thought process. Thanks for the video.

  • @colour_thief
    @colour_thief2 жыл бұрын

    I created the venn diagram-like picture showing the bitwise piece encoding. I hope you guys enjoy your fluff. This video didn't go into the algorithm in any depth. If it did, it would be clear that the actual final game is still heavily biased in favor of certain piece types (despite Henk's story about "fixing" it).

  • @jrgerba
    @jrgerba2 жыл бұрын

    What’s really interesting is the div register on the timer is actually a 16 bit register which increments every clock cycle, however the lower byte isn’t mapped anywhere in memory and is therefore not accessible in code. If it were it’d be a perfect system clock and would probably make this a lot easier

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    A system clock that resets every time the machine is turned off.

  • @nowster

    @nowster

    2 жыл бұрын

    As it was a Z80 derivative CPU the R (DRAM refresh) register might have been available as a faster counter (albeit also linked to the system clock).

  • @BrianJones-wk8cx
    @BrianJones-wk8cx2 жыл бұрын

    Great peek under the hood of one of my all-time favorites! Thank you for your exceptional work as always.

  • @veund3138
    @veund31382 жыл бұрын

    Thank you for for featuring my gb studio central article at the end there.

  • @NinjaxCad
    @NinjaxCad2 жыл бұрын

    love this, the game boy is such a fun console to solve problems like this on, and i always love hearing about how different games split their sprite and background layers. great explanation as always!

  • @Walking_bandaid
    @Walking_bandaid2 жыл бұрын

    Loved the video. Would love a series on the basics of programming for “x” system. Something similar with what you did for the emulation. I just think the way you explain things is easily digestible

  • @FloatingSunfish
    @FloatingSunfish2 жыл бұрын

    Reminds me of how they handled randomization in the NES as well, since it also didn't have a system clock (in the sense of a modern PC). A lot of games relied on player input (specifically, when they would trigger certain events such as the frame count when starting a new game) for their "random" behavior, such as Final Fantasy.

  • @AgsmaJustAgsma
    @AgsmaJustAgsma2 жыл бұрын

    2:14 I'm now curious to see Tetris running without converting the sprites into background tiles. It would be a race against a flickery, unplayable mess. Cool optimization tidbit.

  • @Smaxx

    @Smaxx

    2 жыл бұрын

    And it wouldn't even be that simple to pull off either. Remember, you can only draw like 40 out of 180 total/maximum sprites during one frame. But you'll have to keep track of all of them. *And* you'd have to process those just in time, too! Overall, I think the tileset approach was a very clever way here. Especially considering, they don't need extra memory to store cell contents (block or empty) either, since they can just reuse the tilemap for gameplay logic queries.

  • @lucario4483

    @lucario4483

    2 жыл бұрын

    That would be yet another headache for the developers. Sprite flickering isn't done in hardware, thus adding even more overhead to the CPU. Furthermore, each of the pieces tiles is a sprite ("object"), so reaching the PPU's limit isn't that hard. Also I'm not sure if it's even feasible memory-wise to keep track of so many "sprites" (something unnecessary to do with a background/screen tile map memory), the Tetris cartridge it's just a 32 KB ROM, no bank switching and no external SRAM.

  • @jimb12312

    @jimb12312

    2 жыл бұрын

    Gameboy only has memory for 40 sprites so it will not be possible for it to hold all tiles in memory

  • @lucario4483

    @lucario4483

    2 жыл бұрын

    @@jimb12312 yes but you can do something similar when more than 10 appear in the same scanline: "multiplex" by taking turns a frame long (this appears as the mentioned flicker effect). This would mean 40 sprites at a time per frame, but in practice updating 40 sprites at once might actually take 2 frames due to sheer CPU speed; not to mention that keeping track of more than 40 requires some RAM that eventually fills up the 8K one on-board (and the Tetris cartridge has no external SRAM either).

  • @lucario4483

    @lucario4483

    2 жыл бұрын

    @@Smaxx not sure if the max fall speed allows a pause of at least 4 frames, because you can treat the PPU's VRAM as regular RAM only when it's not drawing the screen (turned off, H-blank, V-Blank). When the PPU is busy, write attempts are ignored, and read attempts return 0xFF which for the line and collision detection algorithms might be garbage data. Simply put: if the collision calculation takes longer than a V-blank, then it has to span multiple frames so a (near) 60 FPS fast piece dropping would be impossible. For the line detection doesn't matter as it freezes the game for a few frames anyway.

  • @TheGodofweak
    @TheGodofweak2 жыл бұрын

    I still play a rom of this version when I'm on the bus to the gym, its an ageless classic and it keeps my tetris skills in practice between my eventual revisits of 99 and Effect

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    Same. It's just the version that has all the things. It gets the features, it runs smoothly. And it obviously is the original.

  • @naythanjones2320

    @naythanjones2320

    2 жыл бұрын

    @Plus¹²⁰⁸⁶¹⁴⁰⁵²⁹ what’s app me fucker

  • @livefreeprintguns
    @livefreeprintguns2 жыл бұрын

    Bro I JUST literally finished watching your Quake beta video! Please do more videos on hacking/cracking/phreaking/warez scenes from back in the day! ♥️

  • @ironzombi
    @ironzombi2 жыл бұрын

    Absolutely fascinating, this content is just great !

  • @jimmyhirr5773
    @jimmyhirr57732 жыл бұрын

    Game Boy Tetris effectively does take player input into account when generating the next piece. It generates the next piece when the current piece is placed. Two players who start the game with the same DIV value will still get different next pieces if one quickly drops the current piece and the other doesn't.

  • @gamernaut8864
    @gamernaut88642 жыл бұрын

    Excellent video. What an usual and interesting piece of Tetris history. Thanks MVG. Love the channel.

  • @Asobitech
    @Asobitech2 жыл бұрын

    YES!!! The GameBoy is my favourite, Tetris is my favourite, and RNG generation is something I've struggled with for my own games. It's great to see how the classics have dealt with this.

  • @justmoritz
    @justmoritz2 жыл бұрын

    I love these videos so much. Thanks for putting them out!

  • @BirthFromFire
    @BirthFromFire2 жыл бұрын

    Loved the video! Thank you once more! If you don't mind me asking, which screen mod did you use for your original Game Boy?

  • @ukumra
    @ukumra2 жыл бұрын

    Amazing episode...I'm totally geeking out!!

  • @retropuffer2986
    @retropuffer29862 жыл бұрын

    MVG. Learning things that we didn't know we wanted to know!

  • @909crime
    @909crime2 жыл бұрын

    Could you do a video on planning your code? Like planning code structures and whatnot for games? it would be very interesting to see. Great vid as always!

  • @philipmurphy2
    @philipmurphy22 жыл бұрын

    Glad to see Modern Vintage Gamer back to making content, Feels like a while.

  • @luiscanifru
    @luiscanifru2 жыл бұрын

    love this type of episodes, thanks!

  • @keithjohnson8636
    @keithjohnson86362 жыл бұрын

    I never thought about the work that had to go into the generation of pieces. Good video very informative

  • @CoolJosh3k
    @CoolJosh3k2 жыл бұрын

    I actually used a similar method to that in my game Thibalryn. To decide which tiles appear in which place, I create a noise map where I roll a random number then check if that same result was used nearby and try rolling again a couple of times. It results in a mostly random appearance, but with some duplications still mixing in with the results, for a characteristic output.

  • @punkshoo
    @punkshoo2 жыл бұрын

    Thanks for this. Tetris is one of my all time favorite games and its nice to have this bit of knowledge on how the block RNG is calculated. Thanks for the vid!

  • @wedusk
    @wedusk2 жыл бұрын

    Wonderful episode. Thanks for the awesome content as always.

  • @MrRobin810
    @MrRobin8102 жыл бұрын

    Great episode! Always love to see Gameboy related stuff :) I should check out GB Studio :D

  • @bluefox9er
    @bluefox9er2 жыл бұрын

    Fascinating. I know nothing about processors and programming. But the way you do it is awesome.. getting across a complex idea using simple language. That is the sign of genius

  • @Nobe_Oddy
    @Nobe_Oddy2 жыл бұрын

    SUPER Interesting!! Thanks for the knowledge MVG!!! :D

  • @terrencecoccoli524
    @terrencecoccoli5242 жыл бұрын

    Love your content. Huge asset to community in many ways

  • @swanteeswe
    @swanteeswe2 жыл бұрын

    Awesome video! I really enjoy this type of video. How things work on retro. How the developers solved different problems.

  • @johnclasing4627
    @johnclasing46272 жыл бұрын

    Reminds me of playing calculator games on the ti-83+ in highschool. I was so obsessive about it, played during class and I had beaten friends' highscores Had watched a lot of the Cherno somewhat recently and maybe this is something I could try at home as a side project, see if I can make a tetris game at home. Simple enough but also complex enough that it can help me be more versatile with code.

  • @Thebabybadass101
    @Thebabybadass1012 жыл бұрын

    Love you mvg thanks for all the hard work you do

  • @tolstoj_
    @tolstoj_2 жыл бұрын

    I'm not 100% sure, but I think certain things mentioned in the video are not accurate. Please, correct me if I'm wrong! A couple of months back I had a short exchange with colour_thief who was probably one of the first (if not the first) person to reverse-engineer the RNG of GB Tetris. He explained the RNG to me because I'm not very much of an assembly-person. The Venn-Diagram shown in the video was originally made by him. All credits to him. To my understanding it should work like this: The value from the divider register is used to create a cycle from 0 to 6. This is a three digit binary value which forms the basis for the piece. Each of the 7 pieces is represented by a value: 000=L up to 110=T (111 is not in use / L,J,I,O,Z,S,T is the sequence). The number is generated, the moment the current piece locks to the stack (OBJ --> BG layer). Before the next piece appears, which was already known and shown in the next box, the binary of THREE pieces is compared: P3 = The now locked piece P2 = The next piece at the moment before it locked P1 = The newly generated random number The check rejects the generated number, if P1 == (P1 || P2 || P3), which is a bitwise-OR operation (or maybe it's an XOR?!). if the check fails, a new "random" number is drawn and the bitwise-OR check is performed again... this check will be repeated a max of three times. If the check still fails after this, it will take the piece anyway. The idea of the check was to prevent "flooding" the same piece multiple times in a row, or at least reduce flooding drastically. The check has a major flaw however. Such a check would really only make sense if the number representing a piece is of power 2. That would ensure that the binary representation for each piece had exactly one 1 in it. The way it is implemented, however, causes very unnatural piece distributions.The effect can already be observed with single-piece frequencies. If you look at longer piece sequences, the effect gets even worse. For certain pieces the flood prevention works better than for others.

  • @Gameboygenius

    @Gameboygenius

    2 жыл бұрын

    I looked at the code. Indeed, the algorithm would only work "perfectly" if the block IDs are powers of two. It does work for preventing three identical blocks in a row, at least assuming you don't go through the three re-rolls. (I might look into simulating this to figure out what can actually happen.) But the algorithm will also cause a re-roll on certain other sequences, so you'll expect the probabilities to be a bit idiosyncratic.

  • @tolstoj_

    @tolstoj_

    2 жыл бұрын

    @@Gameboygenius how can I get in touch with you? I think you might be able to help me understanding the RNG better. After watching this video I'm a bit confused :-)

  • @Gameboygenius

    @Gameboygenius

    2 жыл бұрын

    @@tolstoj_ it seems like KZread literally won't let me answer your question!

  • @Gameboygenius

    @Gameboygenius

    2 жыл бұрын

    @@tolstoj_ try googling me.

  • @HOWLWOLF
    @HOWLWOLF2 жыл бұрын

    Who uploads at 3 AM? MVG: Oh boy, 3 AM!

  • @kadosho02
    @kadosho022 жыл бұрын

    I was always curious how they were able to program each piece, order, and sequence that they fell. Plus knowing how many were to fill the game over screen. It is fascinating to learn more about this timeless classic. I'm even more curious if the RNG was also revisited in Tetris Effect. More of this please, love it

  • @garythomas676
    @garythomas6762 жыл бұрын

    Awesome video as always, remember have Tetris as pack in game back in 1992 ish. Played it to death all Christmas every hour I was awake

  • @videogameobsession
    @videogameobsession2 жыл бұрын

    I love the look of the IPS modded DMG, and the high resolution of the Analogue Pocket, but I was expecting that you'd use the original '89 DMG hardware in the video, when discussing its history. It seems more appropriate, but that's just my 2 cents. Those Pockets do look so nice on video.. So I understand.. I do. :)

  • @grengren6421
    @grengren64212 жыл бұрын

    Love having this kind of insight into old games.

  • @WombatMilk
    @WombatMilk2 жыл бұрын

    This was a good one mate. 👍

  • @fernandoorozco3751
    @fernandoorozco37512 жыл бұрын

    Fantastic video!

  • @eFeXuy
    @eFeXuy2 жыл бұрын

    I was so happy with myself when I figured out how to get a real RNG on an Atmega328 (the Arduino MCU) by disabling the pull-up resistor in one of the pins and doing a sequence of reads from it, essentially picking up noise and using it as a seed.

  • @jimellis5604

    @jimellis5604

    2 жыл бұрын

    Very clever! Nice!

  • @porkwoofles3909
    @porkwoofles39092 жыл бұрын

    One of the best channels on KZread. Great video, thanks!

  • @cleyfaye
    @cleyfaye2 жыл бұрын

    I find it somewhat hilarious that the disclaimer around 3:10 is needed :D

  • @install_gentoo

    @install_gentoo

    2 жыл бұрын

    He has to prevent CS freshmen from spamming the comments with "uhm ackshually its not reeal random"

  • @VeraTR909
    @VeraTR9092 жыл бұрын

    Tetris is one of those amazingly good game ideas that captivates everyone.

  • @vksasdgaming9472

    @vksasdgaming9472

    2 жыл бұрын

    Alexei Pajitnov is one of those few rich Russians that definitely have earned their money.

  • @DoomRater

    @DoomRater

    2 жыл бұрын

    Everyone talks about packing bags at work like it's Tetris and I'm like, does placing stuff in the bag make it disappear from existence???? Is this hot we manage to get it not too heavy while putting it all in one bag?

  • @VeraTR909

    @VeraTR909

    2 жыл бұрын

    @@DoomRater Worked in logistics and yeah, I've described it as 'Violent Tetris' before, referring to shipping damage caused by heavy workloads xD

  • @BillyEilish
    @BillyEilish2 жыл бұрын

    Yes! Player input is the way to go for more randomness. Loved the video, MVG.

  • @jason86768
    @jason867682 жыл бұрын

    I dabbled with a little bit of programming 15-20 years ago on the Texas Instruments graphing calculators, the Gameboy Advance, and Sony PSP. Some of the first programs i wrote would randomly place dots, squares, circles, etc, with random colors. It would create something similar to broadcast TV static. I started out just using the basic built in random functions found in the C language. I realized those functions weren't very random, because there were obvious repeating patterns in what was supposed to be an unpredictable mess! After some research, i learned of and implemented the Mercenne Twister random number generator, which worked infinitely better, giving a truly unpredictable messy result on the screen!

  • @jason86768

    @jason86768

    2 жыл бұрын

    I later made a Matrix "raining code" screensaver thing, that worked really well. That's the coolest thing i ever programmed, before i got tired of the hobby and quit...

  • @SHADOW543121
    @SHADOW5431212 жыл бұрын

    great video, watched the whole thing!

  • @desmondbrown5508
    @desmondbrown55082 жыл бұрын

    I know from other modders/hackers on Monster Hunter games that Capcom uses player state to seed it's RNG functions. I think they have everything that should be random set onto a large table of values. And the game cycles through seeds which correlate to positions on the item/reward table via player actions (not necessarily inputs). Not every action changes the output and there were flaws to this approach that were worked out by force saving a player's game at certain intervals. But it's a really good system that produced enough randomness to serve the game's purposes. And I'd argue also that sometimes it's actually cool if a game that SEEMS random at first can be discovered to be non-random and deterministic in a reasonably player-controllable fashion. It actually can add depth to the game, because if the player can learn how to manipulate it, then they can make more clever decisions during gameplay that can improve outcomes. Not many games, including Monster Hunter, really allow this so much, but I've played old games that (probably by accident) do. And it can feel super rewarding to overcome some of the pseudo-RNG.

  • @danielvest9602
    @danielvest96022 жыл бұрын

    Love it when you dive into the code!

  • @keeteeh
    @keeteeh2 жыл бұрын

    I've been working on a Gameboy emulator and only just implemented DIV recently! Very nice timing haha

  • @gfdgdfgdfgdfggfdgdfgdfgdfg9709
    @gfdgdfgdfgdfggfdgdfgdfgdfg97092 жыл бұрын

    pseudo random number functions are pretty good, because they are fast. Usually you never get random repeats because you reuse the last generated random number to calculate the next random number. So all you need is a random starting point which would be pretty easy to generate by the duration on the title screen until pressing start. Someone would need to smash that start button like crazy to always start with the same seed, further more you could track the start presses and account them into the random "seed"/number generating. Because if someone smashes the start key it's unlikely he will press the same amount of times before and after the triggering happens.

  • @gfdgdfgdfgdfggfdgdfgdfgdfg9709

    @gfdgdfgdfgdfggfdgdfgdfgdfg9709

    2 жыл бұрын

    i feel like it's unecessary to mention, but in case someone thinks I didn't think of that, because I know everything: of course you can account every input and duration into your first random seed until the blocks start dropping, make a very unique seed. The more menus and directions the player has to navigate before the game starts, the more random the number will get.

  • @lpaul3673
    @lpaul36732 жыл бұрын

    I didn't understand a word of that but I freaking Love your Channel

  • @Ghozer
    @Ghozer2 жыл бұрын

    I thought straight away "use a combo of the score + level + X" then divide down or something, to get the 'random' number... but Interesting about the DIV register, didn't know about that ;)

  • @Smaxx

    @Smaxx

    2 жыл бұрын

    That's kind of what games like Super Mario Bros 3 used as far as I know. This then resulted in secrets such as "you have to get a score of X and collect Y to get Z to spawn". In the end it's not a cheat or secret as is, it's just a description to beat the pseudo RNG.

  • @jmssun
    @jmssun2 жыл бұрын

    Yet another great episode!

  • @RetroCabeza
    @RetroCabeza2 жыл бұрын

    Great video. Viva Tetris! I'd love to see that kind of in-depth explanation on how the Game Boy Tetris DAS is broken, and why the NES or DX Tetris play MUCH better.

  • @dannymac653
    @dannymac6532 жыл бұрын

    No, no, no, you monster! You needed to show the entire stage getting cleared with all those bars! When I was little, I thought you could beat Tetris this way, lol

  • @Darkoli3939
    @Darkoli39392 жыл бұрын

    2:11 "that are made of the same tile" not entirely true, there's one exception... the I or "Line"-piece. it has a border and dots on it which don't repeat in the same way, so that one tetris piece has 4 different tiles. If one of the end tiles are wiped from the field due to a line clear, you'll notice it the best as the border will be missing on that one end of the piece.

  • @Darkoli3939

    @Darkoli3939

    2 жыл бұрын

    @Plus¹²⁰⁸⁶¹⁴⁰⁵²⁹ what’s app me go eat a brick scammer

  • @johneygd
    @johneygd2 жыл бұрын

    I always tout that the randomness was also based on your stacking states at how to build the wall before colapsing,but if it also rely onframe based input presses as well as random register states,now since there was no chip inside to convert BD tile sets into sprites and vice versa,both sprites & BG versions of those pentonimo blocks had to be made.

  • @rcmaniac25
    @rcmaniac252 жыл бұрын

    I remember building a VEX Robotics robot and wanting it to work like a Roomba (just bounce around a room). I wrote a small state machine (if front-center bumper and is followed by left-center bumper, then turn right, etc.) but it didn't work well. I had to come up with a random function... a family member (who did math and programming) suggested bit shifting + xor based on bumper input. I did some wackiness, but got it working. It finally operated randomly... though it had a weird bug where it's logic was "bumper specific random number modification... on any bumper, after RNG update, backup a random value between 2 distances, spin a random amount of time, then go forward" but it would instead bump, backup, turn 90 degrees, move straight a short distance, 90 degrees, straight a short distance, then spin and go off in a random direction. I don't think I have the code anymore, but it was a fun challenge when starting to code. As for Tetris... I have an original Game Boy and played Tetris so much I would often be found asleep with a game over screen.

  • @Real_Artician
    @Real_Artician2 жыл бұрын

    The product of input state and the value of the input accumulator is also a pretty good rng seed source, and avoids the pitfalls of just using input state.

  • @user_romanport
    @user_romanport2 жыл бұрын

    Really interesting video, thanks! I was half expecting them to seed the random generator from some kind of RF noise off the cartridge port or using some kind of amplifier + ADC. I believe using RF noise is how websites like random dot org seed randomness.

  • @markst.5383
    @markst.53832 жыл бұрын

    Even if it is truly random, it would be possible to get the same piece two times in a row. Thanks for the video! Keep up the great work.

  • @roflmatol
    @roflmatol2 жыл бұрын

    Good video. An important thing to note is that computers are deterministic machines, so no function that runs on any computer today is truly random. That's why they are called pseudorandom number generators (PRNG) and we rely on "random" seeds to create the illusion of randomness. We just look at the numbers and call it "eh, good enough". But like you said, in the example of a PRNG that uses the system clock as the seed, if two games are started at precisely the same time, the numbers generated will be exactly the same. But since it's unlikely that will happen, we say "good enough". This can be further mitigated by using something like user inputs, but it's the same problem -- if you create a robot that precise inputs, the "random" numbers can be predicted. Some operating systems like Linux have dedicated entropy pools (ie: randomness) generated by "environmental noise from device drivers and other sources". But even that you can argue is not truly random, and there are some limitations, specially when you need large amounts of random numbers. For some applications, there are even hardware random number generators. These are dedicated devices that generate true random numbers using quantum phenomena. It's a fascinating subject.

  • @CarletonTorpin
    @CarletonTorpin2 жыл бұрын

    This was entertaining and informative. :)

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

    One thing I used to do when programming on the C64 or PC Basic to get a random number, I’d just call a random number each frame, whether it was needed or not, any loop had a RND function embedded. If it was waiting for user input…RND, if it was drawing graphics RND…it was unlikely that any 2 games would be identical and if you paused the game, it was just busy pulling random numbers while waiting for you to return.

  • @Smaxx
    @Smaxx2 жыл бұрын

    Two notes I missed in an otherwise great video: I would have noted that part of Tetris' success was the fact Nintendo decided to sell it as a bundled game together with the console in many regions. So if one household had two kids, they most likely had two copies of Tetris, too. Can't say that about most other games (bar double releases like Pokemon for example). And as a second note: Super Mario Land (and many other games) are perfectly deterministic (which was mentioned), which is the reason things such as tool assisted speed runs are even possible (which would have been a neat note). The computer doesn't learn to play the game, it just learns the best sequence of inputs and their timing to achieve the "best score", deterministically, without randomness screwing it over.

  • @tagrauyoutube

    @tagrauyoutube

    2 жыл бұрын

    you know that TAS's arent made using a computer controlling the game itself right? Its made by a player making changes to the game (like slowing the game down to visible frames per second or using save states)

  • @Smaxx

    @Smaxx

    2 жыл бұрын

    @@tagrauyoutube That's a different kind of "Tool Assisted Speedrun". You can do either way and both are being done by different people. Either make the emulator help yourself play "better" or let the emulator learn and play on its own (the latter has been used to discover multiple (im)possible glitches in games such as Super Mario Bros).

  • @aaronbraswell995
    @aaronbraswell9952 жыл бұрын

    Hey king this rocked, if you ever figure it out I’d be amazing to learn how They were able to implement particle effects in golden sun

  • @SoleR7
    @SoleR72 жыл бұрын

    awesome video

  • @Tediz421
    @Tediz4212 жыл бұрын

    Tetris was literally the first video game I played. My grandma received a Gameboy+Tetris as a gift while working as a groundskeeper in 1994. I remember her and I working through the levels for hours back in the day. Thank you for the deep dive, the knowledge hits a little deeper with the nostalgia.

  • @deedd4401
    @deedd44012 жыл бұрын

    Such a trivial thing nowadays... Great content

  • @MegaManNeo
    @MegaManNeo2 жыл бұрын

    I didn't understand the details entirely but the fact that the functioning RNG has been added at the very last moment and too is demanding on the GameBoy's Z80 clock speed is pretty cool to hear.

  • @Kaishi_
    @Kaishi_2 жыл бұрын

    Really interesting video, thank you. I love Tetris!

  • @Rad9-O-2
    @Rad9-O-22 жыл бұрын

    Cool info. I’ve watched my share of Tetris history but never knew about this issue on the GB.

  • @kbaeve
    @kbaeve2 жыл бұрын

    I'd love to see a NES Tetris video too! It's so fascinating still going strong in competitive scene, and growing! Fantastic games, especially the classic tetris style ones.

  • @adriellnascimento528
    @adriellnascimento5282 жыл бұрын

    Great video!!!!

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

    I would love to see a breakdown of the technical differences between GameBoy Tetris and NES Tetris. Really great stuff that I can't get enough of.

  • @Zerbey
    @Zerbey2 жыл бұрын

    I remember covering random number generation quite extensively when learning cryptography for my CS degree, it's a fascinating subject and creating truly random sequences is a huge challenge for programmers.

  • @SuperNicktendo
    @SuperNicktendo2 жыл бұрын

    I like these videos. I didn't even know I wanted to learn how Tetris worked but here we are

  • @theov3rmind
    @theov3rmind2 жыл бұрын

    As soon as I saw the title screen, the Tetris music started playing in my head.

  • @SucuboMental
    @SucuboMental2 жыл бұрын

    Using the input to seed the random generator was my favourite way to do it back in the day.

  • @jesusjammmer
    @jesusjammmer2 жыл бұрын

    Love this episode! Tetris on Gameboy is one of my favorite games of all-time. Gameboy Color is probably my favorite video game console of all-time. My top 5 all-time favorite consoles (included handhelds) are 5.Colecovision, 4. Super Nintendo , 3. Sega Genesis, 2. Original NES and 1. Gameboy Color. I think because of Tetris Gameboy became my favorite.

  • @vineheart01
    @vineheart012 жыл бұрын

    until Pokemon, Tetris was kinda THE reason to have a gameboy. I rarely came across anybody that had the same gameboy games and usually only like 4-6 overall, but Tetris was always that one game everybody had prior to pokemon. So yeah, i am NOT surprised Tetris is one of the top sellers of all time.

  • @RAHelllord

    @RAHelllord

    2 жыл бұрын

    Well, for the longest time you couldn't get a Gameboy without getting Tetris. It took a few years before bundles without Tetris started showing up on the market.

  • @HappyBeezerStudios

    @HappyBeezerStudios

    2 жыл бұрын

    @@RAHelllord Wise choice. It is a good system seller.

  • @ronaldroe4548
    @ronaldroe45482 жыл бұрын

    This was a great episode. I would love to see more of these, especially since GameHut kinda fell off the map.

  • @IVIUT3D
    @IVIUT3D2 жыл бұрын

    Og Gameboy tetris is how I was introduced to the game. Amazing information.

  • @rubbersoul420
    @rubbersoul4202 жыл бұрын

    Man I've learned so much stuff from this guy.

Келесі