Inspiration
2048 took the internet by storm when it was released. After that, several algorithms has managed to play this game automatically.discussion on StackOverflow However, most of those algorithm requires certain level of knowledge of the game. For example, arguably the best algorithm to solve this game is some variation of expectimax algorithm with heuristic builtin. We are interested in how we can attempt to develop a strategy with machine learning that does not require any knowledge of the game.
What it does
We built a wrapper on top of the game 2048 that allows our ml bot to control it. Then we applied the method NEAT(NeuroEvolution of Augmenting Topologies) developped by Ken Stanley. It use genetic algorithm to build a evolving neural network that starts simple but grow complex overtime.
To train our neural network, we started with a neural network that has 16 input nodes each receiving the value of the tile on the game board, and 4 output nodes that represent four actions: up, down, left and right. We then created a large pool of random network that comes from our initial one. For each network, we trained it by feeding the game board to the input node, took the output and perform the right action, and repeated until it terminates. For each run, a fitness score based on how well the network did is assigned to the network. Then we mutate(adding new node to the network, creating new connections or deleting node) and cross breed(produce a new neural network that combine bits of two parents network) our pool of networks and evolve them over generation.
How we built it
We built a wrapper on top of 2048 that controls the game, a node.js server that server as the messenger between the game and client that wants to control the game. We built our custom game controller and custom fitness function on top of ANJI, an open source NEAT implementation.
Challenges we ran into
As many other machine learning methods, there is a myriad of parameters that fine tune how the algorithm works. We spent time reading the NEAT paper and adjust the parameters until we reach a comfortable configuration. Also we do not have enough time
Accomplishments that we're proud of
We had fun learning new machine learning methods and seeing it in action. We are proud that we can use cool algorithms to mess with game that other people built.
What we learned
Machine learning is cool.
What's next for AI learns 2048
We will keep training it after the hackathon and see how long it will take to solve the problem.

Log in or sign up for Devpost to join the conversation.