Warlight AI Challenge

Based on the online game Warlight

This game is an adaptation from the online game Warlight, the game mechanics are exactly the same. As such the Warlight introduction video explains the Warlight AI Challenge rule set quite well. Roughly the first half of the video applies to this competition.

We encourage any player not familiar with the Warlight rules and tactics to familiarise yourself with the game by playing a few PvP games at Warlight.

The start of the game

At the start of the game, the engine will pick 12 regions on the map, 2 from each continent, which can be used by your and the opponent bot as starting locations. Each bot has to return a subset of 6 regions ordered by preference. The engine then assigns 3 regions to each bot according to preference. Note: if both bots have equal preference for a certain region, the region is assigned randomly.

The structure of a game round

The rounds of the game consist of 2 parts. In the first part, the bots can place armies on their regions. At the start of the round, the bots are rewarded a certain amount of armies (see Armies per turn). They can place any number of these armies on any region they own. If a bot doesn't place all the armies he's got on the map, they will be lost. So it's always wise to put them all on.

In the second part, the bots can do attacks and transfers. The bot chooses a region to attack/transfer from, a region to attack/transfer to and how much armies will be used. If the region the bot chooses to go to is owned by himself, it is automatically a transfer. The amount of armies will be directly transferred between the chosen regions. If the region the bot chooses to go to is owned by the other player or neutral, the move is an attack. The region will be taken over if the attack is a success and the remaining armies from the attack will be placed on that region. If the attack fails, both regions will lose some armies and nothing further happens (see Combat for the rules on attacks).

1 army must always remain on your region after an attack/transfer, so the maximum number of armies you can use is the number of armies on the region minus 1. The bot can choose any number of his owned regions to attack/transfer with, as long as they have more than 1 army on them. A region can attack/transfer multiple times in a round, but never to the same region twice. A region that you have taken over this round cannot attack/transfer yet and has to wait until the next round. Also, any armies that have been transferred can't be used that round for attacking/transferring again (the one army that has to stay behind still has to stay there, even if more armies have been transferred to that country that round).

The amount of armies per turn

The bots will always be rewarded at least 5 armies at the start of each turn. If a bot manages to completely own a continent at the start of a turn, bonus armies will be rewarded. The amount of bonus armies vary per continent. You can look this up in the legend by the lower left corner of the game map. Here is also a quick overview.
Africa3
Asia7
Australia2
Europe5
North America5
South America2

Combat mechanics

Combat is relatively simple. The amount chosen by the bot in his attack move are the attacking armies, all the armies on the region that is attacked are the defending armies. Each attacking army has 60% chance to destroy 1 defending army. So if there are 10 attacking armies, they will kill on average 6 defending armies.

For each defending army however, there is a 70% chance that it will destroy 1 attacking army. So that's 7 on average with 10 attacking armies. The defending region has the advantage, so make sure you attack with enough armies!

If all the defending armies are destroyed, the remaining attacking armies are transferred to the defending region and the region is now owned by the attacking player. If not all the defending armies are destroyed or if all of the attacking armies are destroyed, the attack has failed. Both regions lose the calculated amount of armies and the regions still belong to their original owners.

Fog of war

The game is played with fog of war. This means that the bots won't be able to see beyond the neighbouring regions of the regions they own. As a result of this and the way the regions on the map are connected, a bot cannot ever see if the other bot fully owns a continent.

Who moves First?

In this game, the order in which the attack and transfer moves are played per round can have a big impact on the game. For placing armies this is not the case, so player 1 will always place all his armies, then player 2. How are the attack/transfer moves ordered then? Well they are ordered in the same way the bot returns them to the engine. The engine will then randomly decide which player will execute his move first.

For example if the engine chooses bot1 to move first in the first and second move and bot2 to move first in the third move, the ordering will look like this:

move1 bot1 move1 bot2 move2 bot1 move2 bot2 move3 bot2 move3 bot1

Winning

If one bot destroys all armies of the other bot, it has won. If this doesn't happen in 100 rounds, it's a draw.

Technical details

The current timeout we have set for this competition is 2000ms or 2 seconds. The engine will give this each time it asks your bot for a move. If your bot does not respond before the timeout, no moves will be done. Bots that do not output anything at all, a.k.a. fail their input test, can not be placed in the ranked matches.

When uploading your bot, you can upload a .zip, .rar or .tar.gz file. Make sure you either put the source files directly in the compressed folder, or in their respective class folders. So do not put a folder with the source files in the compressed folder, or your bot won't compile.

For JavaScript, Perl, and PHP bots: include __main__ in a comment in your main file, so our compiler can recognize it.

Below a list of the Region and SuperRegion IDs with their names as you can see in the game:

1Alaska
2Northwest Territory
3Greenland
4Alberta
5Ontario
6Quebec
7Western United States
8Eastern United States
9Central America
10Venezuela
11Peru
12Brazil
13Argentina
14Iceland
15Great Britain
16Scandinavia
17Ukraine
18Western Europe
19Northern Europe
20Southern Europe
21North Africa
22Egypt
23East Africa
24Congo
25South Africa
26Madagascar
27Ural
28Siberia
29Yakutsk
30Kamchatka
31Irkutsk
32Kazakhstan
33China
34Mongolia
35Japan
36Middle East
37India
38Siam
39Indonesia
40New Guinea
41Western Australia
42Eastern Australia
1North America
2South America
3Europe
4Africa
5Asia
6Australia

Game viewer hotkeys

hotkeys-headsupomaha