Droid Warz

Artifact Content

Artifact 6569b87fc7309e2862d1f07b98c809c620f7ef3b:

Wiki page [Bot API] by hypnotoad 2012-11-13 00:53:40.
D 2012-11-13T00:53:40.843
L Bot\sAPI
P 3726d4f03c3112af9b2caa4bf85f42aa16d67703
U hypnotoad
W 2867
<b>DW Bot API</b>

The Droid Warz Bot API is designed to balance simplicity with flexibility. Rather than a fully 3d environment, the game simplifies space combat to two dimensions. All calls are lists sent back and forth from the game's master interpreter to safe interpreters containing the AI code.

The operations run within a self-contained safe interpreter. The game makes a call to a procedure "gameturn". gameturn accepts three arguments:

team - The name of the team (and the object ID of the carrier)
assets - A dict describing the assets in theater for the team
targets - A dict describing what the team's assets can see through their sensors
The gameturn procedure, in turn, returns a list of commands the AI would like for it's assets to execute. There is a limited dictionary of commands the player can request:

launch droneid heading_info
dock droneid
bomb_release droneid
bomb_detonate bombid
maneuver heading_info
fire shooterid targetid
heading_info is a dict containing a heading (in radians) and/or a thrust from -1.0 to 1.0. (Yes, it is assumed that all craft have either thrust reversers or full retro-rockets.) There are also provisions for other data to be passed to the model through this mechanism, but for now, only heading and thrust are accepted. At launch time, the player may specify what weapon to arm the craft with.

Example: {thrust 0.1 heading 3.14}

launch releases a drone from the carrier, and starts it along at a thrust and heading.

Example: launch PLAYER1.1 {thrust 1.0 heading 0 weapon laser}

dock orders a craft to attempt to land on the carrier. If the command is ordered when a craft is more than 2km from a carrier, this command is quietly ignored.

Example: dock PLAYER1.1

bomb_release order a drone to release it's bomb. A bomb object is then created, starting at the drone's position, and continuing along the drone's velocity at time of launch. The drone's mass is reduced to 0.5 mass, and it's weapon is afterward reported as {} (empty).

If a craft is not equipped with a bomb, this command is quietly ignored.

Example: bomb_release PLAYER1.1

bomb_detonate order a bomb to detonate. A bomb produces shock damage to all targets (including the owner's!) according to the formula: 1000/distance^2

Command to detonate another team's bombs are quietly ignored.

Example: self_destruct BOMB.10

maneuver orders a drone or carrier to change either it's heading or thrust. Commands to maneuver another player's assets, or unguided assets like bombs are quietly ignored. If not mocked.

Example: maneuver PLAYER.1 {thrust 1.0 heading 3.14}

fire orders a laser equipped drone or carrier to fire at a target. Calls for other assets to fire are ignored. (NOTE: the system has no compunction about a player shooting up his/her own assets.)

Example: fire PLAYER1.1 PLAYER2
Z 0b4889ee8cd72fb5bfdfa4fb054ca125