Hacker News new | past | comments | ask | show | jobs | submit login
8402: 2048 from the other side (chronosempire.org.uk)
195 points by hexwab on March 22, 2014 | hide | past | favorite | 53 comments



Great, not only am I really, really bad at hundreds of variants of 2048, now there's an AI that's much better at it than me, even when I'm doing my best to stop it. Presumably, someone will write an AI to combat this one, and I've completely lost the thread of reality to which I have been forlornly clinging.


Perhaps surprisingly, the AI of which you speak actually came first, and was an inspiration for this. https://blog.sphere.chronosempire.org.uk/2014/03/20/8402 has more details.


I had the opposite feeling, I actually felt accomplished after beating it, even though I have not completed a single 2048 variant.


Same here, although I somehow wanted it to win, so I could finally at least see the mythical 2048 tile that everyone seems to be speaking of.


The strategy is to get the largest tile in a lower corner, with the next biggest tile next to it, and then the next, across the bottom. Once you have the bottom row filled, concentrate on putting tiles into the next row which will match the ones on the bottom row. Initially, when the tiles on the bottom row aren't that big, you should concentrate on matching the biggest tile. But as that becomes too large, concentrate on matching the next biggest, then the next, and so on. Of course as soon as you do match a tile on the bottom, merge with it so the bottom row always contains the biggest possible value. This strategy ought to get you to 2048 within 3 tries if you don't make too many mistakes.


I took a screenshot of one for you: http://i.imgur.com/929HNgE.png

I remember watching this AI play and thinking if I could write my own strategy into an AI. The AI's strategy suffers from the issues that my strategy tries to combat. Perhaps someone can tell from my screenshot what my strategy is.


To be honest, screenshots of this game are no longer a proof of anything. I am not calling you dishonest,but just saying that I could run the AI version, and when it wins change the address at the top,and using any browser's inspect feature just remove the two buttons above the game field. It's just ridiculously easy to fake winning screenshots of 2048 now.


Your strategy? Up and to the left. aka keep all the empty spaces next to the lowest number tiles.

The way I beat the AI was to try to give them isolated 2s on the opposite sides of the board and then flood the board with 4s. This prevented the AI from keeping all the low numbers together and blocked some tiles from use (the ones with the isolated 2s).


I won! http://i.imgur.com/VOXJaOo.png

My strategy was to give the AI a single 2 at the beginning, then only 4s. When the board fills up enough, there will probably be a space where you can put a second 2 to make it lose before it can combine them.


It's maddening! 2048 seems like it's so ridiculously hard playing the normal way. Then you play this game an it seems like it should be impossible to lose 2048.


Don't feel bad, getting to 512 is child's play (a random algorithm can do it, in fact). Going the last two steps is where it gets impossible. Up until the 512 it seemed like nothing I did would slow it down, but once it reached that, the board was finally swamped by 8s and 16s and a few well-placed 2s and 4s in the worst pattern possible finally stopped it.

Now we need a multiplayer variant a-la puyo-puyo-pop.


It is very easy to win. You shouldn't be able to select 2 or 4. The decision should be random and that would be fair like the original.

The easiest solution is to have just one 2 on the table, then spam 4 in corners.

Best( lowest ) score: 1684


I beat it on the first try with nothing but 2's before I read the instructions and found out I could use 4's.


I finally beat it. This seems harder than 2048 since with 2048 a simple strategy can do well, where as with this game I had to search through more opponent AI moves. Is there a simple strategy for 8402?


If you give the computer primarily 4's, you can clog the board by placing 2's where it cannot merge them. I beat the game on my first attempt this way.


I did not realize that I could place 4s.


Now for someone to make a 2 player one where one person is making 2048 and one person is stopping them.


Wow, this despresses me. It pushes my nose unto the fact that I really suck at 2048, because no matter how hard I make it, this AI solves every problem I throw at it. Yet, I haven't managed to surpass 6568 after days of playing.


Ya I didn't think it was actually possible to win 2048 except through sheer luck. And then this AI just mocks me as I futilely try to keep it from winning.


Oh, do you want to know a strategy for 2048? You won't win every time but you should get passed that score regularly with it....


You're clearly not using 4.


http://i.gyazo.com/61d02988bb765bd95e26e48b576e8aaf.png

This is the first 2048 variant that I'm able to beat. yay me... .__.


I wasn't able to win with this one, but you might want to give the logarithmic flappy 2048 a try. It's the only one I'm able to do absurdly well on: http://logarithmic-flappy-2048.ajf.me/


the 3d one I found to be the easiest: http://joppi.github.io/2048-3D/

but 4d is terribly hard: http://huonw.github.io/2048-4D/

edit: I did a 3d victory in the 18 minutes in editing the comment. You can generally just push higher numbers into a corner, and pick either the left or the right side to consistently fold to and you'll get it mostly without thinking.


I find 4D much, much easier to control and visualize than 3D. Maybe if 3D was somehow presented in three dimensions I'd have an easier time of it, but the 4D one was easier to grok.

That probably says something about how humans relate to interfaces that map higher dimensions to 2D planes, or maybe it's just the way the 4D layout maps to the screen.


ignore the "3d" idea. Just look at the rules of the game and play by that.

I'm sure some people can maintain clear mental models of higher order dimensions and seamlessly translate the grids on the screen in some hyperspace in the mind.

But I, my friend, have no chance of that. The more I ignore that notion, the easier it becomes.


I've beaten 4D. It does take substantially more concentration than the original though, which I can play and win mostly on autopilot by now...


5d is a lot of fun and easier than 4d: http://cesarkawakami.github.io/2048-5D/


(45 minutes later)

all lies.


