To distinguish PHost and HOST VCR files, PHost files contain a magic number. In HOST, the first word of a battle record is the initial random seed (ranging from 1..111) and the second one is zero. In PHost, the first word is the seed (full 64k allowed), and the sum of the first and second word is 48879 (mod 65536). This is called the PHost signature and is present on at least the first battle in a file.

In PHost 1.x and 2.x, all VCR files that contain combat recordings will also contain a configuration record. The exact format is documented in the PHost 1.x/2.x documentation and in the File Format List. Programs should not try to interpret this record as an actual battle. This configuration record is not sent by PHost 3.x and 4.x.

Because VPA misidentifies vcrX.dat files with only one battle, there is a program Corr that corrects the situation by adding a dummy battle. You probably want to detect that, too.

  • If the first battle does not bear the PHost signature, it is Host combat.
  • If the file contains only one battle, it is PHost 3.
  • If the file contains two battles, and the owner fields of battle 2 are zero, user has used Corr. The file contains one PHost 3 battle, and one dummy record.
  • If the file contains two or more battles, and the last battle contains the PHost signature:
    If the BattleType field is one or zero, it is a vcr.hst file. You can't tell the version from those.
    If the BattleType field is larger than one, it is a player-side vcrX.dat file from PHost 2.
  • Everything else is PHost 3.

► Note: Note that "PHost 2" actually means "PHost 1.x or 2.x", and "PHost 3" means "PHost 3.x or later".

For upward compatibility, PHost 4 reports a set of capabilities which a player program needs to replay the VCR. The capability flags are stored in the first record, in the field commonly called "planet temperature" which is not used otherwise by PHost.

  • bit 15 is set to indicate the field is valid.
  • bits 14..3 are clear. If they are not clear, the recording needs a feature not yet known and can't be played.
  • bit 2 is set if the game is configured in a way that it is played differently between PHost 4.0k and later, and previous versions.
  • bit 1 is set if the recording needs Experience support.
  • bit 0 is set if the recording needs support for Death Ray weapons or ShieldKillScaling.

If bit 15 is clear, treat this word as all-zero. When none of bits 0 to 14 are set, the recording is 100% compatible to PHost 3.x.

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.