A couple scripts and code for starting a game and collecting statistics/data from the game (actually a single half).
The start-game-me.sh script runs a game between our team and an opponent, and then the agents (started with the start-stats.sh start script) write out data about the game at the conclusion of the half using the RecordStatsBehavior
class.
rm <stats_output_file>
start-game-me.sh <stats_output_file> <opponent_dir> <left | right>;
cat <stats_output_file>
The stats_output_file
argument specifies the file that data is written to, the opponent_dir
arguments specifies the directory containing the start.sh start script for the opponent team, and the left | right
argument determines if our team starts on the left or right side of the field.
score = <score_team> <score_opp>
average_ball_posX = <avg_ball_posX>
kickoffs = <num_scored> <num_missed>
opp_kickoffs = <num_scored> <num_missed>
corners = <num_scored> <num_missed>
opp_corners = <num_scored> <num_missed>
indirect_kicks = <num_scored> <num_missed>
opp_indirect_kicks = <num_scored> <num_missed>
possession = <percentage_of_ball_possession>
kicks<unum> = <num_kicks>
[missing_<team | opp> <unum>]
[late_<team | opp> <unum>]
[crash_<team | opp> <unum>]
[all_crashed_opp]
[host <host>]
The score of the game is reported as the number of goals scored by our team followed by the number of goals scored by the opponent team. The average position of the ball in the X direction is also recorded.
The number of times a teams does and does not score off of kickoffs, corner kicks, and indirect kicks for both our team and the opponent team are reported. A team is considered to have scored after one of these kick events if they are able to score a goal within a certain amount of time after the event has occurred -- these time thresholds are defined in recordstatsbehavior.h.
Possession refers to the percentage of time a player from our team is closest to the ball.
Each agent reports the number of times they perform a kick action/skill.
Agents' teams and uniforms numbers are reported if they are missing, late, or have crashed. If all agents on the opponent team have crashed this is reported as well. Additionally the name of the host machine is printed out for debugging purposes if any agents are missing, late, or have crashed.
- Missing = agent never seen
- Late = agent not present at start of game but shows up later
- Crash = agent seen but no longer present at end of game
The start-game-2teams.sh script runs a game between any two given teams, and then the script gameMonitor.py listens to the game on the monitor port and, at the conclusion of the half, writes on the current score.
rm <stats_output_file>
start-game-2teams.sh <stats_output_file> <team1_dir> <team2_dir> <left | right>;
cat <stats_output_file>
The stats_output_file
argument specifies the file that data is written to, the team1_dir
and team2_dir
arguments specify the team directories containing start.sh start scripts, and the left | right
argument determines if team1 starts on the left or right side of the field.
score = <score_left_team> <score_right_team>
[missing_<left | right> <unum>]
[late_<left | right> <unum>]
[crash_<left | right> <unum>]
[all_crashed_<left|right>]
[host <host>]
The score of the game is reported as the number of goals scored by the team starting on the left side of the field followed by the number of goals scored by the team starting on the right side of the field.
Agents' teams and uniforms numbers are reported if they are missing, late, or have crashed. If all agents on a team have crashed this is reported as well. Additionally the name of the host machine is printed out for debugging purposes if any agents are missing, late, or have crashed.
- Missing = agent never seen
- Late = agent not present at start of game but shows up later
- Crash = agent seen but no longer present at end of game