Tournament rules- Tournament results are determined using software written by the organizers. Published results are final. The current player rating is not official and may differ from the published final results.
- Each participant in the tournament can have a single account. If a participant is identified as the manager of several accounts, and despite the fact that these accounts are registered to other people, the offender will be disqualified.
- Participants (or their programs) who violate the spirit of the rules and sport (probably without violating the official text of the rules) are barred from participating in the tournament, without the possibility of appeal. In particular: memory scanning, intentional loss and behavior change depending on the opponent's name are prohibited.
- Write to files is prohibited. Allowed to read from the files you send to participate. Files are located in the current directory.
- The use of multiple processes or threads is prohibited.
- Any attempt to disrupt the normal operation of the tournament software or servers will lead to the immediate involvement of law enforcement officers. Our principle is to always prosecute violators.
- The organizer reserves the right to change these rules at any time, without prior notice to the participants of the tournament.
Tournament scheduleThe 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.
MovesAfter 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:
- Sending game status to participants.
- Receive teams from participants.
- The execution of the phases of the course and update the game card.
- 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 courseAfter 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:
- moving
- battle
- destruction
- gathering
- birth (new ants)
A player leaves the battle if:- he has no more ants
- bot caused an execution error
- bot did not meet the time limit on the course
- the bot tried to make actions that the tournament management may consider to be not safe, and the bot will be disqualified.
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 standingsAt 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.
- each player starts with one point for each anthill
- 2 points are awarded for the destruction of someone else's anthill
- for the loss of their anthills is taken one point
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 TerminationTo 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
- the anthill should not be destroyed
- the anthill should be free of ants
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.
- At the beginning of the game in the field of view of each bot will be a few pieces of food (from two to five).
- Initial food is placed on the map randomly, while symmetrically.
- Each card has a food appearance parameter unknown to players. The amount of food appearing is divided without a balance by the number of players and appears symmetrically.
- The places of appearance of food on the map are defined by symmetrical patterns, patterns are moved when food appears. When the patterns end, they shuffle.
- Before reusing a template, the queue of templates must end. This means that after collecting food in one field, it may take a long time before food reappears there. Except when this template was the last in a set of templates and after mixing it got to the top of the queue.
- Sometimes the place of appearance of food is equally removed from two bots. This means a shortened queue of food appearance patterns. This is taken into account by the food appearance parameter.
- The appearance of food is reduced on the mirror-symmetric cards near the axis of symmetry. Do not expect it to appear there often.
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:
- Enough to know only the neighboring ants
- And the server easily copes with this task.
The outcome of the battle:
- Funny!
- Means the destruction of enemies without loss on your part
- Allows you to protect the anthill with several ants causing huge losses to the enemy (Sparta!)
- Allows you to build unprecedented military formations
- It becomes really not predictable with the participation of three or more opponents. (maybe give them the opportunity to kill each other?)
- You do not care when you seek to finish the game by destroying all the anthills.
- This is the fun part of the game!
There is a more accurate specification of the battle.Bot InputDescription 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"
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
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
BlockingMovement 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.
CollisionsIf 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.OtherIn 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.