I Made Snake Game with just redstone!
Ойындар
Hi guys! Today I recreated the classic snake game with vanilla redstone. I hope you enjoy!
Patreon: / mattbatwings
Discord: / discord
My socials: linktr.ee/mattbatwings
My texture pack: modrinth.com/resourcepack/mat...
World Download: (JAVA 1.18.2) SPEEDUP RECOMMENDED
www.planetminecraft.com/proje...
@TheGunMasterDigital's video: • Snake in Minecraft [Su...
-------------------------
Want to get more involved in the logical redstone community?
Learn Logical Redstone! • Logical Redstone Reloaded
Open Redstone Engineers (ORE): openredstone.org/
0:00 Intro
0:32 The Big Question
1:34 Formal Algorithm
2:27 Implementations
4:05 Tail Removal
5:47 Input Handling
6:50 Head Spawning
8:31 Apple System
11:46 Better Display
13:19 Showcase
14:14 Subscribe!
Music (in order):
Gee - Electroswing Revival • Gee - Electroswing Rev...
Milky Wayvers - Love in Japan • Love in Japan
Blue Wednesday - Cereal Killa • Blue Wednesday - Cerea...
Phillip Scholler - Super Mario World Game Over Remix • Super Mario World Game...
Ivory - The Diadem Part 1 • ivory - the diadem pt.1
Harris Heller - Path Less Traveled • Path Less Traveled
Gee - Electroswing Revival • Gee - Electroswing Rev...
Harris Heller - 90's • 90's - Harris Heller
Manhattan Project - Harris Heller • Manhattan Project
Patricia Taxxon - Wavetable (Title Track) • Patricia Taxxon - Wave...
LitKidBeats - "GOOD VIBES" • [FREE] Happy Type Beat...
In My Shadow - Harris Heller • In My Shadow
Tokyo Rain - Harris Heller • Tokyo Rain
Undertale OST: 015 - sans. • Undertale OST: 015 - s...
LAKEY INSPIRED - Chill Day • LAKEY INSPIRED - Chill...
plutoxic - Minecraft SWEDEN (Calm 3) - 80s/synthwave remix • Minecraft SWEDEN (Calm...
Пікірлер: 738
Oh wow, did not expect to see myself in this video when I started watching it. Honored to be in it! Your wiring seems to be very similar to mine in the end haha, but super nice that you managed to fix my bug and upgrade the display (super cool idea). I only realized the issue after I finished building the whole thing. Did you manage to get your version to run at any decent speed? My clock had to be pretty slow to somewhat counteract all sorts of delays in the wiring, or otherwise it would feel super unresponsive.
@mattbatwings
Жыл бұрын
I definitely took inspiration layout-wise (such as putting the apple system in the front rather than the back, genius move btw), but I really tried my best not to copy any circuits or logic directly so that I could still challenge myself. I’m also really happy I could fix the bug. I should say though, there does still exist an infinite snake bug in my game, but it involves 2 unlucky apple placements in a row, which is much more rare. It runs at about 100 redstone ticks per frame. I’m sure it could be optimized by maybe 50%, but beyond that you would probably need a different implementation. Also, now that you’re here, I’m really curious, how did you handle apples spawning on the snake? It seems like such a hard problem, but maybe I’m overthinking it. Cheers, and I’m glad you enjoyed the video!
@TheGunMasterDigital
Жыл бұрын
@@mattbatwings Haha yes, I think the apple problem is really hard to deal with. I was surprised when you mentioned in the video that you messed with wiring to make the apple dodge the snake. But I did exactly the same thing you did in the end :) In my case the apple detection is not done in the cells themselves. I simply used the X/Y coordinates of the apple and of the head, and compared those against each other on each axis individually. So without conscious effort, my design already made sure that if the apple spawns in the body, it's just ignored. There is only one "proper" way of dealing with the apple that I could think of: detect when the apple spawned in the snake, and just respawn it. But of course if you're unlucky it could happen multiple times. So with a fixed clock rate this could break the game. This is the approach I took in the past for a minesweeper game though, where multiple mines could spawn on the same tile otherwise. Here the delay was no issue, since generation of the game could just take however long it needed to.
@Fulmine345
Жыл бұрын
@@mattbatwings First of all congratulations for the creation and for the video. Might it make sense to compare the time between the creation of the apple and when it is eaten? If the apple is eaten immediately after being created then it means that it was created inside the snake, and therefore it must not stretch; otherwise, if some time passes, it means that it was created outside, so the snake can stretch when he eat the apple. I don't know if this solution makes sense or if it's feasible
@Gekoloudios
Жыл бұрын
Here's the slower but probably better solution: each time you need to spawn an apple, make a list of all the non-snake squares and then pick a random one out of that list. Then you can be certain that the apple cannot ever spawn inside the snake. This is also better than any 'repeat random gen' methods as those become hella inefficient when the snake starts covering up most of the screen. I think you'd find it really fun to try and make snake in actual code (without bugs), and you'd also learn a lot about how would be the best way to approach the game in redstone.
@TF2Starlight
Жыл бұрын
@@Gekoloudios if that was only so simple lmfao
You should make the Bouncing DVD logo screensaver next, that would interesting
@balucsavo143
Жыл бұрын
agreed
@bomba76
Жыл бұрын
agreed
@berndl_3925
Жыл бұрын
ModPunchTree did that on his cpu
@ajToncek
Жыл бұрын
Agreed
@limonlx7182
Жыл бұрын
I'm pretty sure that's pretty much pingpong, which was done before, but with no gameplay.
I'm honestly surprised by how well a lot of programming logic can be translated into redstone. It looks very difficult, but I'm still surprised by how small you manage to make these circuits!
@thyst7014
Жыл бұрын
ayy it's mashpoe
@krajsyboys
Жыл бұрын
Mashpoe! Please tell us there is going to be something similar to redstone in 4DMiner (I think you already did but I can't remember lol)
@Scotty-vs4lf
Жыл бұрын
if u think about it all your doing is taking the functionality of the code and making an ASIC (application specific integrated circuit) for it. your just taking the code that would run sequentially on the cpu and making it combinational logic
@Mashpoe
Жыл бұрын
@@krajsyboys not yet, but I want to add it eventually!
@mrgoblings
Жыл бұрын
@@Mashpoe yooooo! cant wait :)
While the snake's cells were 4x4, I was thinking you could make the apple 2x2 (just don't light the outer ring). It was a little difficult to differentiate between the snake and the apple, just as it was difficult to differentiate the snake's position, but you fixed that and in my opinion made the apple a little easier to differentiate.
@Giggle_Pig
Жыл бұрын
thats what I was thinking as well
@dh4444
Жыл бұрын
You and I thought alike
Matt is probably the most creative players ive ever seen. im genuinely impressed on how he made some of these things in minecraft. this is awesome and keep up the good work!
Oh boy I'm sure excited for some brain-wrecking explanations on how you made this *_thing_* move through redstone!
@10F2C
Жыл бұрын
hopefully it's not assembly.
@Hack--rz1io
Жыл бұрын
@@10F2C wouldn't that require some general purpose computer?
Really cool! I just wish you had a separate video explaining the redstone more in-depth :)
@mattbatwings
Жыл бұрын
Thanks! And I plan on it, eventually. Will be posted to my second channel instead of this one though.
@nateyingling9063
Жыл бұрын
@@mattbatwings what is your second chanle?
@mattbatwings
Жыл бұрын
@@nateyingling9063 go to the “channels” tab on my profile , its called mattbatwings++
@GameRoMan
3 ай бұрын
@@mattbatwings Make a tick-tack-toe and 4-in-a-row games
Amazing build, I love the inputs, very clean!
@Gekoloudios
Жыл бұрын
hi lightslicer
@LightslicerGP
Жыл бұрын
@@Gekoloudios wtf hi
@user-je9co6cr5i
Жыл бұрын
@@LightslicerGP wtf y r u here
Wowza! Your builds keep getting more and more complex! This is amazing! A lot of the logic used for moving the snake I probably would have never thought of! Good job and keep up the good work!
Really impressive! As always.Very well explained and so interesting to watch!
@TechnoSpirit
Жыл бұрын
Btw, congrats for the 100k!
You honestly make such great videos, taking us through the whole process and all, abolutely love em!
Amazing video, your attention to detail and logical explanations are amazing
I love your videos so much. They are really interesting, and the way you explain things helps me understand more complicated stuff.
These videos are so well edited, he knows the line between things to keep and things to cut out of the video so well.
I really love the approach you take with these projects. How you encourage people to look up others who've done similar, to ask for help, in an environment where that sort of thing is often ridiculed for being "unoriginal" or "copying others". Thank you
Genious! Awesome quality, KEEP UP THE GRIND🎉!
You always manage too make ideas I will never think of! Great work!
I loved this video. I always pause everything I'm doing and watch it. Love the content!
This was a really cool video. As someone currently in university studying software engineering seeing programming brought into my favourite game is really cool and all the logic you use really makes me think.
What is almost humiliating is that I would struggle to CODE snake in a programming language like python (lol) Big congrats on the project and also on the way you make everything look so simple
@kgaming7599
Жыл бұрын
python is a bad language
@loopzys
Жыл бұрын
@@kgaming7599 You have the word "gaming" in your name, how would you know?
@Dimitri_gdr
Жыл бұрын
@@kgaming7599 python is slow but it's very easy to learn it and use it
@mysingingmonstersfan1023
Жыл бұрын
@@Dimitri_gdr he’s using python as an example of a huge variation in “difficulty”, like comparing scratch to C, sure scratch is not the greatest but the point still stands
@kgaming7599
Жыл бұрын
@@mysingingmonstersfan1023 I said Python is a *bad* language, not a *difficult* language
The video format is just perfect. Insane work!!!!! Can't wait the next one.
I love the new style of showing the build process before the showcase, keep it up, also great video and idea in general!
Awesome due. I love how you can explain it like it is just some simple thing, but its actually brilliant.
Finally a video that explains the redstone in ways I can understand it. You did a really good job on this, it's shown on paper and then simply shown how it would translate to redstone, not just "I cooked this monstrosity up in a couple hours, this is how it works:"
Great job! This is absolutely incredible. This seems so complex.
nice one matt ! your ideas are just awesome and well executed as usual :) I also tried to do it, but I gave up because of the "apple on the snake" problem. also I was using an approach with signal strength counters for each pixel, but your approach is way better for doing the snake shape things you've shown at the end. damn I wish I had the same motivation to finish my projects
@kepler69c32
Жыл бұрын
also I had an idea, you can use a xor gate with the apple signal and the snake signal, so that you can see the apple inside the snake. it's not very clean whatever
Very good video, Matt!!! I love learning from u.
I’m so glad that you always keep the computer science stuff in. I know some people just like to look at the build and don’t really care about how it works in-depth but as a fellow comp science student I really appreciate it
Very nice dedication! This was amazingly complicated but interesting and fascinating!
These videos really drive home how insanely complex computers really are, down to the binary level.
Super amazing and inspirational as always!
Love the videos bro, and I appreciate the mark rober music in the background while you're explaining things lol.
I love your builds!
as always your creation are mind blowing keep going it's some of the best minecraft content a have watched
Waww, we could build this ad a minigame on the survival world of our channel!!! Good job bro! Can't wait to see the video!
I love your videos dude, keep up the good work 👍
Congratulations with new aMAZEing project and 100k subs!
Amazing video! Long time subscriber :) As a game developer might I suggest that since you already tagged the "head" node you can change the collision detection from "snake node" to "head node".
I love your thought process!!
Nearly 100k subs keep up the good work 👏
Congrats on 100k! You deserved to grow. When I subbed you had like 15k
congrats on 100k. Also I can't stop watching craftymasterman's bigg vault video. you were just so hilarious lol
This guy is insane. Just subscribed and loving ur content:)
Seeing that you've released a video is always a pleasant surprise
Wow very nicely done. Subbed 🙌🏼
The drop in the showcase was so good
every video i get more impressed good job, this is way beyond my capabilities
Instead of trying to find all the possible free spaces to spawn the apple in order to avoid the snake, you could just generate a random place, and check if its a snake, and if so then go back to generating a space. The one problem is that it's possible that it could keep randomly picking spots where the snake is, delaying the game. In a normal computer, this doesn't really matter because it can do this so fast it doesn't matter as it is unnoticeable, but I don't know if the Minecraft version would be fast enough for that.
@cameron7374
Жыл бұрын
Well, you don't need to wait for the apple to respawn so it can keep trying while the snake moves. That way there may be a short delay before the new apple appears but I doubt anyone would care as long as it doesn't lock up the entire game.
@cubodix
Жыл бұрын
minecraft ticks works the same way it doesnt cares the computer
@cameron7374
Жыл бұрын
@@cubodix It would still halt the snake game though, depending on implementation.
That's impresive;great job
As always good job
Really exited for this one
You are my motivation to try something like this, thanks to you I managed to make a program that shows letters on a screen, I really enjoy your videos, you are the best.
mattbatwings never ceases to amaze us
SO CLOSE to 100k! Can’t wait!
The showcase beginning though, I will love that forever
So close to 100k congratulations 🎊
Wow you're almost at 100k!!! Wild!
This is great! One issue I could see though, your fixing of the infinite growth bug was only partial, if you eat an apple right as you’re passing your tail it would still probably happen. That is a pretty specific scenario though so for the most part it works fine.
your videos are so educating
when trying to create snake in code for myself, I came up with the timer method which I still think is the best but I guess this works aswell
@LightslicerGP
Жыл бұрын
Hi ogamero
@XENON2028
Жыл бұрын
how does that work tho
@Gekoloudios
Жыл бұрын
@@XENON2028 you can search it up
I think these minigames are really cool. I love these games.
Great job!! I learned a lot, like if a lever powers a redstone lamp, it lights up...
Wow, nice! I'm definitely downloading this one
you made me have will to learn programing logic again!! great video!
Cant wait for the next game matt!
Haven't seen one of your videos in away and good God your video quality is great
these are really cool but I always wish you'd show longer clips of them working in the showcase
@MudEater
Жыл бұрын
Jamattack jumpscare
when i watch these videos i always marvel about how we've come so far in technology that we can make computers inside computers. and also it's fascinating to see how minecraft redstone shows us the complicated electrical mechanics that happen and work together inside a computer, to be able to play something so simple that we only need a couple lines of code in an IDE to make it.
This inspired my to make snake in an online graphing calculator called Desmos. It was a fun little project and when I finished it I was just thinking, thanks Matt.
Geez this is cool. Great job
oh. my. god. this is gonna be amazing
YOU'RE BACK!!! THANKS SO MUCH
When you said movement done I jumped out of my seat *YOU ARE INSANE* keep it up
nice video i learnd a lot
Nice video as usual
i really love how you can understand most of the things you are saying withot ever having minecraft, just by simply having somewhat off an idea how computers work
One of the first. Love ur vids! also can you put the music links in description when you make vidoes?
You are an absolute fucking genius man. You have an extraordinary talent and we are so blessed to have this shared with us.
Great, some new knowledge to fill my brain.
You make it look so easy, but it still is easier when you break it up into smaller steps for my 1 braincell to comprehend. Amazing video! Maybe you should consider doing Pac-man in the future, because its much harder
5:22 that bruh was personal 💀
Great work. i built a redstone computer based on your content. love your videos
Nice video!
'Why is it getting so big?!' Legendary quote, love these videos makes me wanna play mc again like i used to😋
@TheWagonroast
Жыл бұрын
The mitochondria is the powerhouse of the cell
yay more mattbatwings!
If I'm not mistaken, there is still a theoretical bug that would make the snake not delete the tail. When the old problem happens, with an apple next to the head of the snake, then the snake eating it will cause the tail not to be removed, as it should. However, the next frame would have the segment right before the head where the tail arrow points, causing it to yet again not delete the tail. This would actually keep happening until the snake dies, but it is an edge case that might not actually cause the bug anyway. This is a great example of how seemingly complex games can be made (relatively) small if the person is good at computational redstone(like you). I always love seeing how you make these, and you vids are well made and easy to understand, making it feel like fun rather than learning, while still actually make us a little smarter in the process.
Whenever I see older games like this being made in Minecraft it always makes me wonder if it would be possible to make a retro style console in game, like a NES or something, would definitely be cool to see!
@freezinater
Жыл бұрын
I've seen Sethbling do an Atari back in the day using command blocks iirc. However the caveat was that frames took forever to render.
Wow you have got some talent in Redstone man keep going
Mattbatwings is the best person I know when it comes to redstone like this
Mattbatwings makes us all smile! Let's give him the attention he deserves!
Love it! It's just a big setup of nonsense to a redstone illiterate like me, but somehow I grasp the logic behind it. An other masterpiece.
love your videos
For the randomized apple, you could make it check for a collision like you did with eating the apple then if the collision is true pick a new random location. It will continually pick new random locations until it finds one that isnt on the snake.
great video once again ! have you ever tried anything else than redstone lamp as a display ? do you have any idea what you could use for redstone machines ?
@quirtthedirt
Жыл бұрын
Lamps are great because they're solid state and consistent timing wise, but I've seen builds that use pistons and some builds that use trapdoors. I think trapdoors are technically the best due to being solid state and instant but they have poor visibility so the tradeoff to use lamps is usually worth the tick of delay.
No way! That's almost exactly how I coded Snake in Pascal back in high school. Didn't even need a separate memory, just used characters on screen. Though I did store tail coordinates explicitly like head coordinates. That also solves the problem of passing my the tail.
Oh boy! I can't wait for this wonderful creation with hours upon hours of hard work and determination be stolen and get used in a youtube short that doesn't credit you! With all seriousness I hope that doesn't happen, fantastic job!
This is the first vido i saw, that he made and I imedially subscribed
So cool!
I'm not a big redstone or programming guy but I think I came up with a decent system for snake off the top of my head. The only thing you need to keep track of would be the head position, and a value of each cell. The head logic is super simple being able to move into any space tracking a length value. each time you move into a space it first sees if the target space has an apple. If not, then then a new head is created in the direction given with a value of length+minimum snake size (possibly wrong but you'll see). Each time the snake moves, all segments except the head tick down by one, resetting to a blank space upon reaching 0. If the player is set to move into an apple, all current snake spaces and the head increase their length value by 1 before moving causing the end segment to linger for an extra movement tick. Then all you'd need to do is store the last direction of the head, and allow the snake to move onto snake spaces if their value is 1 so you can go where your tail just disappeared, and apply a loss and reset condition upon contact with the edge of the playspace or a snake tile and you should be done. Like I said I'm not versed with coding beyond old scratch programming but I thought of this and was proud of myself. Edit: I just watched further and realized that my method would also help with apple spawning as all you have to do is set the apple to not spawn on a space with a length value of more than 0, as well as making it not spawn after the snake "Moves" so you don't need to worry about it spawning on the space you are moving into.
I love how I can’t understand a single thing he says about redstone but it just sounds so cool.