Soccer

Over the course of the next month we are going to be implementing soccer agents to use in a tournament. We'll do this in a series of steps, with a mini-assignment due every week.  The first assignment will be to familiarize yourself with the game and environment and to start planning out an approach to the problem.  Here are the files:

Ball.java

GUI.java

JavaSoccer.java

Player.java

Team.java

TestPlayer.java

World.java

Zombie.java

Three sample teams (more to come). attack, rollers, and kickers.

A couple to play: Syro, north, and DarthMaul.

Stage 1:  Game Analysis

Spend some time playing with the sample agents, thinking about the constructs of the game, and working to understand the rules and what they means in terms of what your team will be capable of.  To the degree that it is possible, try to relate what is going on in the game to issues that we have discussed in class. 

In particular consider at least the following factors.

You are to write a soccer team. Some of the essentials: Use the templates provided to see how teams work. It is very useful to have global storage for information sharing between players. You must declare such storage as "static" or else each player will get an individual copy of that variable! Players have a number of actions available representing the 8 possible directions (0-7), movement towards the ball (9), doing nothing (8) and kicking (10). These and other constants are already defined in the Player.java file for you. There you will also find other basic functionality. Perceptually you can find out the distance and direction to the ball (GetBallDistance() and GetBallDirection() respectively) as well as to your opponents. You can also determine your own X, Y location (GetLocation().x GetLocation().y). Again, see the sample programs for all of these functions in action.

Different actions take different amount of clock ticks. Going E,W, N or S takes 2 ticks, NE, NW, SE, SW takes 3. Doing nothing takes 1. Kicking takes either 3 or 4 depending on the result.

To run the program type "java JavaSoccer" in the directory with the code. Then load up east and west teams through the file menu.

Feel free to modify the game to help you train - e.g. turn off the delay loop in JavaSoccer to speed the game up. Also finding bugs is very good and may result in extra credit.