CS344M: Autonomous Multiagent Systems -- Fall 2012: Programming Assignment 1 - Part 1 (2D Simulator)


Programming Assignment 1 - Part 1 (2D Simulator)

for Autonomous Multiagent Systems (cs344M)


 

The following instructions are designed to work once you have logged onto a publinux machine. You can see a list of such machines by doing "cshosts publinux".

You may not need to install the 2D simulator on a local machine. However, 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 15.1.0 for this class. There are tarred, gzipped versions of the version 15.1.0 2D server components at /projects/cs344M.pstone/2d/rcss_15.1.0/ or you can get them from http://sourceforge.net/project/showfiles.php?group_id=24184 . If you'd like to install the 2D server on your laptop or home machine, there are instructions at http://sourceforge.net/apps/mediawiki/sserver/index.php?title=Install . Mac users, please look at this installation guide. Note: this guide is fairly old and for a previous version of the simulator. We have not verified that any of these installation instructions work, but they have worked for students in past semesters. Send mail the list if you come across problems - perhaps someone else is having the same problem.

Get familiar with the 2D soccer simulator

  1. Make sure nobody else is running the simulator on the machine you're on:
    	% ps aux | grep rcss
    
    If someone is on, you will see a line with the word "rcssserver" in it.
  2. If you are not running the server on the local machine, run the following command:
    	% xhost a.cs.utexas.edu 
    	    where 'a' is the name of the machine you are using.
    
  3. In one shell, start the simulator (the server::drop_ball_time argument turns off the time limit to kick the ball on a free kick):
            % rcsoccersim server::drop_ball_time=0
    
  4. In another shell, start a player:
    	% cd /projects/cs344M.pstone/2d/sampleclient     
            % ./client
            Type "(init myteam (version 15))" 
    	[instead of myteam, use your own name] and watch the new agent's sensory information stream by. 
    
            Kill the client (ctrl-C). 
    
  5. Now start the player again, but pipe the output to a file:
            % ./client > ~/myteam.out    
            Type "(init myteam (version 15))" and see a 2nd agent appear on the field. 
            Type "(move -5 0)" and see the player move onto the field. 
            Select the Referee->KickOff menu option or Ctrl+K to kickoff. 
            Type "(turn 45)" and see the player turn. 
            Type "(turn -45)" and see the player turn back. 
            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. 
     
            Notice that all this time, the clock at the bottom of the simulator has been 
            running.  When you kicked off, the play mode changed to "play_on". 
    
            Now right-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 hitting ctrl-C in the window that you
            started the server from.
     
            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 and display the logs
        % cd /projects/cs344M.pstone/2d/logs
        % ls 
Pick at least two of the games to watch, one newer and one older (to notice the difference in play). They are finals from previous RoboCup competitions. In one shell start the log player (make sure you are not in the game logs directory for this call):
        % rcsslogplayer <game>  (e.g. "rcsslogplayer /projects/cs344M.pstone/logs/2d/2012final.rcg")
Hit the play button on the rcsslogplayer to start the game. Note that a full game lasts 6000 cycles (the 1998 final is divided into 2 halves, the 2001 final goes into extra time, and the 2008 final goes to penalty kicks).

Create a game log

Now repeat the sequence from "Get familiar with the soccer simulator" but this time activate game logging with the following command when running the simulator (the server::game_logging argument turns on logging).
	% rcsoccersim server::drop_ball_time=0 server::game_logging=on
After killing the server, notice that there will be a log file in the directory from which you ran the server:
	% ls *.rcg
replay your log: In one shell start the log player:
        % rcsslogplayer <file>.rcg (where <file> is the name of the log displayed by the previous command)
If the logfile showed your player turning, dashing, and kicking as described in the assignment, then turn in the logfile (along with your 3D simulator logfile from the second part of this assignment) as directed on the main assignments page. Get used to working with log files and replaying them - during this course you will often be sending us such logfiles as the results of your programming assignments.

[Back to Department Homepage]

Page maintained by Elad Liebman
Questions? Send me mail