Project 1   Rectangles Revisited

 

Group 8 :          Lyubov Golub, Yaniv Schiller, Yuan Zheng

 

Introduction:

          Our group chose to focus on an offensive strategy for Rectangles similar to a lot of territory games. Overall, the strategy is to construct as many rectangles as possible in order to gain enough points to win the game.  No robot is being used to chase or distribute other players; however, because of the existence of pure chasing players in some small-numbered player game, our group deployed some anti-chasing algorithms.

            In general, in a two-player game with a pure chaser opponent, our robots take advantage of the initial distance from the opponents’ robots and are likely to gain few points to win the game; in a two-player game with another pure constructor opponent, the result tend to be close; in a multi-player game, if our robots are not being chased, our player has a very good chance to win. 

 

Development of the Player

Our initial idea was to claim the whole board and win the game in a relatively short time.  Robots cooperate to form large rectangles.  After studying last year’s players, old group7’s player’s grid strategy was determined to be the best for constructing big rectangles in a short time.  We thus spread our robots evenly on the border.  Half of them move horizontally and the other half move vertically.  When horizontal and vertical lines intersect, a rectangle is formed. 

After all robots finished the initial job of moving straight to draw lines, we assumed that large percentage of the board was taken and appeared to black.  The strategy is then changed to look for largest white area and send the closet free robot to claim the white space. 

We then quickly realized that it is relatively hard to find the largest white spaces.  Even if we did find the largest space, if it was very far away from a free robot, during the process of moving  robots there, the space were very likely to be claimed or destroyed by other robots.  We adopted less ambitious end of game strategy.  Instead of looking for the largest white space we look for smaller white spaces.  For example, if we find a horizontal or vertical line with 10 white spaces, a free robot will be sent to construct a rectangle there.  It is also possible that around the 10 white spaces part of the border has been painted by our own robots.  The robot sent to finish the rectangle is going to avoid painting those parts again to minimize number of moves. 

o       Anti-naïvely-border players

Some of last year’s player place one or several robots on the border and move around it naïvely.  If they are lucky, they can take over the whole board.  In order to avoid that, we also send one robot on the border after all robots complete the first stage of straight moving grid construction strategy.  It is impossible for any player to take the whole board since there is always one pink spot.  On the other hand, our robot might luckily get the whole board.

o       Less ambitious plan

After some testing against other players, it turned out that taking the whole board had been too ambitious of a plan.  During the process of drawing grids, long lines can easily be destroyed by other players even though the opponents are not purposely disturbing our robots.  In particular, during a multiplayer game, some players have similar strategy of drawing grids.  They can easily leave one spot of our painted lines during their constructing process and successfully prevent the formation of a rectangle from our play.  We decided to modify our initial robot placement.  Instead of the whole board, we focus on a certain percentage of the board based on the board size and robot density.  For example, under default settings, we focus on one quarter of the board.  Our robots spread out on two sides on a corner, and draw lines horizontally and vertically.  Since robots are closer to each other, after a few rounds, those lines interest.  It is almost guaranteed for our player to obtain majority space of the corner it focused on.  Robots continue to move after finishing the initial corner construction.  If the opponent is another aggressive player, our robots can easily destroy their work because we are evenly spread out both horizontally and vertically.  This strategy works well in a multiplayer game.  We also optimized size of the corner later.  When the board is small, we increase the size of the corner and try to focus on more than a quarter of the board. 

 

 

 

 

 

 

 

Initial Placement of Robots (Pink)

Our strategy concentrates on a small portion of the screen in order to gain many small rectangles initially.

Initial Strategy (Pink)

At the start of the game, the robots move horizontally and vertically in a grid pattern.

 

            Sending robots to the largest white space in order to gain the area proved to be a bit ambitious too.  We modified our strategy to search for the closest white space, instead of the largest.  

Game Progress

The robots circled in yellow are moving to complete their rectangles.

 

 

 

 

 

 

 

o       Counter-chasing strategy

Our team believed the game to be purely offensive game and initially proposed zero defense.  However, after seeing group two and group seven’s pure chasing players, we were convinced that we do need certain level of defense.  Perfect pure chasing can repaint all of the chasee’s lines and hence get all the points the chasee tried to get.  One obvious solution almost everyone used is to stop moving once a robot determines it is being chased.  In some extreme cases, it can lead to a result of zero to zero.  We therefore decided to gain a few points before the chaser reaches us and everyone stops which meant completing a rectangle as quickly as possible. 

We discovered that pure chaser players tend to spread out their robots on the entire board in order to minimize their distance to the chasees.  We take the advantage of the distances and placed our robots closer to each other in order to finish small rectangles before the chaser reaches us.  Chasers tend not to construct rectangles themselves.  They don’t get a lot of points before they reach chasees.  This is another reason we deployed the less ambitious plan.  This plan combined with counter-chasing works well in a two player game with the opponent being a pure chaser.  We can win the game against group two and group seven after those modifications.

o       Chasing detection

We detect whether we are chased by looking at opponents’ robots that are a certain distance away from our robots.  We find the closest enemy robot for each of our robots. If the enemy robots’ recent historical moves are exactly the same as ours we conclude that we are being chased. Our robots stop moving.  They restart if chaser robots restart moving. This strategy was adapted from groups 3 and 1.

We noticed that sometimes when one robot is being chased his teammate who happens to be close by stops as well. Therefore we added code to make certain that only the player actually being chased stops. A robot that thinks its being chased first checks whether his closest enemy is on the same spot as his teammate. If so, the closest enemy is probably chasing another teammate and it is safe for the robot in question to continue constructing.

 

Result Analysis

o       Two player games

Our player’s performance increases when the board density decreases.  If the opponent is a chaser player, higher density means their robots are closer to ours; hence, it is easier for them reach us. 

Our player performs very well when there are very few robots (3 or 5 robots).  Players that rely on cooperative strategies like Army or Cavalry are at a disadvantage when there are fewer robots. Our robots work individually and with lower density boards construct more rectangles than opponents who rely too much on their teammates. However, when board density is high, players that cooperate have a much easier time finishing their rectangles.

 

 

 

2 Player and 6 Player Results for Group8Player0

Number of Robots, n=50

2 Player Average Rank

    

6 Player Average Rank

3

1.028

1.6

5

1.292

1.9

10

1.383

1.4

20

1.75

2.8

 

o       Multi-player games

The strategy of focusing on a smaller part of the board works exceptionally well when the number of players is increased.  When there are a lot of players, robots interrupt each other constantly, and it is almost impossible to construct rectangles of large size.  Our small rectangle strategy therefore works well.  This is shown by our consistent wins in the six player games. However, during the four player games, a smaller board size was used than for six player games. In these games, the advantage we had for multi-player games was canceled out by our player’s low performance with high density boards.

 

Conclusion

            Our strategy evolved drastically throughout the course of the project. As other groups fine-tuned their players, we had to constantly change ours to continue getting good results. We incorporated several other groups’ ideas into our project. Class discussions were essential in allowing us to see other groups’ progress and compare it to our own. The resulting player is a purely constructive player that employs basic defense strategies.