![]() ![]() Since scores only change when someone lands on a bonus tile, many paths you take down the tree would have equal value, so you need to be able to look ahead many moves to find a non-zero heuristic and be able to prune parts of the tree. An extreme example of a simple heuristic would be the current player score minus the opponent's score. This often leads to more emergent and advanced strategies that are hard to express mathematically. If the heuristic takes longer than simulating a game move, it might be worth simplifying it so it runs faster and you can look ahead further. But it depends on how costly it is to compute the heuristic function compared to simulating moves in the game. I'm not familiar with your game so I can't tell you what a good heuristic woul be in your specific case, but I can give you some advice on how to look for a good heuristic function.Īs a rule of thumb, the heuristic function for a MiniMax algorithm is best kept simple and efficient, so you can get deeper into the tree. ![]() In order words, what will give us the best indication that our player is going to win/lose/tie? How would you define the heuristic function? It should also be quick to calculate it because the game has a timeout for each move. ![]() I'm not sure if it will be a good strategy for that game or not. $f_C=\max_$ - where $X$ is value of the bonus, $I$ is $1$ if we can get to the bonus, before it disappears (otherwise $0$) and $Y$ is the distance between the bonus and the player.$f_B$ - The analytical distance from the center.$f_A$ - The number of steps possible from each direction from the current position.What heuristic function would you define? I'm trying to figure out a good strategy to win this game or get to a tie if no solution is possible. If we got timeout in some place in MiniMax, then we return the last calculated direction. If we got to a specific depth, we calculate the heuristic value. If we got to children, we return $\infty$ for a player win, $-\infty$ for the rival win, and $0$ for a tie. I'm using the MiniMax algorithm with a time limit to play the game. At the end game, when at least one of the players is stuck, we check the scores and announce the winner. Furthermore, each move has a timeout limit. Also, each bonus has a timer until it disappears (number of steps). You have a board where position 1 is your player, position 2 is the rival player, -1 is a blocked cell and some positive value is a bonus. I want to build a player for the following game: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |