VGA-planets Result 3.X format

This document contains the data-structure of a VGA-planets result-file version 3.x. I don't know about earlier versions, these are probably simpler.

Guarantee

No guarantee whatsoever is given about these specifications; I can't be 100% sure that what I'm writing here is complete. It is, however, correct in all cases I have seen.

Important numbers

Tim Wisseman has written VGA-planets in Basic. Therefore, the first byte of any file or any count is 1. In Pascal and C this is 0. A long is 4 bytes and a short 2.

Specifications

The first part of a result contains eight internal file-pointers. That is, longs refering to places in the result itself. These are, in order of appearance (both in the result and this document): Next 8 parts of this document explain a part of the result each.

Ships (SHIP??.DAT)

Simply contains the file SHIP??.DAT The length is computed as follows: The first short is the number of ships in the result (see also A. M. van den Bos's header file from PlanMap II). Each ship has a length of 107 bytes, thus (2 + #ships * 107) is the total length.

Targets (TARGET??.DAT)

As ships, length of a target is 34 bytes. Host under DOS produces at most 50 targets, UNPACK can not handle more. But, for instance, VPUTIL, VPUNPACK and kunpack can (Note: PHost can produce more than 50 targets!)

Planets (PDATA??.DAT)

As ships, length of a planet is 85 bytes.

Bases (BDATA??.DAT)

As ships, length of a base is 156 bytes.

Messages (MDATA??.DAT)

The most difficult part. First the number of messages (a short), then #messages times a message-header, containing a pointer to the message (long) and the size of that message (short, maximum 15*(40+1)=615). The messages can then be found behind those pointers. Usually (I never saw results NOT doing this...) the contents of all messages are in a direct sequence without interleaving bytes. There ARE empty bytes between the headers and the contents, though! Thus:
  1. number of messages
  2. headers (#messgaes*6 bytes)
  3. some trash
  4. contents of messages
Note: The order in MDAT??.DAT is the same, the main difference is the amount of trash, which you'd like as small as possible. Thus the pointers in the header ARE CHANGED!!!

ShipXY (SHIPXY??.DAT)

Always 500 ship's (X,Y), each of 8 bytes.

Gen (GEN??.DAT)

Contains the interesting things like scores, password, turnnumber and some more. Exactly 157 bytes, from which some are cut out in the result!!!
The result is:
  1. 128 interesting bytes (in the right place)
  2. 3 checksums (should be re-computed)
  3. 4 trailing interesting bytes
which is toghether 144 bytes.
GEN??.DAT is:
  1. 128 interesting bytes
  2. an empty byte
  3. 3 checksums
  4. 12 empty bytes (can store new password here)
  5. 4 trailing interesting bytes
which is together 157 bytes!
The first 128 bytes contain:
  1. time stamp (18 bytes)
  2. scores per race: #planets, #bases, #capitals, #freighters (11*4 shorts)
  3. racenumber (short)
  4. encrypted password (10 bytes)
  5. sequence found at the end of each *.DIS-file (10 bytes)
The checksums (longs) are of ships, planets respectively bases. The 2 trailing shorts are turnnumber and hostid.

VCR's (VCR??.DAT)

As ships, length of a VCR is 100 bytes.

General note

There are empty sequences of bytes all in between when HOST.EXE generates a result. These are overcome by pointers within the results. This consumes more disk-space then needed (I've seen several useless kilobytes in a result...) When following the pointers, all information will be found.
This page has been made by Kero van Gelder.
Last update 2nd of August 1996