Droid Wars

Droid Wars will be featured at the Tcl'08 Conference in Manassas. The engine is currently under development by hypnotoad.

Droid Wars is intended to be a combination of Carrier Command, Chess and TclRobots. While originally envisioned as a 3d canvas app, it was far easier to implement (and a bit more fun too) as a 2d canvas app.

The engine is available for download at: http://www.etoyoc.com/droidwarz/

The basics of the game are:

  • Play is on a giant frictionless surface in 2d space
  • The actual battle is fought by the robotic lieutenants of the player, which are programmed in Tcl script
  • Each player has a mother ship with 100 hitpoints and 16 drones (an armed drone is also known as a strike craft)
  • A drone has 5 hit points, and can be equipped with either a cobalt bomb, a recon pod, or a laser cannon.

Visibility:

The game field is 800km by 800km (roughly 1km per pixel). Mother ships can see 100km. Normal drones can see 10km. Recon-Pod-equipped drones can see 200km. All of a player's assets communicate in real time to build a comprehensive picture of the theater.

Lasers:

To fire a laser an object needs to announce a lock on an intended target. This process calculates the probability of a hit depending on the orientation of the shooter and the distance to the target, and the relative velocity of the target and shooter. A successful laser hit does 1 hitpoint of damage. Lasers on strike craft are fired from the nose in the direction in which the craft is pointed.

Each mother ship has a pair of laser turrets in addition to its compliment of strike craft. These are assumed to be on a 360-degree swivel, and are independently targeted.

Cobalt Bombs:

Cobalt bombs are high-explosive ordnance. They are delivered by strike craft, and when "dropped" continue along the trajectory of the delivery vehicle. They may be detonated remotely, or on a timed fuse. Cobalt bombs cause blast damage that is 50 hitpoints divided by the square of the distance (in km) from ground zero. A cobalt bomb will only detonate on command, and will not explode if either it or its delivery vehicle is destroyed.

Physics:

Each object in the game obeys a rough approximation of the Newtonian laws of motion. There is no friction, so an object that starts in motion will remain in motion until it is acted upon by another force.

Refitting:

A strike craft can dock with the mother ship to be repaired and refitted.

Game Mechanics:

The game engine uses a discrete time simulation, with time divided into individual steps divided into phases. The first phase is the physics phase, where objects move to their new location based on their momentum from their last step.

Next is the sensor phase, where the game server calculates who can see whom.

Following the sensor phase is the reaction phase. This is the phase in which all of the player's code operates, issuing new orders to propulsion, announcing target locks, detonating fuses, etc.

The reaction phase is followed by the combat phase. Announced target locks are acted on, in random order, and damage is applied. (If a shooter is destroyed, its damage never occurs in the game.)

Game Implementation:

Each player gets his/her own safe interpreter. The player's AI speaks to the game through a call to the "gameturn" procedure. Gameturn takes in two dicts, assets, and sitrep. Assets contains a list of all of the active assets the player has deployed, as seen by the physics model. sitrep contains a list of all of the objects the players assets have detected with their sensors, including classification, position, and velocity. The result of the "gameturn" procedure is a list of commands for the player's assets:

Further details are on the game's home page.

Version 2 (in development)

In conjunction with the release of the Sean's TOAD paper for the 2009 Tcl Conference, Droid wars is being rewritten in TclOO, utilizing and agent based architecture. The game mechanics are also being revamped. Capital ships other than the Carrier will be introduced. The cobalt bomb is being replaced with a guided missile that can also be programmed.