next up previous contents
Next: Examples Up: Stats manual for Stats Previous: Contents   Contents



Stats is a program that was born out of the desire to store historical data for a game of vgaplanets by extracting some critical data from the game's data files. When you have access to the data why not generate some nice reports from it, etc. Today stats combines the building of this historical data, extensive reporting facilities, unpack of rst files, and what randmax can do in one program.

Stats has two major modes of operation; the command line described in chapter 3 , and the configuration files described in chapter 4. We will start off with some details concerning the inner working of stats which might help to understand some surprising output from the program.

Inner workings

Stats goes through the following steps in the program:

  1. Set defaults.
  2. Analyse command line options.
  3. Parse master configuration file. This implies that the command line settings are overruled by the master configuration file.
  4. Load game data (truehull, engspec, xyplan.dat, etc.).
  5. For all players do:
    1. Unpack rst file.
    2. Load player data.
    3. Print command line reports.
    4. Load payer command file. While parsing the lines in the configuration file lines the following is done:
      1. Parameter settings are applied immediately.
      2. Reports are generated immediately.
      3. Planetary commands are added to the command list.
    5. Prioritise commands.
    6. For all objects (planets, ships, etc.) the commands are executed. More specific commands at the top of the list overwrite the more generic ones at the end.
      1. Turn specific commands.
      2. Object specific commands.
      3. Object class commands.
      4. General commands.
      5. Universal commands.
    7. When necessary write player data to disk

The position of the commands in the order of execution implies it is not possible to generate reports to reflect the situation after commands have been executed. The items in the reports are printed in a fixed order. It is not possible to change this order. Summarised: the order in which everything is executed is built into the program, the order in which command line options are passed is irrelevant.

Calculation accuracy

All formulas used in this application are based on phost, and match to the dot.


This sections deals with interoperatability of stats with the many tools that exist around planets. The developers have most experiance with the following set of tools; phost, planets.exe, vpa, tkf, exploremap. All results and predictions are tuned to match exactly those of phost.

Only as far as it is compatable with phost. No problems expected.
Files are accepted but unpacked as with unpack.exe. (The dos way.) The change option does not take the addittional checksums of winplan into account. In short Winplan cannot be used together with stats, although stats can work with winplan.rst files, and registration.
Is fully supported. In case of missing xyplan.dat stats looks for xyplan<playerid>.dat files in the player data directory. In case of multiple player files these files are merged. When a xyplan.dat is present in the Base directory xyplan<playerid>.dat are not read.
Stats does not do anything with this file.
Switches settable in the master commandfile are fully supported in all functions they are relevant. All other switches are assumed to be at their default. Bigtargets is supported on top of this.
alternative ship lists
Should be supported without a problem. The short ship type might result in double naming. See for further details. (Some alt list have a config file for cloak and gravitonic, but this config file is not used).
Alternative universe maps
Are fully supported. Explore map games should stay within 1 - 5000 range with the planet coordinates, since planets outside this range are not merged into the planposition structures.
-sanity assumes the mission.ini file coming with phost for mission numbers. Same goes for the -cbB options. -m accepts all types of files.
Fully compatable, just don't run a datafile changing option while having the client accessing the datafiles.
dos planets
Same as vpa above.
unregistered players
Stats assumes you are registered. Stay away from starbase techlevel raising build commands when you are not. Stats will not complain, but your host will.

next up previous contents
Next: Examples Up: Stats manual for Stats Previous: Contents   Contents
Reinout van Rees 2003-06-23