FLAK SERVER, Version 0.1
-------------------------

  Install this using `Combat = Replace *flak-server' in PHost.

  Command line options:
   -h     help screen
   -v     version number
   -V     increase verbosity
           -V     brief status message (each individual fight)
           -VV    configuration, progress report how FLAK is building groups
           -VVV   group contents, results
   -a     pretend that all ships have 'Kill' and no combat-level alliances
          exist. This option is strictly for testing only (or for end-fights)
   -r     read-only. Do not modify the game universe (but write out flakX.dat
          files)
   -m     display all messages on screen, prefixed with 'Subspace Message:'
   -Z     generate one big battle with all ships (ragnarok, end-fight)

  High-level overview over what happens:
  - build groups for each X,Y location
  - on each location, build fleets according to FLAK rules
  - compute attack lists for all units
  - remove all passive objects (units which are not a possible target
    for anyone). Even if the original fight had many units, it might
    happen that we decide noone wants to fight here.
  - finish the setup by computing positions and configuration
  - run the fight
  - all fights are gathered in `flak.hst'
  - finally, `flak.hst' is split up into `flakX.dat' files


FLAK VIEWER, Version 0.1
-------------------------

  The FLAK VIEWER is a hacked up PlayVCR and can fully replace it:
  besides FLAK combat, it can also play combat from Tim's host and
  PHost.

  There are currently two visualisation modes:
  - in ISO 3D Mode, ships are displayed graphically, using an
    isometric projection. This needs wpvcr.dll for the pictures.
  - in flat mode, each fleet is represented by a circle. In addition,
    there's a 10000m grid.

  On the right, there is a list with the participating fleets. Each of
  the fleet entries can be "unfolded" to show the units in the fleet.

  Each ship can be equipped with a status display: a white frame
  displays the shields, and slowly disappears as the shields go down. 
  A green/yellow/red bar represents damage. In addition, two stat
  panels can be displayed. Clicking a ship toggles the status display
  and optionally puts the ship into a stat panel.

  List keys:
    up/down           scroll
    space             on fleet: display/hide units in fleet
                      on ship: toggle status display (and open stat
                      display, if less than two already open)
    1,2               show current ship in left/right stat display
  Playback keys:
    tab               switch between visualisation modes
    right             play/pause
    b/f               back/forward 1s
    ctrl-left/right   back/forward 20s
    alt-left/right    go to beginning/end
    +/-               zoom in/out (flat mode only)
    shift-arrows      pan (flat mode only)


Building
---------

  - configure as usual (./configure)
  - get the CVS version of the PDK and build it
  - edit the Makefile and change the 'PDK' variable to point to the PDK
  - 'make flak-server' to build the server
  - 'make flak-viewer' to build the viewer (this needs SDL)

  Yes I know the build system needs a cleanup.


On the code
------------

  This is not the most clean thing. For one, we're mixing C and C++. 
  For another, flak.cc uses many public members because I'm too lazy
  to sort it out. Essentially, FlakBattle needs to access everything.

  In flak.cc, most objects have `data' and `status'. We assume that
  all `data' remains constant, the variable stuff is in `status'. This
  is useful for things like rewinding a fight. This cannot completely
  be enforced, since some information is not known until after the
  fight (ship: ending status; fleet: we first need to set up fleets,
  the do GC, than assign positions).

  In pdk-host.cc, we store all battles in a disk file to save RAM. The
  temporary file is in no way protected against "hacking", and hell
  will break loose if you modify it inbetween.

  While the server runs atop the PDK, the viewer runs atop the PCC II
  kernel. This makes differences in access to specs and pconfig. 
  Therefore, we compile most modules twice, once with
    #define FLAK_USE_PDK
  and once without. flak/flak-port.h contains the glue code.


Language Support
-----------------

  The client supports internationalisation the same way PlayVCR does,
  namely through a file resource/LANGUAGE.lang, where LANGUAGE is a
  two-character code (e.g. 'es' for Spanish).

  The server supports the PHost configuration option 'Language', and
  reads its translation data from resource/flak_LANGUAGE.lang. Only
  player messages are translated. Host messages always are English.

  The directory layout differs depending on your operating system.

  - Windows: "resource" is a subdirectory of the directory containing
    flak-viewer.exe / flak-server.exe. E.g., if you have
    "c:\plan1\flak\flak-viewer.exe", you also have
    "c:\plan1\flak\resource".

  - Unix: if the directory you built this in still exists, we use its
    "resource" subdirectory (config option HAVE_INPLACE_ENABLED). 
    Otherwise, it is a subdirectory of $prefix/share/planets. For
    example, if you build in /home/joe/pcc2, and install to
    /usr/local, we look first for /home/joe/pcc2/resource, then for
    /usr/local/share/planets/resource.


Todo list
---------

  . if a planet gets destroyed (!= captured), someone should get PBPs

  . the viewer can still be improved a lot


