All agents should assume that they are defending the east goal and attacking the west goal. All directions will be "magically" swapped by the simulator if the team is actually defending the west goal. ----------------------------------------------------------------------------- Tcl Soccer agents written in the Tcl language should include at least the following commands: InitializeGame Special code to execute before a game starts. Return value is ignored. InitializePoint Special code to execute before each point starts. Return value is ignored. WonPoint Special code to execute after the team wins a point. Return value is ignored. LostPoint Special code to execute after the team loses a point. Return value is ignored. GameOver Special code to execute after the game ends. Return value is ignored. Player1 Player2 Player3 Player4 The code to determine the next move for each player. A compass direction attempts to move the player one square in that direction (possibly moving the ball if it's in the way). PLAYER means the player will stay in its current spot. KICK means the player will attempt to KICK the ball, if possible. The player will also move into the square that the ball was in, if the ball moves. Valid return values are: N, NE, E, SE, S, SW, W, NW, PLAYER, KICK ----------------------------------------------------------------------------- Tcl Soccer agents written in the Tcl language have access to the following commands: XSize Returns the size of the field from east to west, in number of grid squares YSize Returns the size of the field from north to south, in number of grid squares View dir Returns the contents of the square one step away from the player in the direction of dir. Valid values for dir are N, NE, E, SE, S, SW, W, NW, or PLAYER. Possible return values are: EMPTY, BALL, TEAMMATE, OPPONENT, or OUT. A return value of OUT indicates that the square is beyond the edges of the field. Content dir item Checks the contents of the square one step away from the player in the direction of dir, and compares those contents to item. If the contents match the item, then return 1, else return 0. Valid values for dir are N, NE, E, SE, S, SW, W, NW, or PLAYER. Valid values for item are EMPTY, BALL, TEAMMATE, OPPONENT, or OUT. Possible return values are: 0 or 1. Sideline dir Checks whether the square one step away from the player in the direction of dir is a sideline square (along the north or south edge of the field). Returns 1 if it is a sideline square or 0 otherwise. Valid values for dir are N, NE, E, SE, S, SW, W, NW, or PLAYER. Possible return values are: 0 or 1. Goal dir Checks whether the square one step away from the player in the direction of dir is a goal square (along the west or east edge of the field). Returns 1 if it is a goal square or 0 otherwise. Valid values for dir are N, NE, E, SE, S, SW, W, NW, or PLAYER. Possible return values are: 0 or 1. BallDir Returns the direction to the ball (rounded to one of the eight valid directions). Possible return values are: N, NE, E, SE, S, SW, W, or NW BallDist Returns the minimum number of steps from the player square to the ball square (assuming nothing gets in the way). Possible return values are: Any integer between 1 and the longest dimension of the field (usually [YSize]) OpponentDir n Returns the direction to the nth closest opposing player (rounded to one of the eight valid directions). Valid values for n are 1, 2, 3, or 4 Possible return values are: N, NE, E, SE, S, SW, W, or NW OpponentDist n Returns the minimum number of steps from the player square to the nth closest opposing player's square (assuming nothing gets in the way). Valid values for n are 1, 2, 3, or 4 Possible return values are: Any integer between 1 and the longest dimension of the field (usually [YSize]) MyX Returns the player's X coordinate on the field. 1 is the westernmost "column" of the field, and [XSize] is the easternmost column of the field. Possible return values are: Any integer between 1 and [XSize] MyY Returns the player's Y coordinate on the field. 1 is the northernmost "row" of the field, and [YSize] is the southernmost row of the field. Possible return values are: Any integer between 1 and [YSize] Debug msg Logs the msg string into the debug window for the team. The argument msg can be any string of characters. No return value.