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: % sserver In another shell, start a player: % cd /usr/local/agents/sserver-curr/sampleclient % ./client 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: % ./client > ~/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. 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 left-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.
In a shell, go to the game logs directory % cd /usr/local/agents/logs % ls Pick at least one of the games to watch. They are the finals from the previous 4 RoboCup competitions. % logplay
(e.g. "logplay 99final.rcl") (A full game lasts to cycle 6000. The 98 final is divided into 2 halves. The 2001 final goes into extra time.)
Copy the sserver script and server.conf to your home directory % cp /usr/local/agents/sserver-curr/sserver ~/ % cp /usr/local/agents/sserver-curr/server/server.conf ~/ % cd Now edit that version of the sserver script to record a log file. There are 2 ways to do that: 1. Change the line in sserver that reads ./soccerserver -sfile server.conf -pfile player.conf &) to ./soccerserver -sfile server.conf -pfile player.conf -record ~/record.log &) Then when you run the server (and press "kickoff"), the file record.log should appear in your home directory. OR 2. Change sserver to read server.conf from your home directory: ./soccerserver -sfile server.conf -pfile player.conf &) to ./soccerserver -sfile ~/server.conf -pfile player.conf &) and then ended ~/server.conf at the bottom by uncommenting out the line #record: record.log to record: ~/record.log Now repeat the sequence from "Get familiar with the soccer simulator" (but call "~/sserver" instead of "sserver"). After killing the server, replay your log: % logplay ~/record.log During this course, you will often be sending me such logfiles as the results of your programming assignments.
Page maintained by
Questions? Send me mail