u/Lj101in r/programming • Recommends
On “The Mathematics of 2048: Optimal Play with Markov Decision Processes”
So you start somewhere and you're trying to find where to go next. In 2048 we only have four possible moves, so this isn't too hard for MCTS, if there were more moves to search we'd use UCB1 which is similar to simulated annealing.
Anyway, we sample a move once by initially doing it, sliding the board down for example, then making a number of random moves to a certain tree depth then storing the score. This sounds silly, but if we do this many times for a move, then we've made a decent estimation of how good it is. The move with the best average score over all these random iterations that started with that move is the move we make next.
We can tweak performance by changing how deep we se…