Project 1: Rectangles Revisited

Group 6

Behrooz Badii

Andrew Shin

Valerie Davidkova

 

Introduction:

 

In this project, groups were assigned to create robots that could gain as much space as possible by creating rectangles while other players were trying to build their own or destroy your work.  Obviously this was an exciting and dynamic situation.  One would have to build their own rectangles while fending off others.  Subsequently, the evolution of players was dynamic as well, changing to adapt to different player habits and predicted problems or oppositions caused by other players, whether the actions of other players were deliberate or accidental.  Watching the players battle each other in class showed this easily.  Our initial player had difficulty understanding if it hit a wall, but by the end, our player was able to sweep the area and stand up against other players. 

 

Ideas and changes:

 

            Our first idea was to create a robot that would intersect to create rectangles, turn 90 degrees, and intersect again to create more rectangles.  These smaller rectangles would actually be the border for a larger rectangle:

 

 

            We realized the failure of this idea due to the complexity and inefficiency of its implementation.  Furthermore, and more importantly, chasers would bother the player too much for it to create something this elegant.  Even if we developed this idea, it would be incredibly difficult to gain much ground in a multiplayer game with many robots.  There would just be too much interference.

 

The Team Player Approach

Another strategy we considered was that of a game with a large number of robots. We position the robots and the grid intersection lines upon which each robot is assigned an itemized list of tasks to accomplish. That way all of our robots belong to a team of four and all four collaborate to both score a rectangle and once that has been accomplished embark on a pursuit of an enemy. The tasks were defined as follows:

·        Counter-clockwise find the nearest same-player robot and take his position.

·        If being chased stop at that position; If not being chased perform a check to see if counter-clockwise between you and the nearest same-player robot there is a chaser perform the first task again.

·        Once tasks one and two have been executed all four robots align next to each other and form a four-robot army player. Find the nearest enemy robot and start chasing.

 

 

 

 

 

 

 

 


           

 

 

 

 

 

 

 

 

 

 

 


By combing an army player and a chaser in one we sought to utilize the advantages of being a chaser (thus making it harder for enemy robots to score area) and an army player which has a bigger marginalized likelihood of covering areas of the board than a single robot. 

We thought that the idea had potential but given the large number of enemy robots as well as the widespread positioning of our robots on the board there would be significant enemy interference that would compromise the attempted area coverage. In the meantime, while our robots are executing the above tasks and before they combine to form army players, the enemy would have had a significant opportunity to cause damage. With some optimizing, however, we believe that the idea and the various extensions of it may have merit.  

            The next idea was a sub-case of the team player approach. We would have four robots create a synchronized square.  This would be very efficient, and the parameters to create such a square could be easily changed to optimize the building of the rectangle before interference occurred.  We wanted the robots to be placed randomly so that other robots could not predict where we would be and have an upper hand right from the start.  This was to be used only for a few robots.  More robots would need a better plan than just synchronously creating rectangles at various spots on the board.

            However, this had a major problem.  After a while, the chasers foiled our idea.  So we knew that we had to change the idea.  We knew we had to switch the strategy to incorporate an anti-chasing strategy.  So, after a short discussion, the group wanted to change the idea a bit.  At the beginning of a match, all the robots would create a single synchronized rectangle, but then they would switch strategies to chasing.  This would give us at least a small portion of the board, but then we could stop other robots from gaining ground.  Using strategy switching, the player can gain at least some ground and not finish the match with any area gained.  Also, being offensive then becoming a chaser was great, since we saw chasers play chasers and realized that there was often a stale mate because the chaser would chase each other and not much area was obtained.  The pure chaser idea was too defensive.  So, our strategy switcher would get ground (take a bite out of it), and then chase (fight) other robots.  Hence, our Bite and Fight strategy became final.  The following is a picture of this strategy in play, since we decided to implement it in our final player.

 

 

            Well, we had a strategy for few robots.  What about many robots?  The strategy switcher would do poorly in multiplayer games, since chasing in multiplayer games is much less effective.  It’s a matter of numbers; the builders would outnumber the chasers.  So somebody would still gain a reasonable amount of area.  We need something that can obtain area consistently.  Since so many players are on the board in a multiplayer game, the window of opportunity to create a square is exponentially increased.  Ambitious strategies were inefficient because of the increased probability of lines being broken.  We need to guarantee area as well.  So we opted to guarantee area by marching up and down the map.  The group was interested in the army player from last year.  It was consistent, elegant, and very simple to understand.  It moved from one side to the other, moved up (if it started at the southern edges) or moved down (if it started at the northern edge).  If it reached the opposite edge, it would reverse direction and cover its tracks again.  The objective of this robot, and where it did the best, was when there was a board with many players and many robots for each player.  This would be a fantastic situation, for the army player, with its sheer robustness, would gain enough ground as all the other players interfered with each other.  But the army player, even with interference, would still be able to gain ground. 

 

 

Here, even though both the yellow and red players are interfering with rectangle creation, there is still a substantial amount of area obtained.  It is consistency that comes with the army player.  You are bound to get a reasonable amount of the playing field, regardless of whom your opponents are. 

 

Group6Player2f:

 

This player combines the ferocity of the first successful idea of gaining some ground and chasing (Bite and Fight) and the consistency of the army player (Window Washer).   When the number of robots for each player is 4 or less, the Bite and Fight strategy is used.  If the number of robots for each is 5 or more, the Window Washer strategy is implemented. 

 

Tournament Analysis:

Here are the results of the tournaments in which our strategies were optimized.  With many robots and many players, we did moderately well, gaining at least 175 in area.  Comparing this to most of the other bots, we were in the middle of the pack.  For few players and few bots, we did well, but not as well as we would have liked.  For medium number of robots with a medium number of players, our strategies did poorly.  With less than 4 players and many robots, our robots did more poorly that first suspected.  But doing well there was not our goal.  And with many players and few robots, our chasing strategy, as suspected, would not do very well.  The robot did well where we suspected it would, and that is gratifying.

 

Conclusion:

 

This is the first major cooperative project of this class.  This foreshadows how interesting the other projects will be.  The group thoroughly enjoyed each other’s abilities and utilized each other’s prowess in creativity, programming, and hard work to get the job done.  It was interesting to see last year’s player and how to incorporate their styles and strategies into our final product.  This proved to be more difficult than suspected, since integration of their code in ours would mean a total understanding of another group’s syntax and semantics.  But more importantly, this leads to deeper and deeper layers of strategies and counter-strategies.  This group would highly recommend the continuation of this project into the next Programming and Problem Solving class.  The only problem the group had was the short amount of time allotted to make a good strategy.  If the group had not come late into the class, this might have been a different story.  Overall, however, this was a good experience that would be recommended to others.

 

Acknowledgements:

            We’d like to acknowledge OldGroup3Player300 for their army algorithm.

            We’d like to acknowledge Group7Player6 for their chasing algorithm.