Index of /fun/voidwars/pirate-port

      Name                    Last modified      Size  Description
Parent Directory - simulator.pl 2005-01-03 14:14 6.7K log 2005-01-03 14:24 66K data.planets 2005-01-03 07:22 37K data.anomalies 2005-01-03 06:47 13K PiratePort.pm 2005-01-03 14:24 13K
A ship is spawned at the home planet. It gets assigned a random DNA
based on the best /m/ ships so far (which are seeded randomly) with a
few random mutations. DNA strings are /n/ one-byte instructions long.

Every tick, the next batch of instructions for each living ship is
executed for that ship. When a ship reaches health zero or fuel zero
or colonises a planet it dies and is scored and removed. High scorers
displace the "highest /m/ ships" ships used for creating new ships.

Pirate ships auto-refuel above stars, and have enough fuel when
created to reach a nearby star with half a tank.

Multiple ships can be running at once.

An instruction is a byte long, as follows:

     +--------------------------------- Negation flag
     |     +--------------------------- Condition
     |     |
     |     |       +------------------- Argument
     |     |       |
     |     |       |
     |     |       |         +--------- Action
     |    _|_     _|_     ___|___
     |   /   \   /   \   /       \
   +-+-+---+---+---+---+---+---+---+
   | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
   +---+---+---+---+---+---+---+---+
  MSB                             LSB

...where:

 * The Negation flag indicates whether the Condition should be taken
   on face value or negated.

 * The Condition is one of the following:

    0 0  Position contains (planetoid)
    0 1  Position contains (fleet)
    1 0  Health greater than
    1 1  Fuel greater than

 * The Argument depends on the Condition.

   For "Position contains (planetoid)":

    0 0  Nothing
    0 1  Star
    1 0  Neutral planet
    1 1  Enemy planet or space station

   For "Position contains (fleet)":

    0 0  Only us
    0 1  Only friendly
    1 0  Enemy ships
    1 1  Enemy ships with overwhelming fire power

   For "Health greater than" and "Fuel greater than":

    0 0  0%
    0 1  25%
    1 0  50%
    1 1  75%

 * The Action is one of the following:

    0 0 0  Stay on square
    0 0 1  Colonise, Bombard, Build, or other ship-specific action
    0 1 0  Jump back 20 instructions (rounding up to nearest multiple of 10)
    0 1 1  Jump next 20 instructions (rounding up to nearest multiple of 10)
    1 0 0  Up
    1 0 1  Right
    1 1 0  Left
    1 1 1  Down

Instructions are executed until an action other than jumping around
the instruction code is executed, with a maximum of 10*/n/ executed
instructions per tick per ship.

Merging of DNA is done as follows: The first bit is taken from the
best DNA in the top /m/. There's an /x/% chance that the next bit will
come from the same DNA. If it doesn't, then a DNA strand is chosen at
random (uniform distribution) from the top /m/, and the next bit comes
from that DNA. The proces is repeated until all /n/ bytes have been
picked. A fraction /p/ of the bits are then randomly inverted.

This generally ensures that successful strands of DNA stay together
while still having intermixing.

Each ship has:

 * Its VW ID.
 * Its DNA.
 * Its current instruction pointer.
 * A running count of the total number of ticks executed with that ship.
 * A running count of the number of squares travelled.
 * A running count of the number of ships, planets, and stations destroyed.
 * A running count of the number of things built.
 * A running count of the number of planets colonised.

The score of a ship is based on the five running counts kept for each
ship as well as the distance from the start point to its death point.


Voidwars will have to provide:
 * A way to determine what kills, etc, a ship has made.