__
/^ ^\
| *| * |
__ | | __
\ \ | \/ | / /
\ \ \____/ / /
\ \__||__ / /
\ /
\ GT /
\ |
\ | ====
/ \ / /
/ /\ \ / /
_____ / / \ \/ /
/ \_/ \ / / \___/
|\_/ \_/| \ \
|/ \_/ \| \ \
\_/_\_/ _\ \
====/
designed by Tucker BalchFor a synopsis of what's new in version 2.0, see the NEW file.
./cleanteams
./contest example wall
This will set up a soccer match between the "example" team and
the "wall" team, by compiling and linking teams in the directories
teams/example and teams/wall. If it does not compile, you
probably don't have all the software you need to compile it.
See "compatibility" above. Don't be too concerned about "warnings"
but "errors" are bad! After the compilation is complete the teams
will automatically start a game. The first team to 7 points wins.
To run another game, type "./soccer"
This is what a game looks like:
ASCII=Soccer=v2.0====(q)uit====(s)lower====(f)aster============================= | | | < | | | | < | | > | | | | O | | > | | | | > < | | | | | | | | | | | | > | | | | < | | | | | | | ================================================================================ Krazy Kickers 1 W'all Kick Yer Butt 5
A point is scored when the ball is pushed or kicked across a goal line. The game continues until the first team scores 7 points.
Occasionally, the ball gets "stuck" between two competitors. In that case the ball is automatically "nudged" up or down, so play can resume.
You will notice a macro called UN(). This is used to ensure that function and variable names are not duplicated between team's .c files. For instance, for the east team, UN(team_name)() will become EASTteam_name(). This is necessary for the automatic compiling and linking of arbitrary teams for tournaments. It also allows the same team to play itself. Be sure to use the macro around all functions and global variables in your main.c file.
The players are actually functions player1() through player4(). Each function is passed 4 parameters. The incoming parameters are the robot's sensory information:
Compiling and linking is rather hairy mostly because we can link together any two arbitrary teams, and they can play on either side of the field. Fortunately, if you just copy everything from the teams/example directory to a new directory, and develop your team there, you shouldn't have to worry about this too much.
The default makefile assumes your team is coded in main.c . main.c is compiled into either west.o or east.o depending on whether your team will take the east or west side of the field. The symbols WEST_TEAM and EAST_TEAM are defined/not defined according to which side you're on.
The makefile also compiles common.c which is presumed to include functions and globals that do not have unique names and that might be shared if your team was playing itself. Even if you don't use common.c, don't remove it! the contest script and makefiles aren't smart enough not to use it. I found I needed this to make it easier to use some c++ classes I use for my learning team.
Finally, the .o files are grouped into libraries: libeast.a libwest.a and libcommon.a . The contest script copies the appropriate libraries up to the top directory, then links soccer.o with them to generate the final executable.
You can take advantage of this library approach now to design more complex teams composed of several separately compiled modules - but you don't have to! Just make sure your makefile correctly generates libeast.a libwest.a and libcommon.a .
tucker.balch@mac.com