📜 ⬆️ ⬇️

Google AI Challenge Rules Fall 2011

Tournament rules


Tournament schedule
The current stage at which the reception of programs from the participants takes place will last up to 0 hours 59 minutes Monday December 19, 2011 (Moscow time). Then the final part of the tournament will begin. The duration of the final part is not defined at the moment, but it is expected that it will last less than one week. Upon its completion, the winner will be announced and the final results of the tournament will be published.

The specification of the game "Ants".
Turn structure:
Training:
Each bot receives initial information about the game, which includes the size of the map, the limit on the number of moves and the time limits for preparation and for each move. After the bot has processed this data, it must inform the system about readiness ('ready'). After all the participants will announce the readiness of the game begins.

Moves
After all the bots have finished preparing and will indicate the readiness of the game engine (hereinafter referred to as the server), the following actions are performed cyclically:
  1. Sending game status to participants.
  2. Receive teams from participants.
  3. The execution of the phases of the course and update the game card.
  4. Check the end game conditions.

Each card has a limit on the number of moves. The organizers reserve the right to change this restriction during the tournament.
The above actions are one turn. The moves are repeated until reaching the limit, after which the game is interrupted.
')
Phases of the course
After receiving all orders from the players, the server updates the state of the game, to move to the next turn. The execution of the stroke takes place in 5 phases:

A player leaves the battle if:
When an error or timeout occurs, the participant’s ants remain motionless on the map, but continue to fight and collide with other ants. Other participants are not informed about the elimination of the player.
If a bot causes an error or timeout, then no orders received from it will be executed this turn.

Tournament standings
At the end of the game, participants line up in places based on the points they gained in this game. With the same number of points, players take the same place. The difference in points is not taken into account in the tournament standings. In the offset is only a place.

Distribution points:
The goal of the game is to collect the maximum number of points that are awarded for the attack and defense of anthills.
This means that if you lost all your anthills and did not destroy a single alien, you will end the battle with 0 points.

If the game ends with the only remaining player, and there are intact anthills on the map, then 2 bonus points for each anthill are added to the remaining, and the owners of these anthills are taken away by one point. Bots that have dropped out of battle due to an error or a timeout are equated to destroyed players.

Early Termination
To reduce insignificant games or continuations of games, the rules of early termination of the game are introduced.

Ants do not collect food.
If the server decides that the bots are not able to collect food, the game is interrupted. It is believed that this is the initial or very stupid bots. An interruption occurs if 90% of the food remains on the map for 150 turns.

Ants do not destroy anthills.
The interruption occurs when one player dominates, which does not destroy other players. It is believed that the bot probably will not lose leadership, he just is not trained enough to destroy anthills. The game is interrupted when the total number of ants per player is 90% of the amount of food for 150 turns.

Only one player left.
When the only live bot remains (the others are destroyed, an error or timeout has occurred), the game is interrupted. The remaining points are awarded bonus points, others are deducted accordingly.

