Tantrix in Your Country
Tournaments
Tournament Forum
Need Help?

QUICK LOGIN

N : 
P : 

Not registered?

HOW DOES ROBOT WORK?

The Basics

Almost any game-playing Robot is actually just three relatively small modules which are added to the usual game machinery.
  • A Move Generator: Given a board position, the move generator constructs a list of all possible moves. The number of possible moves is the single largest factor determining how difficult it is for a computer to play a game. In easy games such as Chess, the number is small. In difficult games such as Go, the number can be very large. Tantrix is in the middle.


  • An Evaluator: Given a board position, the evaluator estimates how good the position is for the player who is to move. If the evaluator gives good estimates, then the Robot will probably play well. The quality of the evaluator is the key factor in any game playing program.


  • A Lookahead Manager: which starts a given position, calls the move generator, calls the evaluator for each possible move, and decides to accept that estimate as final to recursively call itself to examine responses, or responses to responses. If the evaluator were perfect, the lookahead manager would be unnecessary (because the evaluator would already have given the highest rating to the best move).


Robot's Move Generator

There's really not much to say - it's a brute force process which tries all six tiles in all possible positions, and remembers which ones are legal moves. In a typical game situation, there are about 50-75 moves. In the endgame, there can be many more, possibly as many as 200.


Robot's Evaluator

The basic evaluation is, for each line of the Robot's colour, to predict what it will eventually be worth, and so for any position to predict what the final score for the game will be. This trick, of trying to predict the final score rather than using the current score is why the Robot is so adept at handling loops.

So, how does the evaluator estimate the final score?

  • First, obviously, each line is considered separately. The maximum estimate for any line is the estimate for the final score.

  • For each line, consider what other, nearby lines are certainly connected, or probably connected. Groups of lines that will eventually be connected are treated as one long line, modified by the probability that the connections will actually be made. The Robot estimates the probability mostly by counting the remaining tiles that fit the connection space. This is an important point: the Robot always counts tiles. You can bet that if the Robot plays a forced connection, it knows if there is still a tile to make the connection.

  • Every group of lines either forms a loop or has two open ends. By default the open ends are predicted to be extended by a fair share of the tiles left containing the desired colour. The Robot doesn't care exactly how or where those tiles will be played, it just guesses that they will be played somehow. This strategy is why the Robot prefers to extend a line rather than try for a small loop, even though the small loop would instantly double the current score. This fair share estimate is greatly reduced if the side is controlled, or likely to become controlled.

  • Goodbot adds a few considerations to the basic evaluation, each of which contributes a small amount to the overall improvement over earlier robots.


    • Be aware of the presence of lookalikes for forced spaces, which affect the likelihood that a connection will be made.
    • Be aware when the last few tiles will certainly end up in your own rack, so probability of controlling them is 100%
    • Add a small penalty for small loops in the opening.
    • Delay playing unfavourable moves as long as possible.
    • Consider forcing multiple tiles to be beneficial before endgame, bad after endgame.

Robot's Lookahead Manager

Tantrix is unusual because players can make several moves per turn. The Robot considers all forced move sequences in any order, and all forced moves the opponent will have to make before his free moves. Consequently, it has a pretty good idea of how to play in ways that will force other tiles to be played in favourable ways. It does NOT consider what the opponent's free move might be in response, and It does NOT consider what tiles might be drawn to replace the tiles it has played. Also, an absolute limit of 5 (or so) tiles is imposed to keep the number of moves examined down to a reasonable number.

The lookahead manager does not attempt to use alpha/beta or any other standard tree pruning methods, because they would be of very little use given the limited depth of the lookahead.

The lookahead manager used by Goodbot is slightly more sophisticated. It removes the low limit of 5 forced tiles, and adds alpha-beta to get the speed back up  (alpha-beta doesn't change the result) It adds the option to look a little deeper during endgame, and to manage it's time to avoid runaway searches when a cascade of forced tiles occurs.





A word from the Author

There are quite a few tunable parameters associated with all these considerations, but actually tuning them is very difficult, because the random factor means a "run" of 200 games is required to validate a new parameter value or a change to the algorithm that applies the parameter.  The current state of GoodBot is probably the end of the line from me - I don't know how to make it any smarter, and making it better without being fundamentally smarter would be extremely time consuming.

Robot/Goodbot was written by Dave Dyer (ddyer).


2005 Robot improvements

At the end of January 2005, the first version of GoodBot was released in the lobby. This version of  GoodBot was a harder-working, gloves-off version of the original Robot, but without any fundamental changes Advances in computer speeds since the original Robot was created made this development possible. Because of it's more "human" playing ability, GoodBot has a floating ranking.

In May 2005, a new robot named Oliver was introduced into the lobby. The first official robot battle - Goodbot vs. Oliver - was held on the 11th of that month. Oliver, programmed by Pieter Bolle, Belgium and Alex Biryukov, Israel preformed slightly better than expected by defeating the reigning champion Goodbot with a winning percentage of 64.5% to 30.5%.

Inspired (and challenged by) Oliver's success, new development in Goodbot resulted in substantial improvements. A rematch battle between Goodbot and Oliver resulted in Goodbot regaining his champion title with a win of 54.7% over 45.3% (TPs). Goodbot is currently awaiting his next challanger. Are you fluent in Java? Then why not make it your goal to unseat the reigning Robot champion. Fame, glory and immortality will be yours!



© Copyright 2006, Tantrix Games International, Nelson, New Zealand. All rights reserved.
Last update: December, 2006