Updating a car position is done by the following calculation:
check(ax, ay) vx' = vx + ax vy' = vy + ay check(vx', vy') x' = x + vx' y' = y + vy' check(x', y')
The next position is connected to the previous one with a trace vector:
line(x, y, x', y')
The checks verify the acceleration, velocity and trace crossing constraints. If any of the checks fail or the new vector intersects with a previous trace vector then the player loses. Otherwise the new vector is added to the global list of traces and should not be crossed.
Initial condition (x0, y0, vx0, vy0) is sent to the players as part of the protocol.
syntax | sent to passive players? | description |
---|---|---|
game len | yes | Game status: len battles are left before your next battle in this game. If len is 0, you need to play in this battle, if negative, you have already played in this game (or in other words in this hour), so you shouldn't expect to play more battles until the next game (next hour). |
turn whose | no | Sent when a new turn started, before car states are updated. whose is you or enemy. |
end winner | no | Sent when a battle ends. winner has the same syntax as whose in turn, or tie on tie. |
envseg x1 y1 x2 y2 | no | A line segment of the environment |
carpos whose x y | no | Current position of a car. whose is the same as in message turn. Position of enemy car is sent only before the first turn. |
carvel whose vx vy | no | Initial velocity of a car. whose is the same as in message turn. Velocity of enemy car is sent only before the first turn. |
snapshot start numlines | no | Sending a base64 encoded JPEG of the current standing. numlines lines are following, then a snapshot end message. Note: JPEG properties and image characteristics are expected to be different between the simulator and the actual device. Line width and color may change on the physical device during the contest. |
snapshot end | no | End of snapshot. |
syntax | description |
---|---|
acc ax ay | Set acceleration control for the next turn. |
Players can connect the simulator any time, and the server will allocate a new AI instance to the player and a battle starts immediately. Each team can have only one connection at a time, upon a new connection, any existing connection of the team is closed. The server logs the outcome of simulated battles; when task H starts, this information will be used.
Players should be connected to the server all the time. There is one game per hour. Each game consists at most 15 battles. The server will pair up two players (of all 30 possible players) for a battle; those two players are marked active until the end of the battle. All other players are passive. Some messages are sent only to active players, other messages are sent to all players. Commands can be sent only by the two active players.
The 24 hours period is split into a soft and a hard fight period. In the soft period, the hardware is not running and teams are playing against an AI in the simulator, all teams in parallel. The simulator is available during the whole contest, but beating the AI in the sim matters more in the soft period. Whenever a team wins over the AI, we save a time stamp. At the beginning of the hard period we determine the initial order-of-strength of teams by those time stamps: teams won against the AI earlier are stronger; strongest team is the first on the list. Those teams who could not defeat the AI during the soft period are randomly placed at the end of the list.
The soft period takes 2 hours, the hard period takes 22 hours.
Once we have an order-of-strength list, hard round starts. In the hard round, before each game we pair up teams according to their place on the order-of-strength list and teams fight eachothers. There are 15 pairs in a game, thus each player plays 1 battle in a game. In that 15 battles, all 30 teams participate exactly once. A game takes slightly less than one hour. If team A beats team B, and team A was lower on the order-of-strength list, we swap the two teams before the next game. This does not affect pairing for the current game but for the next game. On a tie, teams are swapped and neither team gets any score.
At the end, it is not the order-of-strength list that directly matters. Instead, any time a team wins in the hard period, the team earns score proportional to the strength (at that time) of the team that lost the match. Beating the strongest team, 1st placed on the order-of-strength list, is worth 120 points while defeating the weakest team (last on the list) is worth only 4 points. The scale is linear. (So the best team can approximately earn 2500 points during the 22 battles).
Pairing for each game happens as follows, R being the serial number of the current game, first game is 0:
In other words: teams winning more will slowly climb up the list; sometimes a team need to win to keep its place. Being higher on the list lets the team play games for higher scores against more skilled team AIs.
In the first two hours we will publish example images with appropriate lighting conditions. Please check the announcement channel.