2048
2048 copied to clipboard
Fix the 2 vs 4 AI
This may be improvable for a logic strategy based game:
https://github.com/gabrielecirulli/2048/blob/master/js/game_manager.js#L62
It means you could win or lose a game entirely up to chance, even if your strategy is sound. The spawning of a 2 or 4 should be deterministic. My suggestion:
Always spawn a 2, unless the location of the tile spawned is adjacent to a 4 tile.
In reality, I think the winning by chance is a good game mechanic. Though the spawning of 4's is irritating to me, I still find it enjoyable and keeps me playing.
I'm not sure I agree with this issue. You're right that randomly generating tiles and values adds a chance component to the game, but I think it's what also makes it interesting to play. Whenever playing, you have to minimize the amount of moves that could compromise the game if a tile is added in the wrong place, and this makes you extra careful and considerate whenever making a move.
I think making tile generation and values deterministic would only make the game more boring, and remove a lot of value from it.
I agree with warmwaffles and Gabriele. The randomness/chance is an important part of what makes the game fun. If I always knew what was going to happen next, it would quickly get boring.
I don't see how you can win or lose this game entirely up by chance, the 4x4 grid allows plenty of room to move powers of 2 to create 2048 even with random numbers spawning. It just takes strategy and that is what makes this game fun and addicting.
Matrix : not at all. By playing a lot you will quickly come to the conclusion that if you let a 2 spawn in a hole of greater tiles you will block the game and then lose. In fact you can't randomly merge tiles on the grid since you need too keep tiles of same value or near value (*2 /2) close in order to merge them later.
I dont know if i was clear but let say as an example that you cant have a 64 in the top corner left and a 64 in the right corner down as you will never be able to merge them.
The randomness forces you to think wisely about your moves and minimize the moves that could possibly break the entire game down.
Matrix159: this is a situation I got some days ago: http://i.imgur.com/fNNy0KO.jpg
First of all, that two you see spawned there by chance. If it spawned somewhere else, I could move the grid left or right to add a 4 to the rightmost 4, and clean up the entire snake of doubled values.
But now that the two spawned there, it forces me to move down. At the move down, it has four places to spawn a tile. In the best case, it would spawn above the 256, thus keeping the 2048-1025-512 series a viable one. When it spawns above the 2048, there's no way to reach a 4096 tile anymore.
Though I like the game, I would also like to try some deterministic versions of the game. Imagine always spawning on one of the corners (this would probably make a rather easy game), or always spawning next to the highest number in game (this would probably make it harder).