CS344M: Autonomous Multiagent Systems -- Fall 2012: 3D Programming Assignment 3

3D Programming Assignment 3 for Autonomous Multiagent Systems (cs344M)


This assignments assumes the knowledge gained from assignment 1 and assignment 2. If you did not do the 3D version of assignment 2, you should read through it before continuing.

Your goal is to use communication to help an agent improve its performance in some way. Details for an example are given here. It is expected that many of you will choose to follow the example (which is perfectly acceptable). But you may choose another task task (different from assignment 2) as long as you can show a noticeable improvement with communication when compared to no communication. Before choosing another task, be sure to send us an email to ensure that it is acceptable. If you don't use the example, you should still read carefully through the hints since they may be applicable to your task.


  • Create an agent whose sole goal is to face the ball as much as possible. When the ball moves to a random new location, it should find the ball again as quickly as possible. Once the player is placed on the field (e.g. with the beam() method), it need no longer change location.
  • Note that your player from assignment 2 can already do this. But now, you may use up to 3 other agents placed on the field to watch and communicate (with the "say" command).
  • None of the players will need to walk or kick - only turn and say.
  • As in the previous assignment, you still don't need to parse the entire see messages.
  • You can create two different types of agents - one that tries to face the ball as quickly as possible and one that watches and communicates. However, most of you will likely find it easier to just design one agent that communicates and tries to face the ball quickly (and then have all four players run this code).
  • The communication protocol among the agents is for you to design.
  • No one player may be placed on a corner of the field so that it can see the entire field
  • Some details:

  • In order to randomly place the ball on the left hand side of the field run the move-ball.pl script. You can also move the ball to an exact location by passing in x and y arguments to the script.
         % perl move-ball.pl [x y]
    Additionally you can select the ball with the mouse and control-click on the field to move the ball to a new location. A shortcut for selecting the ball is shift-0.
  • In the end, there should be a visible improvement in the speed with which the player can find the ball.
  • Hints:

  • To say something use the say() method. Messages are limited to 20 bytes in length and can not use the white space character " " and the normal brackets "(" and ")". For more information checkout the say effector in the online Simpsark Users Manual (note that you don't need to start a message with the word say as shown in the manual, the say() method handles this for you).
  • To listen to the last thing said call the worldModel->getLastHearInput() method. The hear perceptor has the following format:
         (hear <time> 'self'|<direction> <message>)
    You can only hear a new message from your teammates every two cycles and you can only hear one message at a time (meaning if multiple teammates say something at the time you only hear what one of them said). For more information checkout the hear perceptor in the online Simpsark Users Manual.
  • For this assignment you may use some methods to determine the global position of an agent on the field. These values are calculated using a particle filter (or in the case of this assignment ground truth localization data from the server).
         worldModel->getMyPosition()  // returns a VecPosition (use getX() and getY() methods of VecPosition to get appropriate values) of the agent's global position on the field 
         worldModel->getMyAngDeg()    // returns the angle in degrees the agent is facing in the X-Y plane (the orientation of the agent)
  • Use the worldModel->getUNum() method to get an agent's jersey number
  • To get the time since the simulator started call worldModel->getTime() and to get the current game time use worldModel->getGameTime().
  • What to turn in:

  • 2 logfiles with player 1 (make sure it's player 1 so I know which one to look at) trying to face the ball: one without communication, called [yourlogin]-nocomm.log, and one with communication, called [yourlogin]-comm.log. In both cases, drop the ball around the field in a wide variety of locations to exhibit the robustness (or lack thereof) of your agents to different ball positions. Please compress the logfiles using gzip before submitting them.
  • Your modified source code as [yourlogin]-strategy.cc. Comment your code such that I can follow what you did and easily run your communication and non-communication tasks (ie, try to make it easy to turn communication on and off).
  • If you did the 3D version of assignment 2, you must also submit a new log file called [yourlogin]-passWithCom.log and updated, commented source code called [yourlogin]-passWithCom.cc. These files should reflect an improvement - through the use of communication - to your solution to part 3 of 3D programming assignment 2
  • To turn in your files, use the turnin program with grader "patmac" and assignment label "prog3-3D". When the assignment is there, send us an email to that effect, clearly stating that you submitted the 3D version of assignment 3 in the email subject. Be sure to include a brief description of your task (even if you did the example task), a brief description of your communication protocol, and an answer to the following question: 'Could an opponent agent disrupt your communication method? How?' .
  • Grading Criteria

    You will be graded on how much you can improve your agents using communication. Note: If you did the 3D version of assignment 2, and you do not submit a new log file and updated source code that uses communication to improve upon your passing solution to assignment 2, then you will lose 2 points on this assignment.

    [Back to Department Homepage]

    Page maintained by Patrick MacAlpine
    Questions? Send me mail