The PyRat tournament

Duration2h30 + preparation

Presentation & objectives

After the final exam, there is a dedicated time slot for a PyRat tournament.

In this tournament, you will have to design a PyRat program to challenge an opponent. Through this course, you will learn how to gradually reach this objective. Then, the faster to get pieces of cheese wins the game!

This is an optional event, only made for you to have fun and challenge your friends. Therefore, there is no evaluation associated.

Snapshot of the 2019-2020 PyRat tournament.

Here are a few videos that were taken since the PyRat course was created! Some are more “commercial” than others, but that’s a cool overview of the atmosphere during the tournament, as well as a glimpse on the various versions of the game!

Tournament organization

Two phases

Unfortunately, we won’t have time to get everyone to compete in the final tournament. Consequently, we will proceed in the form of pools in which all players will compete against each other, in two winning rounds. In each pool, we will keep the best program, i.e., the one with the highest number of points in the pool matches (1 point for a win, 0.5 for a tie). In the event of a tie after all matches, we will consider as best program the program with lower total execution time.

Once the winners of the pools have been determined (16 AIs), the tournament itself will take place in an amphitheater. The matches will be randomly determined.

The tournament tree. Only one program will reach the top!

The winner of the tournament will win a trophy, and their AI will serve as the final boss for next year’s students!

The prize for the tournament winners.

PyRat parameters

The following options will be used to create the PyRat games:

  • maze_width: 25.
  • maze_height: 20.
  • cell_percentage: 80.0.
  • wall_percentage: 60.0.
  • mud_percentage: 20.0.
  • mud_range: [4, 9].
  • nb_cheese: 41.
  • preprocessing_time: 3.0.
  • turn_time: 0.1.

Here is the game script we will use to run the tournament.

Important

Note that players will be instantiated without any arguments. Thus, make sure to set default values in your constructor if you use additional arguments. In particular, if you want a custom name (and not the name of the class) for your program, you should state it as follows:

def __init__ ( self:     Self,
               *args:    Any,
               **kwargs: Any
             ) ->        Self:

    # Inherit from parent class
    super().__init__(name="Your name here", *args, **kwargs)

How to participate?

In order to participate, you have to submit your program on Moodle, at least 3 days before the date of the tournament.

Your program should be placed in an achive named team_name.zip, where team_name is the name of your team. This archive should be structured as follows:

team_name.zip
|
|_ games
|  |  # Put a simple game script here that starts a game with your program
|  |  # This will allow us to check that it works
|  |_ # Take inspiration from the visualize_XXX.ipynb game scripts with the tournament settings
|
|_ players
|  |  # Put your player here
|  |  # This directory should only contain your player file that will participate in the tournament
|  |_ # If you need functions defined in other players, please put them in utils
|
|_ utils
|  |_ # Put your additional codes here (if any)
|
|_ data
|  |_ # Put your other files here (if any)
|
|_ README_TOURNAMENT.md

You can find the file README_TOURNAMENT.md at this link. Please replace everything in <...>.

Important

Please make sure that your program works, and that you respect the files organization above.

Also, make sure that all needed files are available for your program to work. We will have many matches to do for the pools, so we cannot lose too much time asking for missing files.