[Up][Next]

I. Rollback

One approach which was explored early on was "rollback" Basically the idea was that in a given play cycle (i.e. the completion of a given rectangle) the engine kept track of which squares a given robot had already colored. When one of the squares already colored by our player was colored by another player, the robot responsible for it reversed its course in order to ensure the capture of the rectangle it was attempting to capture. For instance look at the example below.

Rectangle Before Start of Rollback

Path Overwritten/Rollback Begins

The red player (Our player in this instance) is attempting to complete a 9X8 rectangle. While on the bottom leg of this rectangle the blue player crosses part of its path. Our player would reverse its course all the way along its path until it reached the point where the blue player crossed it. In this case an additional 40 moves (19 to reverse back and 19 to return to where it was when rollback commenced) are necessary in order to repair a rectangle whose entire normal perimiter cose is only 34 moves. In general if our player has to roll back n steps it adds cost 2*n to the construction of a given rectangle. What this means is that if a robot has to roll back halfway on a given rectangle it has doubled the total cost of contructing that rectangle. Given the criticality of contructing rectangles efficiently during the opening stages of play it was decided that this tactic was simply too inefficient to warrant inclusion in any competitive robot.

II. The Single Large Square Opening

One of the first opening strategies explored was placing all our robots in a configuration for most efficient completion of one single large square. A relatively simple algorithm can be used to determine the most efficient placement of robots around the perimiter of a square. For a given amount of turns n a square with side length of the number of robots / 4 can be created.

While this configuration does create the most efficient single square it is not very fault tolerant. The overwriting of a single space in the opening rectangle before its completion can cause those n starting turns to be completely wasted. While a complementary tactic like rollback could be used to alleviate some of this problem, in most cases it turned out that the opening square turned out to either be unsaveable, or to cost more robot turns than it was worth to repair. As a result a more randomized and fault tolerant opening configuration was used.

III. Chasing Detection and Counterstrategy

One of the biggest obstacles in any two player game is chasing. Our player does not use any chasing (in the strictest sense of the term), but does employ measures to detect enemy chasing. The algorithm used to detect chasing is as follows; For each of our robots we keep track of which enemy robot is closest to it and how long is has been the closest to our robot. If the enemy robot has been closest for more than some threshold time (say 3 turns) and the enemy robot has just made the same move as our robot and the enemy robot is also within a threshold distance of our robot (say 4 squares), we have detected a chaser. On detecting a chaser we stop our robot form moving, as any attempt to continue would just aid the chaser. However we added one additional tactic. After a robot has first detected a chaser it stops for a few moves, and then tries moving randomly for a couple of moves to see if it is still being chased. It only does this once so as to not gieve too much aid to a persistent chaser, however doing so will reveal whether a chaser has moved on to another target.