CS-424, Spring, 2007
Final Competition: RoboSoccerBU

RoboSoccerBU is a game for two robots. Each lab team must design, build, program, 
and test a robot, which will compete against each robot designed by every other 
team. The point of the game is to score as many points as possible. The robot 
with the highest score at the end of the game wins that game. During game play 
one robot is on "offense" and the other is on "defense". Only the offensive robot 
can score by moving into a "goal" area at the far end of the playing field. The 
other robot is on "defense" and tries to prevent the offensive robot from scoring 
by bumping it with one of its front bumpers. If that happens, the robots change 
roles, with the offensive robot going on defense and the defensive robot going on 
offense. The robots will then be separated and restarted. 

Determining defensive and offensive robots (Pre-game):

The end of the playing field opposite to the goal end is divided into two equal-
sized gray areas bounded by white (the "Pre-game Find" areas. At the start of each 
new game and also after a point is scored by either robot, each robot is placed at 
one corner of one of the two rectangular areas. A small black piece of paper 
representing the soccer ball is placed at a random position in each rectangular 
area by the referee. The robots are started simultaneously and the one that finds 
its "ball" first becomes the offensive player; the other robot becomes the 
defensive player. The offensive player must play a happy song (whatever song you 
like) and "notify" the defensive player that it has captured its ball by sending 
out IR message number 1 and stop movement. After that message is sent and received, 
the robots will be placed on the playing field (as shown in the diagram of the 
playing field shown below), started, and begin their scoring strategy or defensive 

A game: 

A game will continue until a total of 3 minutes have elapsed. After a point is 
scored by the offensive robot, the robots will be returned to the "Pre-game Find" 
area to once again determine which will be on offense and which on defense for the 
next round of the game. The winner of a game will be the robot that has accumulated 
the most points after the 3 minutes.

The Playing Field:

The playing field is divided into two parts: the actual field of play and the 
smaller "Pre-game Find" area in which the robots determine which will be on defense 
and which is on offense for the next round. (See the following diagram.) The actual 
field of play has out of bounds areas on either side and alongside the goal area. 
These are bounded by lines of different colors. If the offensive robot goes out of 
bounds, it must come back in bounds within 5 seconds or both robots will be stopped 
and the roles of offense and defense will be interchanged. At the end of the actual 
field of play is the goal, painted white and delineated by three black lines. 
Immediately behind the goal there will be a strong source of white light that can 
be "seen" from anywhere on the field.


Robot specifications:

No robot is to exceed 10 inches in any dimension (width, height, length).

A robot can use as many sensors as desired (if you can find ways of hooking them 
all up to the three sensor ports on the RCX). Remember that your robot is 
responsible for color recognition, direction recognition, touch detection, and IR 
message recognition.

A robot may not have more than three motors.

A robot must have one or two front bumpers at least 2 Lego units high and cover 
the area in between its treads/wheels. Additionally the bumper may not begin more 
than 3 inches above the ground.

You may write separate programs for the "find ball", offensive, and defensive 
strategies; but be aware of the program size limitations of the RCX.

You may not make structural/hardware changes to your robot during possession 
changes or at any other point during a game.

No damaging or light-emitting foreign objects may be added to the robot. The 
referees reserve the right to deny objects which they feel may be dangerous or 

With the exception of the "tagged" message (# 2) emitted by the defensive robot if 
and when it tags the offensive robot and periodic "proximity messages" emitted by 
the offensive robot (see below) your robot may not emit firmware or other harmful 
IR signals during any part of the game.

The Offensive Robot:

The offensive robot is responsible for finding the goal and moving into it. It 
scores a goal any time it enters the goal area. Then it has 5 seconds to stop 
movement inside the goal and play an ascending tone notifying everyone that it 
knows it scored a goal. If it does not play the sound within 5 seconds, the team 
does not get a point and possession changes

It should try to avoid being tagged by the defensive robot (perhaps by emitting 
and detecting periodic IR messages as in the example of the "Proximity Sensor" 
given in class and trying to back away when the separation is too small). You may 
NOT use Message numbers 1, 2, or 3 to do this.)

It should avoid going out of bounds; if it does so and does not get back in bounds 
within 5 seconds or if it bumps into any of the walls of the playing field, both 
robots will be stopped and the roles of offense and defense will be interchanged.

If its front bumper or bumpers are activated by the defending robot tagging it 
(bumping into one of its front bumpers), it must play a short "sad song" (whatever 
song you wish) and stop within three seconds of the collision. Possession of the 
ball then changes and the robots are separated and restarted.

If it receives IR Message number 2 (emitted by the defensive robot when it tags 
the offensive robot), it must also play the sad song and stop within three seconds. 
Before a game starts, the offensive robot must pass a "test" in which it shows that 
is capable of doing this.

The Defensive Robot:

The responsibility of the defensive robot is to prevent the offensive robot from 
scoring by bumping into it with one of its front bumpers. Whenever that happens, 
it must play a short "happy song" (whatever song you like), send out IR Message 
number 2 (which should cause the other robot to stop), and finally stop itself.

If it bumps into a wall and mistakenly plays its sad song and sends out IR Message 
number 2 (which is supposed to indicate that it tagged the offensive robot), it 
will be penalized by having one point deducted from its score.

It is not permitted to enter and stay more than three seconds in the goal area. If 
it does so, it will be penalized by having one point deducted from its score.

It is not allowed to cripple the other robot by ejecting objects into the playing 
field or having parts that extend beyond its size specifications.

Stopping a game:

At any time the referee (TA) may determine that a game must be stopped. If that 
happens he will have an RCX capable of continually sending out IR Message number 3. 
Your program must ALWAYS respond to that message by stopping the robot.

Determining the winning team:

Each robot will play at least one game against every other robot. For each robot 
we will tabulate total number of goals scored by that robot and the number of games 
it won. The winner of a single game will be the robot that has scored the greatest 
number of goals for that game. In the case of a tie there will be no winner of that 
game. The final winner will be determined by a combination of most wins and most 
goals scored during all of the games of the competition. In other words, each will 
team be rated 6,5,4,3,2,1 in number of game victories and 6,5,4,3,2,1 based on total 
number of goals accumulated in all games. Those two numbers for each team will be 
added and the team that has the highest sum is the winner.


In order to receive a satisfactory grade in the competition, your robot must 
demonstrate that it:

1. can find a light source and move in its general direction

2. will stop when its front bumper is activated

3. can emit and detect IR messages at the correct times

4. has a strategy for finding the black "ball"

5. can recognize and distinguish between the out-of-bounds lines, the playing area, 
and the goal area

6. has an offensive strategy

7. has a defensive strategy

8. can recognize when it has entered the goal

Each team must submit a paper describing in detail the design of its robot. The paper 
must be submitted by the Friday after the competition at noon. Diagrams (and/or 
especially photographs) as well as source code listings are an essential part of the 
paper. The paper must also describe the techniques and strategies it used for each of 
the eight points given above. Each member of each team must also submit a numerical 
peer evaluation of each other team member indicating how he/she thinks the other 
members of the team have contributed to the overall effort and success of the team. 
The following is how the project grade will be determined:

The paper................................................................. 30%
Performance during the competition (professor/TA evaluation 
of how well the robot performed the eight requirements)................... 25%
Final score in the competition.............................................20%
Team member peer evaluations...............................................25%