Tournament

In this stage, you will develop a whole game playing agent to compete with the agent from other participants.

Installation

  1. If you have already cloned the repo, you can pull the main or tournament branch from the Github repo.

  2. If you have not cloned the repo. Please finish the Installation instruction.

Launch Tournament Locally

You can run a game of two baseline agents playing against each other.

$ python run.py -e tournament --example baseline -n 1 -r

The default opponent will always be the Baseline Agent. So to launch a game against it

$ python run.py -e tournament -n 1 -r

To change the opponent to an arbitrary agent you can use the following script

from air_hockey_challenge.framework.evaluate_tournament import run_tournament
from air_hockey_agent.agent_builder import build_agent

from pathlib import Path
import yaml

# Default path for agent_config have to adjust to your own path. Assumes script is in 2023-challenge/file.py
agent_config_1_path = Path(__file__).parent.joinpath("air_hockey_agent/agent_config.yml")

# For example use the same config for both agents
agent_config_2_path = agent_config_1_path

with open(agent_config_1_path) as stream:
    agent_config_1 = yaml.safe_load(stream)

with open(agent_config_2_path) as stream:
    agent_config_2 = yaml.safe_load(stream)

# Let the agent play against itself. To let 2 different agents play against each other replace the argument of
# build_agent_2 and agent_2_kwargs with the proper function and settings for the different agent
run_tournament(build_agent_1=build_agent, build_agent_2=build_agent, agent_2_kwargs=agent_config_2, **agent_config_1)

Evaluation

The competition between two agents will be evaluated through a TCP communication between each docker image. A RemoteTournamentAgentWrapper distribute observation and collect the action from each agent through TCP/IP communication.

To test if the docker communication works properly with your agent. You can run

$ python scripts/docker_tournament_test.py

This script will build a docker image of the current codebase and start a tournament with this image.

Preparation Phase

  1. The preparation phase begins on August 14th and ends on October 6th.

  2. During the preparation phase, you can submit your solution to the server and evaluate it with the baseline agent.

  3. In this phase, we organize a Friendship Game for participants. Participants can set the friendship_game: True in agent_config.yml. We will automatically set a game if two participants are available. A video demo will be published on the website. No dataset for friendship games will be available.

Rules

  1. Each game will last 15 minutes (45000 steps). Every 500 steps is treat as one episode. The whole game contains 90 episodes.

  2. At the beginning of the game, the puck is initialized at a randomly at one side of the table.

  3. If the puck is stays on the side of Agent-A for more than 15s, i.e., \(x_{puck} \leq 1.36\), Agent-A will collect one FOUL. The agent will lose one score for every three FOULS. The puck will be initialize randomly on the side of Agent-B where the agent does not collect FOUL.

  4. If the puck is stuck in the middle (not reachable by both robots), i.e., \(1.36 < x_{puck} < 1.66\) and \(|v_{x,puck}| < 0.05\), the puck will be reset.

  5. If Agent-A scores a goal the puck will be initialized on the side of Agent-B in the next round.

  6. The deployability score is evaluated per episode, i.e., every 500 steps. The total deployability score is the sum of the episodes.

  7. The agent wins the game if the agent collects more points and the deployable score are less than 1.5 times the total number of episodes (i.e. 1.5 * 45000 / 500 = 135).