The result will not change.
If there are no players with anthills who can change their place as a result of the game, the game is interrupted. Even if players are left without anthills, which can improve their place, they are not counted. For each remaining player with an anthill, the maximum possible points are calculated, which he can score (if he destroys all enemy anthills) and compares with the minimum value that other players can score (if they lose all their anthills). If the difference allows the player to change position or break a draw result, the game continues. If there are no bots suitable for this condition, then the game is interrupted.
(For example. There are 4 players in the game. If bot A destroys the anthills of bots B and C, the points will be distributed like this: A = 5, B = 0, C = 0, D = 1. will be distributed like this: A = 4, D = 3, B = 0, C = 0, so D has no opportunity to rise above the second place and the game is interrupted.)
(Another example. There are 4 players in the game. If bot A has destroyed the anthill of bot B, and B still has ants, he may try to score points. But if bot A destroys the anthill of bot C, then the opportunity to increase the place of bot B because Even if bot B destroys the bot's nest A, the points will be distributed like this: A = 4, B = 2, C = 0, D = 0.)

The limit on the number of moves has been reached.
For each card, the maximum number of moves is given. It is reported to each bot. By his achievement the game ends. The organizers expect to adjust the number of moves so that 90% - 95% of all games end this way.

The birth of ants.

After collecting the food enters the anthill, where a new ant is born. Each piece of food generates one ant. Ants are born only in anthills. Wherein

Each turn in an anthill can be born only one ant. If the food is not enough for the birth of ants in all anthills, then the anthills are selected in turn.
This means that if you take away the ant immediately after birth, the birth of ants will be evenly distributed between the anthills.
A player can influence the appearance or non-appearance of new ants in an anthill leaving an ant there.

The appearance of food.
All cards are symmetrical. This means that the initial position of each bot is similar to the initial positions of other bots. Food appears on the cards symmetrically.
The best way to collect a lot of food is to explore the map and occupy a large area.

The outcome of the battle.

Ants located at a distance of attack from each other kill each other (sometimes).
If in the battle of your ants more than the ants of another player, you survive (usually).
The outcome of the battle is locally predetermined:
The outcome of the battle:There is a more accurate specification of the battle.

Bot Input
Description of parameters:
At the beginning of the game, each bot receives initial parameters about the game. Their list begins with a separate line containing “turn 0”. After which in separate lines are the parameters in the format
  

The type of value is determined by the parameter name. At the moment, all parameters, except player_seed, are 32-bit signed integers. player_seed 64-bit signed integer. If a bot receives an unfamiliar parameter, it should treat it as a string and not try to parse it.
The parameter set may be expanded in the future, but if the parameter is listed, it will not be deleted.
At the moment, the following parameters are transmitted to bots:
 "loadtime" #   ,   "turntime" #   ,   "rows" #    "cols" #    "turns" #      "viewradius2" #    "attackradius2" #    "spawnradius2" #    "player_seed" #      ,     

All parameters are a string representation of numbers.
When all parameters have been transferred to the bot, “ready” will be transferred on a separate line, after which you can run preparatory procedures that must be kept within the allotted time (the loadtime parameter).

Information about the course:
Each turn begins with one of the following lines.
 turn turnNo end 

“End” means the end of the game. The winner of the game receives information about the final state of the game, if he wants to use it for local tests.
If the game is over, 2 lines are sent to bots with information about the number of participants and their final points in the form:
 players noPlayers score p1Score ... pnScore 


When you continue the game, you are transferred information about the map, which your ants see in the following format:
 w row col #    f row col #    h row col owner #     a row col owner #      d row col owner #      

The end of the transfer of information is marked with a separate line containing “go”.
You are always considered player number 0. The first enemy that you see will be indicated by a unit, the second two, and so on. Thus, you do not know the exact number of participants in the game.

Information about fields with water is transmitted only when your ants see it for the first time (to reduce the load).

Information about food, ants and anthills will be transmitted every turn, when they are in sight of your ants. Food and anthills do not move. If food is collected or an anthill is destroyed beyond your sight, you will not be informed about it. When your ant sees this field again, you will not get any information about the absence of food or anthill.

Sample input:

Below is an example of the data that Player A will receive for the state presented:
 turn 0 loadtime 3000 turntime 1000 rows 20 cols 20 turns 500 viewradius2 55 attackradius2 5 spawnradius2 1 player_seed 42 ready turn 1 f 6 5 w 7 6 a 7 9 1 a 10 8 0 a 10 9 0 h 7 12 1 go end players 2 score 1 0 f 6 5 d 7 8 1 a 9 8 0 a 9 9 0 go 

Now we give the data that player B receives, starting with the first move.
 turn 1 f 6 5 w 7 6 a 7 9 0 a 10 8 1 a 10 9 1 go end players 2 score 1 0 go 


Fog of war.
At the beginning of the game, participants are told the square of the distance at which the ants see. At the moment, the parameter is 55, which gives an ant the radius of view of approximately 7.4.
Each turn you are transmitted only the information about the map that your live ants see.

Distance.
Distances are used for radii of sight, attack, and birth. We used the squares of these quantities to avoid working with floating point numbers and use integers.
Distances obey Euclidean geometry, i.e. the square of the hypotenuse is equal to the sum of the squares of the legs. For two points a and b, the distance is calculated as:

The distance between points a and b does not exceed r if

Output.
After the bot has received the initial parameters and finished preparing for the game, it informs the server about the readiness by sending the string “go”.
Each bot can make a move with any number of its ants in one of the directions: north ('N'), east ('E'), south ('S'), or west ('W') to be executed, if the destination field does not contain water. Each move must be transmitted on a separate line in the following format:
 o row col direction #     

The numbering of rows and columns begins with 0, and the directions are transmitted as characters 'N', 'E', 'S' or 'W'. At the end of each move, the bot sends the string “go” to inform the server that it has finished giving orders.

Example

Below is an example of commands from player A for the game in the picture:
 go o 10 8 N o 10 9 N go 


An example of teams from player B for the game in the picture:
 go o 7 9 W go 


Blocking
Movement is blocked only by water. Ants can see and attack through the water. If the bot gives the ant command to move into the water, this move is considered to be erroneous and is ignored.
Food can also block movement. This happens when food appears right in front of the ant. Do not move this ant and it will collect food next turn.

Collisions
If two ants go to the same cage. They are dying. But, your ant can be with an enemy on a single cell, if your ant has just been born (It looks like your anthill will be destroyed soon!)

Next comes the description of the map format and the description of the map generator, which is not directly related to the writing of the bot, so it will be omitted.

Other
In order to make sure that the participants see the real behavior of their bot in battles with other players, we urge the players not to share the code that implements the behavior of the bot before the reception of the code from the participants is closed.
On the other hand, we strongly encourage participants to discuss strategic ideas and general questions that will help participants improve their bots or facilitate their testing and debugging.

Source: https://habr.com/ru/post/130979/


All Articles