Summary of new rules

You can now use missiles, which have their own engines and can be moved around with your commands. Use them wisely!

See the updated statement for details.

  The Goal

Win. Don't die.

Shoot at your enemy with bullets and missiles, watch out for their weapons. Be careful - the forcefield, which was used to trap your enemy, seems to also be keeping you inside. Keep away from the edge - crash with the forcefield will destroy your ship!

  Rules

The game is played on a map 1700 units wide (along x axis) and 1080 units high (along y axis). Point (0,0) is in the upper left corner.


You and your opponent each own one starship, which has 10 health points.


The ship has an infinite number of bullets.


Now your weaponry includes also 8 missiles.


The bullet can be shot every two turns. It detonates automatically in the first tick, when its distance to the closest enemy unit, that was in its damage radius, starts to increase. Ending its lifetime (after 7 turns), or going out of health points (a bullet has its own 10 health points) also detonates the bullet.

Bullet's damage radius is 120, the damage caused at the bullet's position is 10 and decreases linearly with the distance to it, reaching 0 at damage radius. The bullet is shot with the given velocities along each axis (in relation to the ship), with the resultant velocity being clipped to be at most 100.


Missiles can be shot each turn, as long as you have one. They are detonated with a command or when they lose all their health points (they start having 7 of them).

Their damage radius is 200, and the damage done is 15 in the center of explosion, decreasing in the same manner as bullet's. They have their own engines, so they can be moved around just as the spaceship.


The ships start at symmetrical positions, close to the center of the board.

Both ships and missiles move with the given acceleration along each axis, with the resultant acceleration (interpreted as a vector) being clipped to length 10 for the ship, 30 for a missile.


Hitting the edge of the board immediately sets the unit's (bullet's, missile's or ship's) health to 0, causing it to die/detonate.


Keep in mind that your own weapons are as harmful to you as your opponent's!

Each game turn consists of 5 ticks, so that the units' positions are updated 5 times a turn.

Each turn takes exactly 1 time unit, so that every tick takes 1/5 of a time unit - for example, a ship moving with the speed of 10 will travel 2 units of space every tick, so 10 every turn.

The player whose ship reaches 0 health points first - loses.

The game lasts up to 100 turns. If both players survive that long, it's a draw.

Stats summary:

unit number of damage damage radius health lifetime max acceleration
ship 1 - - 10 - 10
bullet 10 120 10 7 -
missile 8 15 200 7 - 30


Note that there is a debug mode available in the game settings!

Acknowledgment

This contribution was developed for the Programming Programming Games course, University of Wrocław, 2021.

Authored by Michał Opanowicz (@MichalOp), Katarzyna Miernikiewicz (@Manwi23), Agnieszka Pawicka (@Agn).

Supervised by Jakub Kowalski (@aCat).

  Game Input

Input for one game turn
Line 1: One integer units for the number of units on the board.
Next units lines: Two integers unit_id, faction, being the unit's unique ID and faction (1 for the player, -1 for the opponent), one char type being Ship, Bullet or Missile, six floats health, position_x, position_y, velocity_x, velocity_y, gun_cooldown for the unit's health points left, its position on each axis and velocity on each axis, followed by gun cooldown, which indicates the number of turns till the next bullet can be shot if this unit is a ship, -1 otherwise.
Note that there is a new Missile input!

Output for one game turn
n lines, where n is the number of ships and missiles actively controlled by the player, with each line being a command for unit with unit_id in the form: unit_id | A x y | F x y , having one or more commands for unit_id separated by |. For a ship S can be used instead of unit_id. x,y are both dot-formatted doubles - if given with more precision than 2 decimal places, then rounded up to at most 2 decimal places.

Available commands:
For a ship:
  • [A | ACCELERATE] ax ay - put acceleration ax on x-axis, ay on y-axis (with instant effect)
  • [F | FIRE] vx vy - fire a bullet with velocity vx on x-axis, vy on y-axis (relative to ship)
  • [M | MISSILE] ax ay - fire a missile with acceleration ax on x-axis, ay on y-axis, with velocity equal to the current ship's velocity (this missile will be receiving orders starting from the next turn)
  • [P | PRINT] message - print a message - it can also be a multiline one, with lines split with an escaped newline symbol ("\\n")
  • [W | WAIT] - do nothing
For a missile:
  • [A | ACCELERATE] ax ay - put acceleration ax on x-axis, ay on y-axis (with instant effect)
  • [D | DETONATE] - detonate
  • [W | WAIT] - do nothing


Example outputs:

You only own a ship. You want to put acceleration (0, -4) on your ship, which has id 23, and at the same time fire a bullet with velocity (relavite to the ship) (2, 1) and a new missile with acceleration (1, 1).
23 | A 0 -4 | F 2 1 | M 1 1

You own a ship (id 17) and two missiles (ids 9 and 11). You want the ship to wait and both missiles to detonate.
S | W
9 | D
11 | D

You own a ship (id 7) and a missile (id 18). You want to put acceleration (1, 1) on the ship, (-1, 2) on the missile, and print "General Kenobi" as a debug information.
7 | A 1 1 | P General Kenobi
18 | A -1 2
Constraints
Response time for first turn ≤ 1000ms
Response time for one turn ≤ 100ms