As a computer scientist I can't help but now ask: what is the complexity of this problem? If it's in P then this game is not very interesting (in that I can't hope to fool the AI).


Stop me if I'm wrong, but it seems misleading to ask whether or not the problem is in P. It seems to me that it is better to ask more generally whether the problem is tractable. There are a lot of games that are solvable in exponential time (not in P) that are still tractable because the branching factor is low enough that simple methods like minimax searches work well.

Take chess as an example. It's an EXP-TIME complete game with a branching factor of 35, and AI techniques win pretty much all of the time. In this case you're looking at a much simpler game (if you treat it as an expectiminimax problem, you alternate between turns with a branching factor of less than or equal to 4 and ones with a branching factor of less than or equal to 32). The game is much less complicated than chess. The game tree is really small, meaning that it should be tractable to most AI techniques.

Even though it is reasonable to 'solve' the problem, there are board setups that are unwinnable. Since the player has a lot more power over the game in placing tiles than the agent does in moving them, it is easier for the player to force the game to one of the unwinnable states than it is for the agent to prevent these things. Even if the agent is acting optimally, the player should still be able to win.


What's really misleading is when people try to push the question aside by saying "AI techniques should work." It's dodging the question. What I ask is whether there is an efficient algorithm to determine if one player can force a win, given a position on an arbitrary size board. Forget whether the game is imbalanced. It's just a mathematical question.

You say this game is less complicated than chess, but what measure of complexity are you talking about? Might it be computational complexity? Computer scientists of all people know that simple rules can provide arbitrary complexity.


That's not a problem, because there are impossible games. Your task is just to form an impossible situation.

This game is MUCH easier than the original, at least for me. I never managed to beat the original, but on the other hand I've yet to be beaten by the AI.


No, because the problem is deciding whether, for all possible moves you make, there is a move that the opponent can make, such that for all possible moves you make, there is a move the opponent can make, ... that will force a win or lose for one player.

This makes it smell like a PSPACE-hard problem (if you make the board size arbitrary).

[EDIT] Now I see what you mean, that you could start in a position where you can guarantee a win and so being in P doesn't matter (the computer would just be able to tell quickly that it cannot win if you play optimally). But this also isn't satisfying because it seems unlikely that a random starting position would put you in such a state (since it's so early in the game!).


What I meant is that no matter how the computer plays, you can always serve it a sequence of 2s and 4s that will never reach 2048. Easiest is to make sure there's exactly one 2 on the board, then spawn 4s in the corners, always picking the corner farthest away from the other tiles. From time to time spawn a 2 if you can guarantee it won't align with the other 2 in a couple of moves. Near the endgame it is trivial to have three 2 tiles which you keep always separate with careful placement of 4s. At that point the game becomes literally impossible to win.

Edit: Try to play it the other way, too. Try dropping tiles in the best most convenient pattern for the AI. Notice the amount of clutter that inevitably results when reaching higher numbers. An interesting question would be, if you control both the tile placement and movement, what is the highest number you can reach? With the constraint you can place only 2s.


When you say things like, "you need a careful placement of 4s" it makes me think, "well that's not a proof."

So let me be formal. I'm posing the following decision problem: given a target score n and some initial board configuration of size (k * k), can one player force a score of at least n? I conjecture this problem is PSPACE-hard.

Your claim is that if n >= 2048 and k = 4 then the answer is always no (though I don't buy your justification). My question is more general, and it's clear that there is not a constant answer (e.g. if n is 2 the answer is always yes, but for some sufficiently large n the answer is always no)


... Much higher than P pretty obviously. 16 possible drop points and 4 possible moves each turn maximum, let's say only half of each is available on average. That gives ((2)(8))^N for N amount of turns.


That's not really how computational complexity works.


Why is there no better algorithm than exhaustive search of the game tree?


Wow. This one was insanely stressful compared to every other variant I've seen so far— which is weird, because (unlike the original 2048) I was actually able to win this one.

Either way, really cool.


Probably because you are playing against an intelligent opponent actively trying to keep you from winning, where the first original is just a solitary game.


The real challenge of course is to build an AI to beat the AI. Here's a random clicker:

setInterval(function(){ var cells = document.getElementsByClassName("grid-cell"); var pos = Math.floor((Math.random()*cells.length)); if(Math.random() < 0.5){cells[pos].click();} else {var ev = document.createEvent('HTMLEvents'); ev.initEvent('contextmenu', true, false); cells[pos].dispatchEvent(ev);} },100);


I'm waiting for a mathematician to show up and prove if in certain cases a game (no matter how well played) it's unsolvable.


The whole wave of 2048 and the related AI problems are fascinating. Has anyone else started thinking using those at the start of a Computer science class using those as initial examples to illustrate the power and simplicity of algorithms, and motivate even non-coding-inspired students to think systematically?


Cute variation, I wonder if there's a record on games' variations and whether 2048 is the all time winner


Not sure if left click/right click was the best choice in controls. I keep refreshing the page. At least on desktop a typing the size of the piece you want would have been much easier. Two buttons to do the same on mobile would have likely been a better choice as well.


This was incredibly satisfying. Just have to do all the things I hate when the AI in 2048 does to me.


very interesting variation, I like it. Didn't notice the instructions when I played so I didn't realize I could put 4s so my strategy mainly consisted of trying to figure out where the worst place to put a 2 would be especially at the end when it was filling up to get it to catch twos by itself or other singular numbers. Won in the end so I'm pretty content: http://i.imgur.com/7E3WBQk.png


This is insane. I can complete 2048 easily, but can't seem to win this version. For others, it's other way around. How does that work? :/


Victory at 1124 puppies eaten! Highest tile is 128.


I hate this game for some reason, whereas I really liked 2048. Not sure why.


For some reason I find this version to be much easier than the original.


Oh, so I'm not meant to get 2048? Damn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: