VCR Data Format

From PlanetsWiki

Jump to: navigation, search

[edit] Overview

For each Space Combat during the Host run, a VCR data structure is created, in which the events from the combat are stored. These are stored in the Result file (.rst) alongside with the other information.
The Planets4 client can extract the space combat information into VCR files (.vcr). These files can be read by the VCR application which allows the combat to be played and watched.

For developing other combat visualizers the data format has to be known and so it is presented here.

[edit] File Header

Each VCR file has to start with the following header:

  1. The string "VGA Planets VCR 4.0 File: Copyright Tim Wisseman 1997" is written
  2. Nothing written till position (byte) 90
  3. At position 90 a zero (0) is written
  4. At position ? the Game ID is written (4 bytes)
  5. Next 4 bytes containing the race identifier. It is a long variable. If a race takes part in combat the corresponding bit number (0 to 29) to the race player number (1 to 30) is set to 1.
  6. Next 4 Bytes (a long) contain the turn number.
  7. Next 44 bytes contain the game name (as string)
  8. Next 4 bytes (long) contain the file version. It is 100 atm.
  9. Next there's a loop (1 to 30) that contains race ID and the version numbers.
    1. Next 4 bytes contain the ID of the race (as long)
    2. Next 4 bytes contain the version of the race pack (as long)
  10. Next there's a loop (1 to 40) that contains ships ID and version numbers.
    1. Next 4 bytes contain the ID of the ship (as long)
    2. Next 4 bytes contain the version of the ship pack (as long)
  11. Next there's a loop over all player numbers (1 to 30) with the race pack
    1. Next 4 bytes contain the race pack number (as long)
  12. Next 44 bytes contain the game host name (as string)
  13. Next 4 bytes contain the start position (current position +80) (as long)
  14. Next 4 bytes contain the x-Coordinate the combat takes place (as long)
  15. Next 4 bytes contain the y-Coordinate the combat takes place (as long)

[edit] Data format

Upon course changes or fire events the necessary information (current position or fire target etc.) is written to the VCR-file.

Legend:

A       = angle
PD      = polar distance
DeltaA  = change of angle
DeltaPD = change of polar distance
cID     = combat ID number of object
img     = picture number
vector  = 1 to 8 (Direction of marker)
First number is stored as byte


1. Draw Fixed Object on map

A PD img timerInterval cID label marker Bla pNum
single single int int int string[40] int byte byte

2. Draw new active object on map

A PD img vector DeltaA DeltaPD cID clabel marker pNum Bla
single single int byte single single int string[40] int byte byte
** Marker **
1 = planet
2 = Ship
3 = Base
4 = Fighter
5 = Pod

3. Clock Increment

4. End of VCR

5. Many Clock Increments

Bopp clockCount
Byte Byte

6. Repeat

Bopp count
Byte Byte

20. Update active object

A PD vector DeltaA DeltaPD cID
single single byte single single int

21. Delete active object

cID
int

22. Update vector

deltaA deltaPD vector cID
single single byte int

23. ManeuveringLost

cID
int

70. Ion Weapon Fire

cID1 cID2 hit
Int Int Byte

71. Ion Weapon Fire With Point Defense

cID1 cID2 Hit PDFlavor PDHit
Int Int Byte Byte Byte

72. Base Fire Laser AA

cID1 cID2 hit
Int Int Byte

73. Base Fire Laser AA Hit

cIDB1 cIDB2
Byte Byte

74. Base Fire Laser AA Miss

cIDB1 cIDB2
Byte Byte

75. Fire Ion Weapon Hit

cIDB1 cIDB2
Byte Byte

76. Fire Ion Weapon Miss

cIDB1 cIDB2
Byte Byte

77. Ship Large weapon fire from Obj 1 to Obj 2

cIDB1 cIDB2 Flag
Byte Byte Byte
  Flag
   Bits 0-4 WFlavor
   Bits 5-6 Fdelay
   Bit  7   Hit

78. Ship Small weapon fire from Obj 1 to Obj 2

cIDB1 cIDB2 Flag
Byte Byte Byte
  Flag
   Bits 0-4 WFlavor
   Bits 5-6 Fdelay
   Bit  7   Hit

79. Ship Large Weapon / Point Defense KO attempt Obj 1 to Obj 2

cIDB1 cIDB2 Flag1 Flag2
Byte Byte Byte Byte
 Flag1
   Bits 0-4 WeaponFlavor
   Bits 5-6 Fdelay
   Bit  7   Hit
  Flag2
   Bits 0-4 PDFlavor
   Bit  7   PDHit

80. Ship Point Defense weapon fire from Obj 1 to Obj 2

cIDB1 cIDB2 flag
byte byte Byte
  Flag
   Bits 0-4 WFlavor
   Bit  7   Hit

81. Fighter Count

cIDB ifB1 ifB2 ifB3
byte byte byte byte

82. Fire Fighter Beam Weapon Hit

cIDB1 cIDB2
byte byte

83. Fire Fighter Beam Weapon Miss

cIDB1 cIDB2
byte byte

84. Fire Fighter Missile Weapon Hit

cIDB1 cIDB2
byte byte

85. Fire Fighter Missile Weapon Miss

cIDB1 cIDB2
byte byte

86. Ship Armor

cIDB Armor
Byte Byte

87. Ship Shield Power

cIDB Shield
byte Byte

88. Decoy

cIDB
Byte

89. Fire ION With Point Defense

cIDB1 cIDB2 Flag1
Byte Byte Byte
  Flag1
   Bits 0-4 PDFlavor
   Bit  6   PdHIT
   Bit  7   Hit

90. Assault Pod Contact

cID tID
int int

91. Assault Pod End Contact

cID tID
int int

92. Hull Damage (mini)

cIDB HullDamage
byte Byte

100. Explosion at object

cID Power
int byte

101. Explode and delete

cID Power
int byte

102. Ship Large weapon fire from Obj 1 to Obj 2

cID1 cID2 WFlavor FDelay hit
Int Int Byte Byte Byte

103. Ship Small weapon fire from Obj 1 to Obj 2

cID1 cID2 WFlavor FDelay hit
Int Int Byte Byte Byte

104. Ship Large Weapon / Point Defense KO attempt Obj 1 to Obj 2

cID1 cID2 WFlavor FDelay Hit PDFlavor PDHit
Int Int Byte Byte Byte Byte Byte

105. Ship PD weapon fire from Obj 1 to Obj 2

cID1 cID2 WFlavor FDelay hit
Int Int Byte Byte Byte

106. Ship Hull Damage

cID HullDamage
Int Byte

107. Ship Disabled

cID
int

108. On Fire

cID TimeFrame
Int Int

109. Ship Shield Power

cID Shield
Int Byte

110. Ship Armor

cID Armor
Int Byte

111. Decoy

cID
Int

112. Ship dead in space (No crew)

cID
Int

113. Fighter Count

cID if1 if2 if3
int int int int

120. Super Weapon Fire

cID1 cID2 WFlavor FDelay hit
Int Int Byte Byte Byte

121. Nemesis Torpedo Explosion

cID
Int

131. Fighter Beam Weapon (Hit)

cID1 cID2
Int Int

132. Fighter Beam Weapon (Miss)

cID1 cID2
Int Int

133. Fighter Missile Weapon (Hit)

cID1 cID2
Int Int

134. Fighter Missile Weapon (Miss)

cID1 cID2
Int Int

150. Weapon Name

WeaponClass WFlavor name
byte byte 40 X Byte

151. Play Wave File

Wav Number
INT

152. Special 4 Long

data1 data2 data3 data4
Long Long Long Long

153. Special 4 Int

data1 data2 data3 data4
Int Int Int Int

154. Special 2 Int

data1 data2
Int Int

155. Special String 40

Data1 Data2 sData bla
long long string 40 X Byte Byte
Personal tools