Welcome GuestLogin

Programming Games Wiki







Modified on 2011/12/30 17:32 by Categorized as Uncategorized
Planet Wars is a game played between two programs which attempt to take control of all planets in a simulated solar system.

Table of Contents [Hide/Show]

The objective is to create a computer program that plays the game of Planet Wars as intelligently as possible.

Planet Wars is a strategy game set in outer space. The objective is to take over all the planets on the map, or altenatively eliminate all of your opponents ships.

Planet Wars is inspired by Galcon, a popular iPhone and desktop strategy game. A huge thank-you goes out to the creator of Galcon, Phil Hassey, for letting us use his idea. You can play Galcon online against other people for free here. The Galcon homepage is here. If you love Galcon as much as we do, then consider buying it!

The game is turn-based. Your bot is a function that takes a list of planets and a list of fleets, and outputs some orders. Each planet has the following fields/properties:

  • X-coordinate
  • Y-coordinate
  • Owner's PlayerID
  • Number of Ships
  • Growth Rate

Neutral planets have a PlayerID of zero, planets owned by your bot have a PlayerID of 1, and planets owned by the enemy have a PlayerID of 2. The number of ships and the growth rate are both whole numbers. Each turn, the number of ships on non-neutral planets increases according to the growth rate for that planet.

Fleets are the colored numbers that fly between planets. When a fleet arrives at its destination planet, one of two things can happen. If the destination planet belongs to your bot, the ships from the fleet land on the planet as reinforcements. If your bot does not own the destination planet, the ships from the fleet are subtracted from the ships that currently occupy the planet. If the result is less than zero, then your bot gains control of the planet. If the result is exactly zero, then control of the planet does not change hands. A fleet has the following properties:

  • Owner's PlayerID
  • Number of Ships
  • Source PlanetID
  • Destination PlanetID
  • Total Trip Length
  • Number of turns remaining until arrival

Your bot can issue as many orders as it wants during one turn. Each order specifies a source planet, a destination planet, and a number of ships. Once the order is executed, the given number of ships leave the source planet, to go towards the destination planet. Your bot issues orders using the IssueOrder(src, dest, num_ships) function. See the starter packages for an example that you can use as a starting point.

The game ends when only one player remains, or if the game goes past a certain number of turns.


External Links