Get started with:
conda create -n <NAME> -c conda-forge python=3.10
conda activate <NAME>
git clone https://github.com/nvaytet/supremacy.git
cd supremacy/
python -m pip install -e .
cd tests/
python test.py
Send a link to your repository or copy/paste your code at https://forms.gle/Ah3LvH9wvdxLH8xg8
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:(x=nx, y=ny)
- 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
Tank ![]() |
Ship ![]() |
Jet ![]() |
|
---|---|---|---|
Speed | 10 | 5 | 20 |
Attack | 20 | 10 | 30 |
Health | 50 | 200 | 50 |
Cost | 500 | 2000 | 4000 |
Can travel | On land | On sea | Anywhere |
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 hashealth = 50
(both have0
attack) - Vehicles move at
speed * dt
(dt = 1/15s
) - A ship can be turned into a new base, by calling
convert_to_base()
- 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
PlayerAI
and that class should have a method namedrun
. - Every time step, the
run
method 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.py
to 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.
- The
game_map
is one of the arguments therun
function will receive. - It is a Numpy array that automatically gets filled when your vehicles or bases visit that region of the map.
1
means land,0
means sea,-1
means 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.
Activate 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.