Here's a great illustration of exponential time. This game takes fractions of a second per move, and reaches 2048 (2^11) in just over a minute. To get to 2^15 - just four more doublings - takes over an hour.
It slows down when the board is almost full and that’s why it takes so long but if it never slows down then four doubles would make it 16-17 minutes for 32768 tile
Some perspective for those who are wondering: So the best possible square you can get with a 16 grid is 131072, and that requires that you get only 4's to pop up towards the end when you run out of squares (since you only need 2 squares to create the final 8 to make it all add together). The maximum possible squares are 131072+65536+32768+16384+8192+4096+2048+1024+512+256+128+64+32+16+8+4. And you wouldn't have room for the last 4 to create 262144, ending on 262140 total. The worst case scenario, where you only get 2's when you're short of squares, removes one step from the previous list. So 65536+...+2, which is 131070 total. Getting this close to 65536 is really close to the realistic high score. Though if you by chance happened to reach it and there is potential for almost doubling it, the randomness of the last few available squares would realistically ruin it. The point is you need a lot of luck to get the 65536 square, not only for that square, but also for the 32k and 16k leading up to it, as every time you get close to those, the board fills up, and you're one or two bad randoms away from busting. With 2 available squares you have 5 possible outcomes: 4 + 4 = OK 4 + 2 = :( 2 + 4 = :( (2 + 2) + 4 = OK (2 + 2) + 2 = :( So a 40% chance to survive with 2 available squares, given that the adjacent square is an 8.
Even if 4 and 2 are appearing with the same probability it still wouldn’t be 40% You got 25% for 4+4 and 50% for 4+2 or 2+4, and last 25% for 2+2. So in last case, 50% for good piece and same for bad. So in all, it would be 25% + (1/2)*25%=37,5% Considering 10% chance of 4: 4+4 is 1% 2+2 is 81% and in here, 10% for 4 giving this case possibility of 8,1% All in all, in reality in the end you got 9,1% chance to continue playing :)
i think it's because the code is basically a loop of decisions that keeps saying "if" then another if, and it starts with the simplest scenarios, so when it gets complicated the ai has more code to read, it's a rather slight delay but when it gets repeated you can notice the time gap. i don't program however so i don't know that much
I find it extremely interesting that the AI basically claims a 3x3 section as reserve space for storing products, and uses whatever free columns it has for summation of intermediates. It stops not so much because of bad luck as because it is out of "memory". Your world record run of 794,076 on the Stack Overflow site seems to have passed this bottleneck, not just once but several times. However, it is probably mostly due to luck. Could you get longer (if slower) runs if you detected boards with both a 32768 and a 2048 to use minimax instead of expectimax? Basically, assume at that point that you can't brute-think your way past the obstacle, and instead of choosing the path of greatest reward, you choose the path that is least likely to screw you over.
OfficialGamingNetwork is it even possible to get there you would have to have the rng gods on your side and they do not find favor with us petty humans
+Robert Xiao seems like the heuristic here could be improved to make it more efficient/effective. For example at 1:03:39 it thinks for a looong time even though any move other than "up" ends the game.
It gets to 32768 about 36% of the time, so about 1 in every 3 games. You can find full statistics and more technical details in the StackOverflow post (linked from the video description).
what do you think about machine learning applications of this game? Could it be possible to create neural networks so that the program itself learns how to play ? I am asking this because I saw a program do crazy sh*t in a brick breaker game
Bach certainly. There are already videos of neural networks (NN) playing this game. But thats kinda low level anyway, take a look at NN's doing stuff like mimicing human speech, learning how to walk and run etc
One of the heuristics sets the search depth proportional to the number of distinct tiles on the board, since the AI needs to be careful if there's a ton of unmergeable tiles.
pretty sure the fact that it doesn't "think" as hard when there are more free tiles is heuristic, if there was no heuristics the more tiles free the longer it would take as there are an increased number of possible games to play.
+That someone 16384 tile i get once in many many tries; 157440 points are short before it, around 160.000Points i scored more often. bit frustrating :D
It has no favorite corner. It often switches after creating a new high tile. (Technically, there could be a very, very small bias towards the top corner since it evaluates that first, but the effect of the random tile spawn usually has a much stronger effect)
How many games end early? Like before 4096 or even 2048? Or is the game actually mathematically solved (by your AI)? As in, every game can be won if you do it right, and there's no random bad luck.
I can't prove it always wins at 2048. However, I tested it in 100 trials games, and it achieved 8192 in all 100 games (and 16384 in 94). So that's a pretty good indication that it won't lose at 2048. Nevertheless, if you do manage to get it to lose, I would be interested in seeing the log!
So is this actual learned behavior, or is it really an algorithm? Seem like the ladder, but of course there probably would be little difference. Also, I've gotten the 16k tile a couple of times, and I do expect to get the 32k one day, though that is like ly to be my limit I think. ;)
No, this AI is not based on self-learning or learning at all. It's a common misconception that AI requires some form of learning. Many of the recent advances in AI have been learning-based, but not self-learning based - reinforcement learning approaches are still a minority. However, the term AI encompasses far more than these recent approaches - the chess computer Deep Blue (which this 2048 AI more closely resembles) is widely cited as an early, popular AI, and it's definitely not a learning system.
I know what it's like to lose. To feel so desperately that you're right, yet to fail nonetheless. It’s frightening. Turns the legs to jelly. I ask you, to what end? Dread it. Run from it. Destiny arrives all the same. And now, it's here. Or should I say, I am.
It's true that you require skills to reach 4096.. However, from 4096 to reach 32768, all you need is dumb luck.. You will pray to God that number 2 does not appear behind your largest tile
Astaroth F. Actually, considering this AI achieves 16384 in 94% of games (see stackoverflow.com/a/22498940/1204143), it's definitely more than dumb luck. A good strategy, as executed by this AI, can do very well even with bad random spawns.
Astaroth F. I can say that I have gotten the max score you can get on 2048. getting a 65000ish tile. there is a God strat that can get you up high, but it does require some luck.
I hadn't played the game in forever. I just redownloaded it. I got the 120000 block, almost to a perfect game again. But I also have undos, so that helps... alot
What would happen if you have two of the same AI's running on different computers, start this game at the same time and the same two numbers in the same position? would the result be the same? would they make the same moves?
The tiles would still spawn in different places unless the two computers had the same random state (highly unlikely); differing tile spawns would result in different moves. However, this AI is itself deterministic: given a particular board configuration, it will always choose the same move (it does not choose moves randomly). So if you had two computers with the exact same random state, the AIs would make the same moves.
humans are currently better than AI was at the time of this video's release. Even at the time this video was released, humans had already gotten 16384 (but almost certainly not 32768 yet). At the time of your comment (and still now), the world record is 1,124,556 points with a 65536 tile
I watched the first 10 mintues then realized how long it is.
Same, Stinky cheese man
Same :D
cheeseman Thanks to you i got it in 2 mins 😂
This is the second time this week I've seen you, cheeseman.
I'm so popular.
Here's a great illustration of exponential time. This game takes fractions of a second per move, and reaches 2048 (2^11) in just over a minute. To get to 2^15 - just four more doublings - takes over an hour.
It also slows down when there's less spaces so that it can think further ahead and make better moves
@@jakerussell135 yeah.
I would love a cheat code.
It slows down when the board is almost full and that’s why it takes so long but if it never slows down then four doubles would make it 16-17 minutes for 32768 tile
Some perspective for those who are wondering:
So the best possible square you can get with a 16 grid is 131072, and that requires that you get only 4's to pop up towards the end when you run out of squares (since you only need 2 squares to create the final 8 to make it all add together). The maximum possible squares are 131072+65536+32768+16384+8192+4096+2048+1024+512+256+128+64+32+16+8+4. And you wouldn't have room for the last 4 to create 262144, ending on 262140 total.
The worst case scenario, where you only get 2's when you're short of squares, removes one step from the previous list. So 65536+...+2, which is 131070 total.
Getting this close to 65536 is really close to the realistic high score. Though if you by chance happened to reach it and there is potential for almost doubling it, the randomness of the last few available squares would realistically ruin it. The point is you need a lot of luck to get the 65536 square, not only for that square, but also for the 32k and 16k leading up to it, as every time you get close to those, the board fills up, and you're one or two bad randoms away from busting.
With 2 available squares you have 5 possible outcomes:
4 + 4 = OK
4 + 2 = :(
2 + 4 = :(
(2 + 2) + 4 = OK
(2 + 2) + 2 = :(
So a 40% chance to survive with 2 available squares, given that the adjacent square is an 8.
Nice calculations... Too bad they won't help me as I am a very bad player xD
Scy That comment was almost as long as my dick
There isn't a 40% chance. 4 tile spawns with a probability of 0.1
Even if 4 and 2 are appearing with the same probability it still wouldn’t be 40%
You got 25% for 4+4 and 50% for 4+2 or 2+4, and last 25% for 2+2. So in last case, 50% for good piece and same for bad. So in all, it would be 25% + (1/2)*25%=37,5%
Considering 10% chance of 4:
4+4 is 1%
2+2 is 81% and in here, 10% for 4 giving this case possibility of 8,1%
All in all, in reality in the end you got 9,1% chance to continue playing :)
uhh i got 56 mill imgur.com/a/nsA4tIi
I find it incredibly fascinating to see that the AI slows down and struggles at the same points that I naturally would as well.
i think it's because the code is basically a loop of decisions that keeps saying "if" then another if, and it starts with the simplest scenarios, so when it gets complicated the ai has more code to read, it's a rather slight delay but when it gets repeated you can notice the time gap. i don't program however so i don't know that much
@@amalakram8755 yeah no, this AI isnt a basic if else of all possible cases lmao
Would take millions of years to get there
0:31 1024
1:29 2048
4:00 4096
10:58 8192
25:32 16384
1:04:40 32768
1:03:21 - One of each power of two up to 16384 is on the board (with an extra two 2s)
Sharp eye you got there
well, there isn't 2^0
That's why the extra Two 2s are there -> 2/2 = 2^0 :D
But where's 8 and 32?
Mathew Wang watch an extra 2 seconds and you will see it
That sequence of moves at 2:52 was so smart. I would not have thought of that way to combine the 128
And I'm proud of my fucking 4096...
+Ediable ya can't beat a computer bra
Quinn Dams I recently got a 8192 though :)
+Ediable I got a 16384 without cheating, 65536 with cheating.
FortNikitaBullion That's pretty great.
wrong, proud of anyx, ts ok
The thing you came for is at 1:03:49 with the main event at 1:04:39. Even at 0.25x speed, the event is over in seconds.
You are not ridiculous of playing 2048. You are just us who had some fun. You are a special guy.
1:04:35 if you want to skip to the 32768 tile
1:04:41 have tile "32768" 2048 game
my 2048 game. speedruns:
3:48: 2048
6:12: 4096
26:39: 8192
1:06:32: 16384
1:16:16: 16384+4096
1:21:06: 16384+4096+2048
1:25:46: game over 277416 score
2,048 - 1:27
4,096 - 3:57
8,192 - 10:57
16,384 - 25:31
32,768 - 1:04:38
65,536 - 2:34:56
I find it extremely interesting that the AI basically claims a 3x3 section as reserve space for storing products, and uses whatever free columns it has for summation of intermediates. It stops not so much because of bad luck as because it is out of "memory".
Your world record run of 794,076 on the Stack Overflow site seems to have passed this bottleneck, not just once but several times. However, it is probably mostly due to luck. Could you get longer (if slower) runs if you detected boards with both a 32768 and a 2048 to use minimax instead of expectimax? Basically, assume at that point that you can't brute-think your way past the obstacle, and instead of choosing the path of greatest reward, you choose the path that is least likely to screw you over.
Nice AI! So close to 65536 aww :(
OfficialGamingNetwork is it even possible to get there you would have to have the rng gods on your side and they do not find favor with us petty humans
It still needed to make another 16384 tile so it was like 74.99% of the way to 65k
... and i'm happy about getting the 2048 tile...
Is it pausing to think when it runs short on squares?
It is programmed to think harder when there are more unique tiles on the board, since it tends to die in those circumstances.
***** *Top left corner.
+Robert Xiao How do I activate the AI?
+Robert Xiao so it is not a learning AI but rather an algorithm?
+Robert Xiao seems like the heuristic here could be improved to make it more efficient/effective. For example at 1:03:39 it thinks for a looong time even though any move other than "up" ends the game.
the Sky net is taken shape XD
Awsome video, love your work, keep it up man!!
You seem to be so fuccking black, I'm with you bro!
I once got 65536 in 2048. Took like a month with me abusing save states. (By opening multiple tabs you can save progress)
I got the 32768 in physics class back in highschool once(by hand, not an AI). Nice AI though, that's impressive.
My current run is at the 40:06 mark. But I've been playing a little at a time over the past week in a bit... Not even half way...
743,160 --- Incredible AI. Right out the box from github it ran on my machine to 743,160. Amazing!!!
How far does the AI go in average? It doesn't get to 32,768 every time, does it?
It gets to 32768 about 36% of the time, so about 1 in every 3 games. You can find full statistics and more technical details in the StackOverflow post (linked from the video description).
what do you think about machine learning applications of this game?
Could it be possible to create neural networks so that the program itself learns how to play ?
I am asking this because I saw a program do crazy sh*t in a brick breaker game
+Johann Sebastian Bach deep learning can do a hell of a lot more than teach itself to play a game like 2048.
Bach certainly. There are already videos of neural networks (NN) playing this game. But thats kinda low level anyway, take a look at NN's doing stuff like mimicing human speech, learning how to walk and run etc
I am learning so much from this thing
Me: trying to get some work done
My brain: Remember that very popular game from years ago that you sucked at?
If logic were an art, this would be it’s masterpiece.
Amazing! Only a few people can do that, even 9 years later
AT TIME STAMP 1:30 )
The AI beats the game.
The spawning 2 seeing the 32768: "Woooow, that's how I will be later 😯"
It's probably not the perfect game. But due to randomness, it gets close for sure!
its nowhere near perfect
That is so amazing!
Your AI is INSANE!
If you're the chosen one in the Matrix, you'll watch this video in x2 speed and follow every move.
Yea
it got to be asian
Ai san.
Roboto san.
u racist lol
@@bxxocado674 no, we love asian women along with the Hispanic mujeres
How?my highest tile is 256😪😪😪😪😪😪😪
i lower than this 630304 score
my score = 277416
can me beat high score again?
i'm can beat 630304 score?
my 2048 game only run 1 hour
Why the heck are there still 2's at the end of the video
fucking hell. This simulator is me in my teen years.
this game is viral for max. 2 years
this has been around way more than 2 years
My dad remember playing this game on a handheld console from
'80's ;)
Awesome job to all of you!
Interesting, I've gotten 32768 manually before, with a high score of 811132.
This was certainly a lot faster than the amount of time I took lmao
did you use undo
If the last one to pop would have been a 4 instead of 2 - it would have been a 65536, so close, what a shame.
У меня почему-то не запускается программа на Windows. Хочу использовать приложение для telegram бота
Помогите пожалуйста
how to install the ai
1:30 2048 tile
R. I. P. The Ai only needed to make 64 in the PDF space.
This video is so powerful... I'm holding back tears
How beat my highest tile on 0:14
Why does it slow down?
.
It becomes more careful when free spaces are few.
probably calculating moves
One of the heuristics sets the search depth proportional to the number of distinct tiles on the board, since the AI needs to be careful if there's a ton of unmergeable tiles.
It got very bored.
You’re lucky. I can only get up to 4096 and that’s it. I keep thinking I’m gonna make it to 8192 but end up failing
i made a 2048 and im still proud of that while SOMEONE MADE 131072S AND 3.9M SCORE
Have you applied RL algorithms or AI heuristics?
Algorithms, as the creator said the AI stops to "think harder" at some points.
pretty sure the fact that it doesn't "think" as hard when there are more free tiles is heuristic, if there was no heuristics the more tiles free the longer it would take as there are an increased number of possible games to play.
I got beyond this black tile so much the number got outside the block
prove it :)
In 2048, I got 157440 score.
+Aiden Doe Screen shots or you're a massive liar. Upload them to literally any image posting website and then give us the link.
+That someone 157440 seems legit
i have 267728 :D
www.dropbox.com/s/55pm00pw5nkljh5/IMG_0712.JPG?dl=0
Johannes Dimke Well, ok.
+That someone
16384 tile i get once in many many tries; 157440 points are short before it, around 160.000Points i scored more often. bit frustrating :D
on my phone i think i have a score somewhere around 300k, but that's with redos.
it was SO CLOSE (to having another 16384)
Blows my mind
Do you think that it is possible to achieve a counterstop in this game? I mean like reachthe highest number the game has in its memory.
Quick to get the time back in
Damn it was so close to getting that 16000 square
how did u make it
If I am crazy, I guess the evidence is I wasted 2 perfectly good weekends watching this at 1/4 speed. But I'm reasonable at 2048 though.
max speed: 16 move/s
min speed: 0.062 move/s
average speed: 3.6268 move/s
this is crazy
Also, does it have a favorite corner (lower right) like most human players do?
It has no favorite corner. It often switches after creating a new high tile. (Technically, there could be a very, very small bias towards the top corner since it evaluates that first, but the effect of the random tile spawn usually has a much stronger effect)
You can also play the AI game of 2048.
Oh man, I've been practicing the game for almost 1,5 years and my best record is about 288000 with the highest tile of 16384. I feel so lame now (
Вадим Эпштейн Dude... It's an AI
That was insane. To construct 32768, you must have at least all the tiles from 4 to 16384 (13 tiles) and either 1 four or 2 twos.
what mean the AI ?
How many games end early? Like before 4096 or even 2048? Or is the game actually mathematically solved (by your AI)? As in, every game can be won if you do it right, and there's no random bad luck.
I can't prove it always wins at 2048. However, I tested it in 100 trials games, and it achieved 8192 in all 100 games (and 16384 in 94). So that's a pretty good indication that it won't lose at 2048. Nevertheless, if you do manage to get it to lose, I would be interested in seeing the log!
Well you could make a counter-AI that placed 2 or 4 in the most inconvenient squares all the time and see which AI wins. :P
This needs to happen.
How can I make this AI work?
+Javulicraft
CXX=x86_64-w64-mingw32-g++ CXXFLAGS='-static-libstdc++ -static-libgcc -D_WINDLL -D_GNU_SOURCE=1' ./configure ; make
then run bin/2048
*casually watching video and get notification at **7:23*
*come back to have the time listed*
HOLY SHIT ITS 2 HOURS LONG
1hours?????????????
So is this actual learned behavior, or is it really an algorithm? Seem like the ladder, but of course there probably would be little difference.
Also, I've gotten the 16k tile a couple of times, and I do expect to get the 32k one day, though that is like ly to be my limit I think. ;)
ze ladder
what type of self learning does it include?
perfect software but i wouldn't call it AI
No, this AI is not based on self-learning or learning at all. It's a common misconception that AI requires some form of learning. Many of the recent advances in AI have been learning-based, but not self-learning based - reinforcement learning approaches are still a minority. However, the term AI encompasses far more than these recent approaches - the chess computer Deep Blue (which this 2048 AI more closely resembles) is widely cited as an early, popular AI, and it's definitely not a learning system.
Dudde doubled my personal record of 16 k
how i died at bad 4 and score of 277416
SOOOO CLOSE...!!!! to the next tile, bad rng??
1:04:40 It hit 32768
It's giving error.
I know what it's like to lose. To feel so desperately that you're right, yet to fail nonetheless. It’s frightening. Turns the legs to jelly. I ask you, to what end? Dread it. Run from it. Destiny arrives all the same. And now, it's here. Or should I say, I am.
This is what I watch instead of sports
Programmer deserves a prize literally
pround just 8192 oh damm!!
I got 8192 and felt like a GOD lol...even sent my brother a screen shot to brag. Dang though, the numbers in this are utterly crazy 😄
just realised that this video is too long
It's true that you require skills to reach 4096..
However, from 4096 to reach 32768, all you need is dumb luck..
You will pray to God that number 2 does not appear behind your largest tile
Astaroth F. Actually, considering this AI achieves 16384 in 94% of games (see stackoverflow.com/a/22498940/1204143), it's definitely more than dumb luck. A good strategy, as executed by this AI, can do very well even with bad random spawns.
Astaroth F. I can say that I have gotten the max score you can get on 2048. getting a 65000ish tile. there is a God strat that can get you up high, but it does require some luck.
you can get one tile further
I hadn't played the game in forever. I just redownloaded it. I got the 120000 block, almost to a perfect game again. But I also have undos, so that helps... alot
Привет ❤😊
最後の方の延命措置がプロ
What would happen if you have two of the same AI's running on different computers, start this game at the same time and the same two numbers in the same position? would the result be the same? would they make the same moves?
The tiles would still spawn in different places unless the two computers had the same random state (highly unlikely); differing tile spawns would result in different moves.
However, this AI is itself deterministic: given a particular board configuration, it will always choose the same move (it does not choose moves randomly). So if you had two computers with the exact same random state, the AIs would make the same moves.
IC, thanks
1:43:20 *WHYYYYYYYYY?????? I WANTED A 65536!!!!!!!!!!!!!!!!!!!*
Incidentally the AI will avoid getting 65536 is that counts as a 0 :). Isn't that true?
i wanna play this on somebodys phone to fool him.
We can play in this tablet, too! ENJOY! :-)
The best score possible IS NOT 131072, for all the people saying this. I’d be happy to explain
the best tile possible is in fact 131072, but it's almost impossible for it to actually happen
1:43:22
my god
1:03:21 almost died
A.I. did this? Wow, the human race is screwed.
humans are currently better than AI was at the time of this video's release. Even at the time this video was released, humans had already gotten 16384 (but almost certainly not 32768 yet). At the time of your comment (and still now), the world record is 1,124,556 points with a 65536 tile
Crazy to think that the AI now improved the 16k tile odds from 94% to 99% and the 32k tile odds from 36% to 80%. There is sill improving
Video 3855 of commenting #BringBackDislikes on every unique video I watch (not dislike) in 2022.
2048 Movie
i got over 6 billion points without cheating before
in only 10 minutes
You see ?! It is fun! And, let us speak in C-English ! :-)
My highscore is 126940. I got an 8192, 2048, 1024, and a 128