CS378: Autonomous Multiagent Systems -- Fall 2002: Programming Assignment 1

Programming Assignment 1 for Autonomous Multiagent Systems (cs378)


The following instructions are designed to work once you have logged onto a publinux machine. I recommend using one of the fast new machines. You can access the list by invoking the command "cshosts linuxtea".

If you would like to work remotely and have a slow connection, you should look into installing the RoboCup Soccer Server System on your local machine. We will be using version 8.05.10 for this class.

Get familiar with the soccer simulator

Make sure nobody else is running the simulator on the machine you're on:
	% ps -aux | grep soccer
	If someone is on, you will see a line with the word "soccerserver" in it.
	(For future reference, there IS a way to run multiple servers on 
	 the same machine.)

In one shell, start the simulator: 
        Add /projects/cs378.pstone/rcsoccersim-8.05.10/install/bin to your path, e.g. by
	% set path = ( $path  /projects/cs378.pstone/rcsoccersim-8.05.10/install/bin )
	% export PATH=$PATH /projects/cs378.pstone/rcsoccersim-8.05.10/install/bin
(You may want to do this in your .cshrc so it happens every time you log in.)
(You may also want to make a symlink to the /projects/cs378.pstone/ directory and/or some of the subdirectories.)
        % rcsoccersim

In another shell, start a player: 
        Add /projects/cs378.pstone/rcsoccersim-8.05.10/install/bin to your path as above
        % rcssclient
        Type "(init myteam)" and watch the new agent's sensory information stream by. 
        Kill the client (ctrl-C). 
Now start another player, but pipe the output to a file: 
        % rcssclient > ~/myteam.out    
        Type "(init myteam)" and see a 2nd agent appear on the field. 
        Type "(move -10 0)" and see the player move onto the field. 
        Type "(turn 45)" and see the player turn. 
        Type "(turn -45)" and see the player turn back. 
        Press the "kickoff" button on the simulator window. 
        Type "(dash 100)" and see the player move. 
        Type "(dash 100)" several more times until the player is next to the ball. 
        Type "(kick 100 0)" and see the ball move towards the goal. 

	NOTE:  If you don't get the player to the ball by cycle 200, it may jump
	back to where it started.  This will only happen once.  One way around 
	this problem is to wait until cycle 200 before starting to dash.
        Notice that all this time, the clock at the top of the simulator has been. 
        running.  When you kicked off, the play mode changed to "play_on". 

        Now middle-click with your mouse somewhere on the field and give. 
        a free kick to one of the teams.  Notice that the play mode changes. 
        Kill the client (ctrl-C). 
        Kill the simulator by clicking on "Quit." 
        Now inspect the file ~/myteam.out to see the player's sensations 
        during the above sequence.   
         -- Search for "ball" (it should have become visible after the "move"). 
         -- Search for "referee" (changes to the play mode are announced). 
	The flags are all static markers that help the player figure out where 
	it is on the field.
In this exercise, you controlled the player by typing.  Your 
sensations came from an overhead view of the field.  Your task during 
this class will be to program agents to control players.  Their 
sensations will be exactly what you saw in the file myteam.out. 

Watch a game

In a shell, go to the game logs directory 
        % cd /projects/cs378.pstone/logs
        % ls 
Pick at least one of the games to watch.  They are the finals from the previous 
5 RoboCup competitions. 
        % rcsslogplay   (e.g. "rcsslogplay 99final.rcg") 
(A full game lasts to cycle 6000.  The 98 final is divided into 2 
halves.  The 2001 final goes into extra time.)

Create a game log

Clean up all the old logs in your directory
        % \rm *.rcl *.rcg
Now repeat the sequence from "Get familiar with the soccer simulator."
After killing the server, notice the new logfile in your directory
	% ls *.rcg

replay your log: 
        % rcsslogplay ~/.rcg  
(where  is the name of the log displayed by the previous command
Turn in the logfile as directed on the main assignments page.

During this course, you will often be sending me such logfiles as the 
results of your programming assignments. 

[Back to Department Homepage]

Page maintained by Peter Stone
Questions? Send me mail