söndag 26 december 2010

TRON B - A simplified game of Tron using MINIMAX

I have coded a Tron game clone to further see what the MINIMAX strategy can do. For those who are not familiar with the rules and game mechanics of Tron will here follow a short explanation. Tron is a two-player game where each player controls a square inside a grid. When a player moves her square in a direction (up, down, left or right) the square will move to that location and leave a solid "wall" behind. Do not crash into "walls" or your opponent. If you do, you have lost the game.
The goal is to outlive your opponent.
For the AI of the computer I've implemented a MINIMAX strategy. This time around I'm not going trough the whole game tree (to time consuming for large grids), instead I've limited the search depth. The challenge here is to write a good utility function that evaluate the current game-state "correct". So far i have equipped my utility function to consider the amount of free space and a "trapability" factor when evaluating game-states. It is not the killer I want it to be yet but with a few more "tools" added to the utility function...

The start screen.



A game in action.
Game over!


Inga kommentarer:

Skicka en kommentar