Earlier quoted context omitted.
Me too, I have this weird overlay of the game in my vision. It took a lot more of tetris to reach that effect.
All the fonts seem smaller, not sure if only one.
2048 AI
131–140 of 197 posts
Re: 2048 AI
#132Re: 2048 AI
#133Earlier quoted context omitted.
The question is do you want to have the shortest expected number of turns until you win, or a 100% win rate. Playing safe (min-max) is what ensures the 100% win rate, but you might be making games longer on average.
It doesn't have a 100% win rate as it stands. Mini-max isn't even 'playing safe'. Consider the following choice of moves, each leading to one of 5 random tile inserts: Move A, which leads to 5 possible moves with the following game state goodnesses: ['Loss','Win','Win','Win','Win'] Move B, resulting in: ['99%CertainLoss','99%CertainLoss','99%CertainLoss','99%CertainLoss','99%CertainLoss'] Minimax is never going to ch…
Re: 2048 AI
#134The AI implements minimax using alpha-beta pruning. Minimax assumes that the game/computer which the AI is playing against is playing adversarially - i.e. that the computer will insert the new tile that's the worst possible tile for the player/AI to receive. But that's not actually what the game is doing. Instead, new tiles are inserted randomly. As a result, minimax probably isn't the best approach here. I think som…
It did win for me on the first try: http://i.imgur.com/uMB2J7f.png
Re: 2048 AI
#135I'm consistently scoring higher than 2,500, and frequently as high as 3,500 with a tile of 512, by doing this: 1. Up 2. Right 3. Down 4. Left 5. Go to 1. That loop scores better than my trying.
I got up to 9,000 with: left, down, right, down, (repeat)
My new simple algo is:
1. Down until you cannot go down
2. Left
3. Down until you cannot go down
4. Right
5. Go to 1.
Re: 2048 AI
#136The AI implements minimax using alpha-beta pruning. Minimax assumes that the game/computer which the AI is playing against is playing adversarially - i.e. that the computer will insert the new tile that's the worst possible tile for the player/AI to receive. But that's not actually what the game is doing. Instead, new tiles are inserted randomly. As a result, minimax probably isn't the best approach here. I think som…
Heh. If you look in the code you'll see a big commented out chunk where I tried randomly sampling computer moves to get sort of an 'expected value' for the opposition's move. Empirically, it performed worse. I think this is for the same reason that all minimax algos assume optimal play by the opponent: if you assume optimal and they play less than so, it can only work in your favor. However I think there's some truth…
I was at an early stage, my scoring is just the game score (which apparently is flawed!) so nothing fancy. My approach to the large branching factor with the random tiles was just to ignore them and continue the search with a random one until there are less than N tiles free (I empirically found 4/5 to be good), where I perform a full search and apply a simple mean to the resulting scores. Mine is not even minimax, just a simple depth-first search. It wins between 1/4 and 1/5 of the time in a small sample of 200 games, how does yours perform?
This would be a great AI competition! Too bad it takes so long to run lots of games (mine is ~10 turns a second).
I wonder if web workers would speed it up.
Re: 2048 AI
#137BUG: Whenever two sets of tiles combine in a single move, only one of their scores is counted. For example, let's say that a pair of 8s and a pair of 4s are about to be combined into a new 16 tile and a new 8 tile. The game should be giving us 24 points total for this move because we are creating a 16 tile (16 pts) and an 8 tile (8 pts) where 8+16=24. However, this does not happen. Only one or the other combination w…
Re: 2048 AI
#138Earlier quoted context omitted.
Me too, I have this weird overlay of the game in my vision. It took a lot more of tetris to reach that effect.
All the fonts seem smaller, not sure if only one.
Re: 2048 AI
#139Earlier quoted context omitted.
I pressed solve from the start, and the AI lost.
This AI losing doesn't mean the game isn't winnable in principle. I don't know whether it is or not though.
Re: 2048 AI
#140If there is a guaranteed win, the algorithm will find it. However, if there isn't any, how does it pick a path when it thinks it will lose every time? Are all losses equal to each other? Are some better than the others? Could the elgorithm take the path with best chances where the most of the plays end up winning while only a few of them end up losing?