We have created a video game that is designed to be played by a small python program, rather than a human. Conference attendees can participate in a tournament where they (either alone or in a team) each submit a bot that will play the game, and at the end of the conference, we will have a tournament session where everyone can come and watch our strange creations play against each other (either brilliantly or it may all go wrong!).
The topic of the game is a sci-fi war on a foreign planet, set far in the future. We do not condone war and violence, we just want to make a fun event for EuroPython participants.
- Register your team: fill in the form at https://forms.gle/v2s9oHZ1xLTUo5ov7 (30 spots available)
- You will be given a private GH repository in the
- Read the game rules below and start working on your bot
- Ask questions on the Discord forum
- Creating alliances is authorized (betrayals are also allowed!)
- Once your bot is ready, make sure you copy it into the
mainbranch of the repo you were given
- Deadline is 15:00 on Friday July 21st
- Tournament will be 15:30 - 16:45 on Friday July 21st in the Open Space area
Get started with:
conda create -n <NAME> -c conda-forge python=3.10
conda activate <NAME>
git clone email@example.com:europython2023gametournament/supremacy.git
python -m pip install .
|Time = 2min
|Time = 4min
- Mine resources to build an army
- Destroy enemy bases and eliminate other players
- All participants play on the map at the same time
- Each round lasts 8 minutes
- The tournament will consist of 8 rounds of 8 minutes
- The map is auto-generated every round
- It has periodic boundary conditions (for example when a vehicle arrives at the right edge of the map, it will re-appear at the left edge)
- The map size will scale with the number of players (more players = larger map)
- Coordinate system: lower left corner:
(x=0, y=0), upper right corner:
- Everyone starts with 1 base, housing 1 mine
- Every timestep, each mine will extract
crystal = 2 * number_of_mines
- Crystal is used to build mines and vehicles
- Mines too close to other bases compete for resources:
crystal = 2 * number_of_mines / number_of_bases_inside_square_of_80px
- Bases that contain mines that are competing with others will have a “C” label on them:
- Whenever two or more vehicles or bases from opposing teams come within 5px from each other, they will fight
- During each time step, every object hits all the others with its attack force, and it takes damage from all other objects
|Can turn into base
- Mine cost doubles for every new mine on a given base (first mine=1000, second=2000, third=4000, etc…)
- Base has
health = 100, mine has
health = 50(both have
- Vehicles move at
speed * dt(
dt = 1/15s)
- A ship can be turned into a new base, by calling
- A conversion to base will only work if there is land in the immediate vicinity
- A player is eliminated when all his/her bases have been destroyed
- If a player is eliminated, all his/her vehicles disappear instantly
- +1 point if you destroy a base
- If a player gets eliminated, they receive a number of points equal to the number of players that were eliminated before them
- At the end of the round, every player still alive gets a number of points equal to the number of eliminated players
- To play the game, you will have to create a Python program.
- It should contain a class named
PlayerAIand that class should have a method named
- Every time step, the
runmethod will be called, and it will be inside that function that you should control your vehicles, decide what to build, etc...
- You are provided with a
template_ai.pyto give you an example.
Look at the comments in the
template_ai.py for details on what information is
available to you at every time step and what methods can be called.
game_mapis one of the arguments the
runfunction will receive.
- It is a Numpy array that automatically gets filled when your vehicles or bases visit that region of the map.
-1means no info.
- Any visit makes anything in that part of the map permanently visible.
- This is basically what defines which enemy bases and vehicles you get in your info every time step.
There are 3 ways you can speed up your development.
high_contrast = True to see the land borders better and competing
areas for mines:
Waiting for things to develop can be time consuming. You can artificially
increase mine yield using
crystal_boost=5 (or any number you want, although
behavior is untested beyond 10).
While the game is running, you can hit
P on the keyboard. This will pause the
game. You can edit your AI code. When the game resumes (hit
P again), it will
reload your AI module.