AI learns to play 2048

Sdílet
Vložit
  • čas přidán 3. 05. 2024
  • I created an AI to play the game 2048, his name is Thomas
    Huge thanks to Brilliant.org for supporting this channel check them out at www.brilliant.org/CodeBullet
    I have twitter now. Yay
    follow me to fill the void in my heart
    / code_bullet
    Become a patreon to support my future content as well as sneak peaks of whats to come.
    / codebullet
    Check out my Discord server
    / discord
    I know heaps of people are going to ask so here is the music
    Mirror Mirror - Diamond Ortiz
    Smiles for miles - Silent Partner
    Hyperspeed - eveningland
    Gypsy Dance - Topher Mohr and Alex Elena
    Etherial Chior Ascends - Doug Maxwell
    Wishful thinking - Dan Labowitz

Komentáře • 7K

  • @campbellyrc12
    @campbellyrc12 Před 3 lety +9271

    Tommy looks five moves into the future.. he sees his failures coming and has no choice but to helplessly walk towards them

    • @infrences
      @infrences Před 3 lety +76

      Idk why this comment doesn’t have likes

    • @Hoghiderrr
      @Hoghiderrr Před 3 lety +67

      He must follow fate

    • @derek-182
      @derek-182 Před 3 lety +87

      @@Hoghiderrr It is.... inevitable

    • @filetman125
      @filetman125 Před 3 lety +15

      ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ

    • @nolanfaught6974
      @nolanfaught6974 Před 3 lety +52

      It seems like the algorithm wasn't able to account for where tiles will appear or their value, so looking 5 moves into the future isn't much better than just looking one move into the future

  • @ihasarax
    @ihasarax Před 4 lety +8521

    Do i understand: no
    Am i entertained: yes

  • @nintendocaprimoon63
    @nintendocaprimoon63 Před 3 lety +3682

    New favorite insult:
    "You're about as good as randomly pressing the left key"

  • @Sgtcrazyeyes235
    @Sgtcrazyeyes235 Před 3 lety +1787

    Hearing you switch between calling the ai tommy and tomas when you’re frustrated is like a parent being upset at their child

  • @xexpaguette
    @xexpaguette Před 3 lety +9847

    When I was a kid I didn't even know there was a strategy and thought it was a clicker game where you just swipe as fast as you can randomly.

    • @jasonhoward2613
      @jasonhoward2613 Před 3 lety +297

      There’s a strategy?

    • @xexpaguette
      @xexpaguette Před 3 lety +110

      @@jasonhoward2613 yes

    • @bendily3623
      @bendily3623 Před 3 lety +147

      @@jasonhoward2613 there are many actually

    • @jasonhoward2613
      @jasonhoward2613 Před 3 lety +97

      @@bendily3623 wtf is the strategy everything is random chance except the math which is partly random to

    • @mattsadventureswithart5764
      @mattsadventureswithart5764 Před 3 lety +94

      I found always going clockwise (or anti) worked. Up, right, down, left (repeat)

  • @ryanantoine8457
    @ryanantoine8457 Před 3 lety +6021

    "it keeps lower scoring tiles away from the highest score tiles"
    So the AI enforces aristocracy.

  • @user-ur7ri6ye1d
    @user-ur7ri6ye1d Před 3 lety +2183

    Code bullet is so brutal that he doesn't creates algorithm for game, He creates game for algorithm

    • @thebiggestthickestbean5232
      @thebiggestthickestbean5232 Před 3 lety +34

      I’ve never thought about it like that but yea you’re right, that’s pretty funny lol

    • @LordMaliscence
      @LordMaliscence Před 3 lety +32

      @@Mightic exactly, with most simple games like this, it's much better to just code it yourself instead of trying to interface with an existing game

    • @puppergump4117
      @puppergump4117 Před 2 lety +10

      @@Mightic Yeah I think he started creating the games after the Piano Tiles incident.

    • @Wateristic
      @Wateristic Před rokem +2

      its funny

    • @photonbee1932
      @photonbee1932 Před rokem +1

      @@puppergump4117 this video was created BEFORE that… incident…

  • @kympx8460
    @kympx8460 Před 2 lety +298

    Being named Thomas, I felt quite called out through this

  • @LazyLetifer
    @LazyLetifer Před 4 lety +8903

    “Every one has the right to an opinion but not everyone’s opinion is right”
    Best quote of the decade

    • @melonx5380
      @melonx5380 Před 4 lety +28

      I agree with you

    • @thel0n3lytramp63
      @thel0n3lytramp63 Před 4 lety +116

      That quote is an opinion, and it is wrong

    • @greasychickenugget4410
      @greasychickenugget4410 Před 4 lety +34

      It's so true. Just like how my friend thinks dragon ball is the best anime. His opinion is wrong

    • @khalil7011
      @khalil7011 Před 4 lety +66

      Opinions cannot be right or wrong, if there is evidence behind the opinion then it is called a substantiated assumption and can be correct or incorrect

    • @thel0n3lytramp63
      @thel0n3lytramp63 Před 4 lety +44

      @@khalil7011 That opinion is also wrong IMO

  • @gristlyscarab7938
    @gristlyscarab7938 Před 4 lety +3441

    Plot twist: It was his friend actually named Thomas playing all along

    • @fredthespear4923
      @fredthespear4923 Před 4 lety +59

      Gristly Scarab plot twist: Thomas was an ai

    • @Beanpolr
      @Beanpolr Před 4 lety +64

      @@fredthespear4923 plot twist: Thomas was an ai made by his friend Thomas

    • @thomasnolastname8734
      @thomasnolastname8734 Před 4 lety +33

      *sips water*

    • @badutubezboi5050
      @badutubezboi5050 Před 4 lety +17

      mega oof plot twist: Thomas made Thomas who was an AI who made Thomas who was an AI

    • @IndoPhazrVX
      @IndoPhazrVX Před 4 lety +4

      @ReTri 64 Ahh yes, a man of culture I see

  • @chizzicle
    @chizzicle Před 3 lety +138

    I like how even when "Thomas" finally succeeds, it's still less efficient than any even slightly smart human player, making Tommy sort of pointless, but he always was a problem child and it's the journey that matters, not the destination

  • @O_CABBAGE
    @O_CABBAGE Před 2 lety +44

    "Thomas kinda sucks" I hear enough of this normally, I don't need it to happen here too

  • @creeperx3sssboom347
    @creeperx3sssboom347 Před 5 lety +6061

    Tomas: "I've looked 5 Moves in the future"
    Code Bullet: "In what one do we get to 2048?"
    Tomas: "One"

  • @songbirdlover
    @songbirdlover Před 5 lety +2804

    Wow. I was just impressed with you recreating the game..

    • @riseeuterpe2838
      @riseeuterpe2838 Před 5 lety +39

      I'm pretty sure the original creator allowed for its free distribution so idk if he rly had to do that tbh XD

    • @stargazingsprout
      @stargazingsprout Před 5 lety +183

      Harasuke Amu I’m pretty sure he needs to remake the game so the AI can see the code and actually play the game

    • @natenobles4372
      @natenobles4372 Před 5 lety +59

      The guy who made 2048 did it for fun in a week so it’s no surprise that it was kind of easy to recreate

    • @songbirdlover
      @songbirdlover Před 5 lety +4

      @@natenobles4372 wow.

    • @Deathmastertx
      @Deathmastertx Před 5 lety +10

      Recreating the game in Java was the final project of my first computer science unit at university.

  • @ricegorm
    @ricegorm Před 3 lety +122

    As somebody who is named Thomas, this ai is basically a perfect recreation of anybody named Thomas. They fail at everything for a while, then somehow get it out of sheer luck.

    • @denisucuuu
      @denisucuuu Před 2 lety +3

      Definitely not Thomas Wayne, since he succeeded for a while until running out of luck in an alleyway

    • @divakarmenon5381
      @divakarmenon5381 Před rokem

      ​@@denisucuuu that's Bruce Wayne?

    • @visiblerat
      @visiblerat Před 10 měsíci +1

      i am also named thomas and can confirm

    • @nirorit
      @nirorit Před 20 dny

      @@divakarmenon5381no

  • @mr.mysteryjelly1532
    @mr.mysteryjelly1532 Před 2 lety +58

    "I CAN GO TO BED"
    has to be the funniest/saddest thing I have ever heard

  • @Sod1ePop
    @Sod1ePop Před 4 lety +749

    "failure is important for learning"
    so that's why my dad says I'm important

  • @theeliteeaglegamer5893
    @theeliteeaglegamer5893 Před 5 lety +5110

    Ai learns to code Ai

  • @melissaclaassen9707
    @melissaclaassen9707 Před 3 lety +56

    I love how much "failure" you actually include in your videos. It's interesting to watch how many types of things can actually go wrong while programming, and hearing what your thought process is to overcome them.

    • @lillyp1652
      @lillyp1652 Před 2 lety

      So basically avoiding the problem

  • @mantistsai6457
    @mantistsai6457 Před 2 lety +9

    Your second approach reminds me of the Othello algorithm I wrote for my introductory coding course a few semesters ago and I just wanted to say, I 100% understand watching said algorithm come *so close*

  • @Thomashorsman
    @Thomashorsman Před 5 lety +3568

    Sorry I wasn’t performing well

  • @axelandersson6314
    @axelandersson6314 Před 5 lety +574

    3:40. Well, that’s literally the strategy I’ve gone with for the past 2 years...

    • @enriquejunchaya5784
      @enriquejunchaya5784 Před 5 lety +29

      Axel Andersson same, but it doesn't always get you a 2048. There's the "luck" factor and that's why Thomas couldn't get it either.

    • @wthrwyz
      @wthrwyz Před 5 lety +47

      This pretty much *is* the strategy for 2048; pick a corner and work toward it. It doesn't always work because the random placement of new tiles will occasionally put you in a state where it becomes impossible to win despite perfect play (as illustrated by the video), but that's the nature of any game that features a random element. Put simply, luck beats skill any day of the week.
      Whatever you do, never move your largest value tile out of that corner - the RNG *will* screw you by immediately spawning a 2 there.

    • @wwoods66
      @wwoods66 Před 5 lety +5

      @Nathan Williams -- "never move your largest value tile out of that corner"
      But sometimes that's the only move, alas.

    • @wthrwyz
      @wthrwyz Před 5 lety +3

      Indeed, and the RNG gremlins are already chuckling.

    • @edde2429
      @edde2429 Před 5 lety

      Wouldn't a good way to make the AI develop better be to let each one do like 10 runs and see which one was the most consistant

  • @ethanhoward389
    @ethanhoward389 Před 2 lety +28

    Plot twist: hell release the second enigma machine video in the year 2048..he's leaving us clues

  • @owltactics5540
    @owltactics5540 Před 2 lety

    I some how keep arriving at your videos late at night when I am searching for vids to watch and I always get so fascinated by you content.

  • @azrubs593
    @azrubs593 Před 5 lety +728

    I felt so sad for him when he said “The next improvement was at generation 227” that’s gotta be so depressing

    • @sergioarvizu2972
      @sergioarvizu2972 Před 5 lety +48

      humans probably on generation like a million yet we still don’t know how to live perfectly. Good job AI

    • @aaronstorey9712
      @aaronstorey9712 Před 5 lety +9

      *247*

    • @Subakak
      @Subakak Před 5 lety

      Me too

    • @pancakes9648
      @pancakes9648 Před 5 lety

      247***

    • @ryanrising2237
      @ryanrising2237 Před 4 lety +14

      Sergio Arvizu According to Wikipedia, the earliest representative of what we’d call humans, Homo Habilis, first showed up around 2.8 million years ago. Assuming generations take 20 years, which is probably very uninformed, that would be 140,000 generations.
      Not as much as a million, but a bit more time to develop than 247 generations. That’d only get us to here from just before the Great Pyramids were built.

  • @arpitranasaria4878
    @arpitranasaria4878 Před 5 lety +1449

    That moment at 9:08 where Tommy could have just gone up left left and reached 2048

    • @placeholder1915
      @placeholder1915 Před 5 lety +17

      Arpit Ranasaria YEAH

    • @saeber6630
      @saeber6630 Před 4 lety +61

      *GODDAMIT TOM*

    • @nightowl19god25
      @nightowl19god25 Před 4 lety +16

      Arpit Ranasaria right up left left

    • @mehregankbi
      @mehregankbi Před 4 lety +41

      That’s where u see the value of human labeling. Simulating a human learning prespective is so hard that its better if a pro player of 2048 plays the game 500 times and we give the data to our neural network. Then AI can have a very good sense of what playing this game looks like. At this point AI knows how to play the game but there’s also room for improvement. so just like code bullet did, now we can use “choosing the best out of 5 moves” just like he did and it is gonna get better and better.
      The more complex the problem (self driving car) the more useful the human teaching

    • @Doctor_Straing_Strange
      @Doctor_Straing_Strange Před 4 lety +1

      OMG

  • @jackburg5595
    @jackburg5595 Před 3 lety

    Seeing you use processing is so nostalgic. Processing is fantastic

  • @calebdeming5515
    @calebdeming5515 Před 2 lety +1

    You are my favorite CZcams channel man. Love this shit

  • @Alex-dz8dm
    @Alex-dz8dm Před 5 lety +1734

    AI learns to take over the world
    -Code Bullet Video 2019

    • @Souls_29
      @Souls_29 Před 5 lety +9

      Hyrule Warrior if AI robots take over the world we can just blame Code Bullet

    • @hyperion9934
      @hyperion9934 Před 5 lety +16

      "His name is Paul and he conquers nations"
      -Code Bullet 2020

    • @TFWPLSSUB
      @TFWPLSSUB Před 5 lety +2

      ...of Minecraft

    • @davisgarrad7891
      @davisgarrad7891 Před 5 lety +2

      I feel like a civilization video would be cool actually

    • @captionato
      @captionato Před 5 lety

      lmao

  • @BrianJones01
    @BrianJones01 Před 4 lety +731

    When I went down the rabbit hole with this game, my strategy revolved around one simple restiction: choose a direction (in my case, up) and never move in that direction. A consequence of this is that the largest tiles end up on one face, similar to your "top left for highest value block" strategy. I wonder how the AI would do with this restriction in direction.
    Edit: 2048 became an easy target, if I recall correctly, 8192 was the max I reached before throwing the game in my "NEVER TOUCH AGAIN" category.

    • @xocheee
      @xocheee Před 3 lety +14

      i could neverrrrr reach 8196 how long did that take???

    • @xocheee
      @xocheee Před 3 lety +27

      @Natsu Dragneel lol do you mean score or tile? because i doubt youre dating the world record holder lmaoooo

    • @xocheee
      @xocheee Před 3 lety +16

      @Natsu Dragneel probably on the app where undos are possible too...

    • @BrianJones01
      @BrianJones01 Před 3 lety +32

      @Natsu Dragneel I don't know that it can be considered "low" against any reasonable standard, even if it's not a record. To put it into perspective, a 6x6 board offers 2.25 times as much play area as a 4x4 board, and with that extra area comes many options for storing large tiles while building smaller tiles needed for further advancement (at a point, the hardest problem becomes efficient use of space). But still, congratulations to your girlfriend, impressive work!

    • @NoOne-wz2ht
      @NoOne-wz2ht Před 3 lety +10

      My strategy is spam random buttons at the start then press random buttons

  • @Homieonice
    @Homieonice Před 2 lety

    The video I been looking for for a WHILE

  • @nbabackcourtmedia
    @nbabackcourtmedia Před 2 lety +19

    I finally beat this game after so many years, I can die happy now

    • @nbabackcourtmedia
      @nbabackcourtmedia Před 2 lety +1

      @HelloThere nothing crazy it just says you won and you can keep going if you want

  • @ocinnico2608
    @ocinnico2608 Před 4 lety +798

    "what's up guys, today's video is in 2048"
    -code bullet accidentally reveals his origins

    • @aang8026
      @aang8026 Před 4 lety +4

      Flunkyvs Lacky well now it isn’t anymore, so let’s like it again to try and get 512

    • @c10v3r
      @c10v3r Před 4 lety +3

      **420 likes**
      :)
      **likes**

    • @evertree2133
      @evertree2133 Před 4 lety

      @@c10v3r But why?

    • @dougthedonkey1805
      @dougthedonkey1805 Před 4 lety

      I don’t get it

    • @dougthedonkey1805
      @dougthedonkey1805 Před 4 lety

      @Buddy Christ oh, I see. But what does that have to do with code bullet’s origins? Are they saying he’s a time traveler?

  • @LarryJL
    @LarryJL Před 4 lety +437

    You should've told it that in addition to having the highest possible number in the top left corner is good, it should also prefer having as much free slots as possible and get rid of small tiles as much as possible

    • @fakename7725
      @fakename7725 Před 3 lety +9

      I would have thought that would be the one and only scoring method for future outcomes

    • @varmituofm
      @varmituofm Před 3 lety +9

      He also had that the 2nd highest scoring tile should be next to the highest scoring tile. This should continue on down, the 3rd should be next to the second, the 4th next to the third.

    • @observable3194
      @observable3194 Před 3 lety +6

      The highest theoretical number is 131k but the biggest number achieved is 65k (I know person who’s done it but don’t know if anyone else has)

    • @garethbaus5471
      @garethbaus5471 Před 3 lety +4

      @@observable3194 I struggle getting past 4092 and I have spent way too much time playing 2048.

    • @frederickfritzsche97
      @frederickfritzsche97 Před 3 lety +7

      Yeah, I think the entire problem boils down to develop a better way to evaluate the "game state". Looking 5 steps into the future should be absolutely enough to win this game, probably even 3. But it's sort of useless if your definition of whether the game state is good or not is so bad. eg aligned values (along a sort of S-shape) are much better than a 15 / 6 / 13 / 1 / 7 etc. Would be a rather complex algorithm for a simple game but hey

  • @zeonos
    @zeonos Před rokem +1

    4 years later and i am still waiting for that enigma video.... you cant leave me hanging like this :(

  • @MetaLemonaide
    @MetaLemonaide Před 2 lety +5

    Hey! I actually made a 2048 ai in college. Takes me back. Mine performed okay, but the algorithm was definitely trash compared to the top tier algorithms. Was satisfying to see it all work though.

  • @leonjefferson6783
    @leonjefferson6783 Před 4 lety +1750

    CB: Since the difference between random movements and intelligent movements is very small...
    Me: Yes! I'm almost intelligent!
    edit: 1.5k likes :O

    • @sheeloesreallycool
      @sheeloesreallycool Před 4 lety +3

      100th like babyyyyy

    • @kosk-kosk2777
      @kosk-kosk2777 Před 4 lety +2

      Lol

    • @whydoiexist1527
      @whydoiexist1527 Před 4 lety +1

      881 like baby

    • @TheStoneBreak
      @TheStoneBreak Před 4 lety

      I don't know the first thing about coding but always thought it was interesting. Is something like this really difficult or is it kind of an "eh" thing to other coders and only impresses the ignorant

    • @losereye
      @losereye Před 4 lety +1

      @@TheStoneBreak Oh god these algorithms are pretty monserous, its very impressive depending on experiece/foucus in ur code, as coding styled progammers simmilar to him wouldn't vice virsa

  • @JStubblefield79391
    @JStubblefield79391 Před 4 lety +356

    Code Bullet: “Alright, I think I’ll go to bed.”
    Thomas: “You’ll go to bed when we’ve reached 2048.”

  • @maximthemagnificent
    @maximthemagnificent Před 3 lety +5

    Seems like using NEAT to evolve an evaluation metric for the lookahead approach would be a useful fusion of the two methods.

    • @noahtawil8793
      @noahtawil8793 Před 2 lety

      that’s how really advanced AIs like alpha zero work, they use the neural network to learn which parts of the game tree to look into

    • @MEANLEANBEAN
      @MEANLEANBEAN Před 2 lety +1

      Wow thats neat

  • @shawnsimons418
    @shawnsimons418 Před 2 lety +17

    coding is just "if" statements
    - a wise man 2021

  • @rcoverc
    @rcoverc Před 5 lety +1878

    My highest tile is 8192. Take that thomas.

    • @dragovern
      @dragovern Před 5 lety +77

      One game where we are better... still

    • @thejman3489
      @thejman3489 Před 5 lety +84

      RCoverC one time I got a 4096 tile and 2 2048 tiles but they weren't next to each other and I lost because I couldn't combine then and free up space.

    • @rcoverc
      @rcoverc Před 5 lety +59

      @@thejman3489 Nice job. That's still a great score. I haven't played 2048 for about 6 months but I can tell you that I was improving slowly. Once I had 2 8192 tiles and I couldn't combine them *FACEPALM* :(

    • @CavemanNo.12
      @CavemanNo.12 Před 5 lety +46

      I got to 512. Snake is more my game

    • @MichaelTwitt
      @MichaelTwitt Před 5 lety +39

      I mean not trying to brag but...16384

  • @VoVilliaCorp
    @VoVilliaCorp Před 4 lety +156

    "Yes, I can go to bed!" the typical software engineer saying after a project XD

    • @ITAC85
      @ITAC85 Před 3 lety +3

      "I CAN, I just don't WANT to." - Typical Software Engineer ( not me)

  • @vel_kor
    @vel_kor Před 3 lety

    i guess, it can take maximum after some "little" time period)
    (maximum is when all board is filled by the "snake" from 131072 to 4, i`ve did it by myself, and much people too)
    looking forward to see video with maximum)

  • @Mothuzad
    @Mothuzad Před 2 lety +1

    Perhaps a better scoring algorithm would reward keeping tiles of the same value adjacent, and also somewhat reward keeping tiles of almost-the-same values adjacent.
    Also reward empty space, because that's your distance from the loss condition.

  • @PandaFan2443
    @PandaFan2443 Před 5 lety +590

    The first generation is already better than me.

  • @itsme.lucaaa
    @itsme.lucaaa Před 4 lety +596

    1:36 “let’s see what happens when we press the up arrow - aaaand they’re gone” 😂😂😂

    • @jakobbarbian2893
      @jakobbarbian2893 Před 4 lety +33

      Let's see what happens when we deposit this money, and its gone

    • @yoak
      @yoak Před 4 lety +14

      Welcome to standing up school. And you failed..

    • @gjk-arts5855
      @gjk-arts5855 Před 4 lety +2

      Helix Peli asdf movie....
      And I love it

    • @yoak
      @yoak Před 4 lety

      GJKtale - Gacha and undertale have you watched #12?

    • @gjk-arts5855
      @gjk-arts5855 Před 4 lety

      Helix Peli only that 1-11 complitition

  • @Flaming_Pulsar
    @Flaming_Pulsar Před 3 lety

    While keeping the biggest number in the corner and the next biggest right next to it is an important part of the winning strategy, it's also worth noting that the undo function is quite useful for any unlucky spawns. For example, if you are forced to move the biggest number out of the corner and a 2 spawns in the corner, you can undo the move3 and do it again in the hopes of a better spawn. Or another one could be a 2 spawning when a 4 would be better (or vice versa). Or times when the spawn happens on the wrong line and it would mess up all your plans. While a lot of these examples usually won't prevent you from getting to 2048, getting into higher numbers requires knowing when to use the undo function (also worth noting that you can only undo 1 move at a time).

  • @Azoperoa
    @Azoperoa Před 2 lety

    ive never watched your channel on my pc and yet I've been recommended you, I don't mind

  • @Crazy1793
    @Crazy1793 Před 5 lety +1782

    It's April 21 2019 still no part 2 of enigma machine

  • @sir_slimestone3797
    @sir_slimestone3797 Před 4 lety +507

    "Everyone has a right to an opinion, but not every opinion is right" I love it, I'm stealing it for future arguments!

    • @mcplumpkin6191
      @mcplumpkin6191 Před 4 lety +4

      opinions aren't wrong or right

    • @sir_slimestone3797
      @sir_slimestone3797 Před 4 lety +3

      @@mcplumpkin6191 whoosh that flew over your head

    • @mcplumpkin6191
      @mcplumpkin6191 Před 4 lety +8

      @@sir_slimestone3797 woooosh*
      by the way, it's hard to tell if this was a joke because you don't know the tone of the text.

    • @geli95us
      @geli95us Před 4 lety +5

      @@mcplumpkin6191 yes they are, if your opinions collide with evidence, then they are wrong.

    • @mcplumpkin6191
      @mcplumpkin6191 Před 4 lety +1

      @@geli95us they are based on thoughts and experiences.

  • @matthewp4046
    @matthewp4046 Před 3 lety

    I still want that second enigma video...
    Or, to be fair, any video..
    Just keep making videos please.

  • @ThatOneGuyYaKnow
    @ThatOneGuyYaKnow Před 4 měsíci

    For those curious like me of the BGM in 8:18, its;
    "25-03: There Is Nothing Left to Say or Do (Short Version)"

  • @tysonmay5522
    @tysonmay5522 Před 5 lety +890

    Code an Ai that can beat another Ai in chess

    • @yolkeggs
      @yolkeggs Před 5 lety +31

      Wait wouldn’t it always be a tie or am I missing something

    • @tysonmay5522
      @tysonmay5522 Před 5 lety +7

      Good point

    • @InnocentC0
      @InnocentC0 Před 5 lety +20

      There's a chess match for AI, though. It's quite intense and surprisingly complex.

    • @BorkKillsOneLegMan
      @BorkKillsOneLegMan Před 5 lety +26

      @@yolkeggs let both ai know it can't end in a tie

    • @diegocastro7434
      @diegocastro7434 Před 5 lety +26

      @@yolkeggs you're missing something! Chess matches between different engines (ai's) are very common and some are far superior to others. Google recently destroyed the previous benchmark for the strongest engine (Stockfish) with their deep mind ai. In fact, by changing the difficulty of the chess computer on your phone, you're essentially getting two different "AI's".

  • @RqtiOfficial
    @RqtiOfficial Před 5 lety +7544

    ai learns to play agar.io

    • @bluue5756
      @bluue5756 Před 5 lety +334

      David Simon And?

    • @bluue5756
      @bluue5756 Před 5 lety +258

      @@legoguney but *everyone* had to love it for some reason

    • @art-oq1pi
      @art-oq1pi Před 5 lety +108

      David Simon how is it trash

    • @mac1cam
      @mac1cam Před 5 lety +33

      Someone allready made a bot for agar.io

    • @anton7591
      @anton7591 Před 5 lety +211

      @@legoguney just Because it's old does not mean that it is bad

  • @dalvontah
    @dalvontah Před 2 lety +20

    You’re teaching me better than my professors did

  • @geezus7152
    @geezus7152 Před 3 lety +21

    Bullet here explains the definition of camping “TOMMY KEEP TOP LEFT”

  • @zephyromenix8755
    @zephyromenix8755 Před 3 lety +174

    Every single AI video: It’s evolving, just backwards

  • @kiweping5
    @kiweping5 Před 4 lety +366

    If there was no visuals this would be the title:
    Man screams at someone (presumably his son) for 11 minutes and 10 seconds

  • @cuteandcewl
    @cuteandcewl Před 3 lety

    Congratulations on 6.9 mill views mate! Nice

  • @itsTomate
    @itsTomate Před 3 lety +2

    This just popped up, I’m expecting a video in the next two weeks. CZcams always does this to me for some reason: a video I’ve already watched is re-recommended to me, and less than a week later a new video comes out. Hope I’m right

  • @rasput1n6
    @rasput1n6 Před 5 lety +166

    *Make an AI learn to play Windows XP Pinball??*
    *I WOULD LOVE IT if it makes fancy combos continuously or see what he prefers to do lol*

  • @SpeedySlothBoi
    @SpeedySlothBoi Před 4 lety +65

    CB: keep the highest tile in the top left
    Tommy: how about... no?

  • @reubenransfield7914
    @reubenransfield7914 Před 2 lety +1

    oh god.. 8:22 feels like when you’re on the last mission of a game and a slowed down instrumental version of the main theme plays…

  • @eyesak387
    @eyesak387 Před 2 lety +2

    Crazy how much calmer and happier he sounded in his old videos

  • @MJDev14
    @MJDev14 Před 5 lety +199

    I have no clue what youre saying half the time but your channel is amazing

  • @agentstache135
    @agentstache135 Před 5 lety +717

    AI learns to play threes. Threes is a much more interesting game that was released before 2048. It takes a lot more strategy and just looks better

    • @Shennzo
      @Shennzo Před 5 lety +19

      @Wax Meatley Funny thing is 2048 is the one that ripped off threes and gave it better graphics, that's what made it more popular

    • @seven_chords
      @seven_chords Před 5 lety +7

      also the system behind the tiles added is much more complex in threes

    • @dominickeijzer5844
      @dominickeijzer5844 Před 5 lety +2

      You're the Illuminati.

    • @Ferotiq
      @Ferotiq Před 5 lety +18

      Of course it was released before 2048, it isn’t even 2048 yet! It’s only 2019!

    • @dominickeijzer5844
      @dominickeijzer5844 Před 5 lety +3

      Wooosh.
      Edit: I wooshed myself.

  • @mythicallegend1047
    @mythicallegend1047 Před 9 měsíci +1

    Me: *goes to yt to find some info and help on sth*
    YT: i’m gonna put a super interesting video from CB om your frontpage to distract you for a solid 11 minutes and 10 seconds

  • @mattt8265
    @mattt8265 Před 3 lety +1

    It sounds like you implied you were using the minmax algorithm to evaluate the future game states. When evaluating the game state, you could take into consideration the possible locations for the new tile & its value (called substates) and apply a modified minmax algorithm to those substates. I can tell that this is not being done because of the move at 8:25, where 256,128,128 is moved right. The minimum state for that move would have been a 2 being added at the top left corner, permanently (for the forseeable 5 future moves, actually) displacing 512 from being in the top left corner. A left direction in this instance would be the better move.
    I'm halfway motivated to make a better algorithm for this game myself now

  • @jeffreythecow2392
    @jeffreythecow2392 Před 4 lety +192

    Thomas: Is an AI and within 5 tries reaches 2048
    Me: can’t even get to 512

    • @3_ormorecharacters
      @3_ormorecharacters Před 4 lety +3

      I can barely get to 64

    • @WistfulAZ
      @WistfulAZ Před 4 lety +10

      A computer pressing random keys has gotten farther than I ever have.

    • @alexandrubragari1537
      @alexandrubragari1537 Před 4 lety +3

      Stop to pretend to be so dumb lmao, its actually impossible to not to reach 256 even moving completely random i guess, anyway back at school my record was 8192 (+ 2 2048,so i wasnt really close to the 16k)

    • @teraspeXt
      @teraspeXt Před 3 lety +4

      @@alexandrubragari1537 It's not impossible. You just have to intentionally be stupid.
      Edit: I think it might be near impossible to not get to 32.

    • @williamsomlai141
      @williamsomlai141 Před 3 lety +1

      ATS Gaming you gave me challenge, im getting under 32 and i will never stop trying

  • @simplistxc6649
    @simplistxc6649 Před 5 lety +158

    He will single handedly create an AI that will destroy the world.

  • @giorgosphilippou81
    @giorgosphilippou81 Před 3 lety

    I think it would be a good idea to add an additional option like if the box with the highest score is on the left corner and that row is not full of 4 boxes then never go right. Also, if that works I think this thinking should apply also for the second row with an exception when it will make an addition from second to first row.

  • @humaneevee672
    @humaneevee672 Před 3 lety +1

    that moment when the segway was so good you didn't even realize it was an ad

  • @unrealcactus8546
    @unrealcactus8546 Před 5 lety +2618

    **Instant click**

    • @ginters5389
      @ginters5389 Před 5 lety +6

      bro same

    • @sciencelover4079
      @sciencelover4079 Před 5 lety +2

      Видео наоборот Watch my CZcams channel it's about artificial intelligent taking over the world m.czcams.com/video/04vDiPiPyMs/video.html

    • @memes3620
      @memes3620 Před 5 lety

      Видео наоборотy

    • @shawnyewest6812
      @shawnyewest6812 Před 5 lety

      Видео наоборот yeah

    • @Ida-xe8pg
      @Ida-xe8pg Před 5 lety +1

      is this guy a hacker???

  • @ryanzwe
    @ryanzwe Před 5 lety +85

    I found your channel from the enigma video, would be great to see some more!

  • @StealthyDead
    @StealthyDead Před 9 měsíci +1

    I remember figuring this out and maxing out the game because you couldn't fit any more unique tiles on the screen to add together

  • @ShockingRotom
    @ShockingRotom Před 3 lety

    I used that algorithm for a connect four game i made lol the first algorithm ive ever done its actually much more simple to do than it sounds. Most of the complexities comes from ajusting the points that are given for different game stats and stuff to make the ai the best as possible takes alot of small adjusting

  • @XanderLuciano
    @XanderLuciano Před 5 lety +12

    Your sense of humor in these is simply amazing! Love it, doesn't matter how successfully or not your creations are, your commentary makes these 10/10. It's pretty cool to see what challenges you run into and what solutions you come up with to them. Interesting to see your different approaches :)

  • @meh3277
    @meh3277 Před 5 lety +756

    This was even more hilarious to me because my real name is Thomas but I rarely go by that anymore.

  • @AxGryndr
    @AxGryndr Před 6 měsíci

    I think the issue with using a MinMax strategy, that is the game states algorithm CB was waltzing around, is that it cannot accurately account for the randomness of the new tiles that spawn in. These new tiles have a random location with a probabilistic value. When 'aiming' for a future state, it is possible that state is unachievable because the tiles needed to get there didn't spawn in the same locations with the same values.

  • @nitinsaxena4906
    @nitinsaxena4906 Před 2 lety +2

    AWESOME VID !!!!!!!!!!!!

  • @musashiaerostar4409
    @musashiaerostar4409 Před 3 lety +67

    7:50 - 7:52
    That made me laugh harder than it should

  • @Zandros
    @Zandros Před 5 lety +188

    At 9:07 your A.I. was within 5 moves of victory and it made the wrong move. Luckily he got there still anyway a few seconds later

    • @Zandros
      @Zandros Před 4 lety +7

      @CoRE Pyroz Right, Up, Left, Left. You're probably not looking at the same board configuration I am since the video is moving so fast.

    • @achilleaustin
      @achilleaustin Před 4 lety +3

      9:08 up left left

    • @fuckdatmf3144
      @fuckdatmf3144 Před 4 lety

      right, up, left, left( there are alot of other ways ive also seen to instantly solve it but whatever)

    • @jamesr7708
      @jamesr7708 Před 4 lety

      Yeah ikr down, right, up, left, left

    • @elarrayhesohit4479
      @elarrayhesohit4479 Před 4 lety

      Thomas seems to always wants to solve the block from top left to right so at 9:07 he wanted to solve the top far right block next??

  • @thomasremillet4621
    @thomasremillet4621 Před 3 lety +1

    Antennas are perfectly recreating facial expression, it's awesome

  • @brazenh2836
    @brazenh2836 Před 3 lety +1

    i think the issue may have been in not letting the highest tile move also using tile stacks to favourably rearrange the board also moving large tiles to make spaces causing a tile to spawn that couldnt be merged...

  • @Fattycheese73
    @Fattycheese73 Před 5 lety +446

    I think there’s an issue with the algorithm. In the actual game, part of the challenge is not knowing whether a 2 or 4 is gonna spawn. This especially matters when the board is almost full. Since the algorithm calculates what the board is gonna look like after 5 moves, then it already knows whether a 4 or 2 is gonna spawn in every one of those moves.

    • @boggers
      @boggers Před 5 lety +111

      i think if the AI knew what would spawn where ahead of time it would be solving for 2048 every time very easily. What he should be doing is calculating for every possibility over a couple of moves and playing the "safest" path. Treat the RNG as an adversary, and minimise the damage it can do.

    • @4xelchess905
      @4xelchess905 Před 5 lety +30

      yeah, he is probably doing a min max algo over the tree of all possible moves AND spawns. Alternatively, he may be computing probabilities and expected gains on that tree.
      A refinement would be making a Monte Carlo search, since we know the distribution of spawning.
      If the AI knew what would spawn where ahead of time, it would lead to spawn manipulation abuse, where the AI deliberately chooses an objectively subpaar move because he knows it will be lucky (the spawn location has to depend on its move, since available locations depend on its move).

    • @jsmunroe
      @jsmunroe Před 5 lety +16

      This is they same way chess algorithms work. They calculate all possible next stages for each of the next possible moves. He claims he goes 5 layers deep with this. That's a fairly massive search tree, but I guess if he has the computational power and/or the time he could do it.

    • @danielfay8963
      @danielfay8963 Před 5 lety +3

      Additionally a 4 only spawns 10% of the time, meaning you need to account for the probability of a given outcome when considering the risk/reward

    • @daniellucas5522
      @daniellucas5522 Před 5 lety +9

      Not that massive for this game. Chess has far more moves available in a turn, this one has only 4 moves and then the number of empty locations on the board left * 2 for where the next block will spawn.

  • @zxt327
    @zxt327 Před 5 lety +298

    I wonder how long it would take thomas to get to the 131072 tile. It would require a large amount of luck with tiles and probably takes trillions or more trials

    • @fotwen
      @fotwen Před 5 lety +1

      ZX T I wonder that too. I had the same game going for months. Of course I didn't play it everyday. But it took forever. Mainly cause I had to fix mistakes. And of course it wasn't 4X4.

    • @chinesebaloni
      @chinesebaloni Před 5 lety +14

      thommy will just print a tile with 131072 on it and call it gg

    • @flabort
      @flabort Před 5 lety

      @@fotwen Have you tried the 5D? 2x2x2x2x2? (2x2 grids layed out in two 2x2 grids, wasd within a grid, rf to go up, qe for within the two metagrids, and zx to swap between those). Since it's 32 empty tiles instead of 16, two tiles spawn with each move.

    • @xanderh2404
      @xanderh2404 Před 5 lety

      @@TheeCK1357 It can, it's the theoretical maximum possible with a 4x4 grid. It requires a perfect arrangement of tiles to reach, and a 4 MUST spawn in the empty tile.

    • @garrettbowes4878
      @garrettbowes4878 Před 5 lety

      It can fit that but I had that block in the bottom left corner and the 4 in the bottom right. All other tiles where occupied by their highest possible value

  • @bryceboukater4618
    @bryceboukater4618 Před 3 lety +25

    I love how many voice cracks he has, it makes him seem so much more human and relatable then these other youtubers with over 1 mil subs

  • @michaelawilliams
    @michaelawilliams Před 5 měsíci

    In evaluating states, it is not just highest number to the corner that should matter, but a more general "orderliness". Fewer tiles is better than more tiles and tile's nearest neighbors being numerically closet i.e. 2's in line with 2's or 4's is fine, 8's less so, etc. I would love to see you try this strategy, but I see this video is 5 years old!

  • @Youmu_Konpaku_
    @Youmu_Konpaku_ Před 5 lety +59

    _Ai learns how to take control of humanity_

  • @ShashankPinchaG
    @ShashankPinchaG Před 5 lety +233

    Enigma!!! Gimme me Enigma!

  • @TheSheriff1873
    @TheSheriff1873 Před rokem

    I like to put the biggest tiles in bottom right and work from bottom left to right but this works too

  • @gnaskar
    @gnaskar Před 5 lety +92

    1: don't give points for having the same number next to each other; the value of the that is recorded in the next state, not this one.
    2: reduce point value of a tile by 40% if the tile to the left is smaller and by 40% the tile above is smaller (this is a generalization of of keeping the biggest in the top left). If both are true the remaining value is 20%.
    3: Award a sizeable bonus for empty tiles. Honestly, an AI that just tried to minimize the number of tiles with numbers on them with 5 states look ahead would probably be fairly good at this game.

  • @saintsucks
    @saintsucks Před 5 lety +251

    fusion is just a cheap trick to make weak tiles stronger.
    *im kinda upset no one has made this*

    • @chall-us6de
      @chall-us6de Před 5 lety +13

      Steven universe reference?

    • @Benjamin-vu2hy
      @Benjamin-vu2hy Před 5 lety +6

      Dusk Playz I thought I was the only one that got his reference

    • @ikuuuya
      @ikuuuya Před 5 lety +3

      I FUSION SUMMON MY 3 BLUE EYES DRAGON TO SUMMON BLUE EYES MAX ULTIMATE DRAGON!!!

    • @microbialdoormat
      @microbialdoormat Před 5 lety +1

      Masshibuu Ibu you obvs don’t understand this reference. Tsk. 🤦‍♀️

    • @ikuuuya
      @ikuuuya Před 5 lety

      @@microbialdoormat no i do understanf but steven universe is worse and yugioh is superioh u fuckin normie smh

  • @scruffybixweetabix2295

    Okay, that subtle fusion dance make me so happy inside

  • @lostsoccos2832
    @lostsoccos2832 Před 2 lety

    nobody:
    Code Bullet: DAM IT TOMMY EVERYTIME

  • @eing7025
    @eing7025 Před 5 lety +165

    I clicked the subscribe button twice.
    I was already subscribed tho

    • @lochuynh6615
      @lochuynh6615 Před 5 lety +3

      When you walk 😂

    • @wiredfpz7496
      @wiredfpz7496 Před 5 lety +1

      there was no point of commenting that
      well done

    • @Parker05
      @Parker05 Před 5 lety

      Eing subscribe-unsubscribe-subscribed again. Thanks Eing, Very cool!!

  • @Raff-mu5qc
    @Raff-mu5qc Před 4 lety +14

    "my man thomas looks 5 moves into the future" This is King Crimsons ability

  • @elfarcherdv
    @elfarcherdv Před 3 lety

    I have a feeling the NN could work better if it was rewarded for the amount of turns the highest tile was in a corner as well as minimizing the amount of tiles on the board as opposed to a blanket, get the highest tile you can approach. Then again I am an economist not a programmer. Great work man

  • @Animefanboi395
    @Animefanboi395 Před 6 měsíci

    The second example used for game states (5:22) is a very thoughtful game state to be in since there are only 2 moves to get out of the situation

    • @Animefanboi395
      @Animefanboi395 Před 6 měsíci

      Not that it matters but the timestamp is behind by one second

  • @sacobred8400
    @sacobred8400 Před 4 lety +31

    me: *hears over-dramatic royalty-free music*
    also me: yeah dis the one