Ā ĀŚÄÄæŚÄÄæ ĀÄĿ ŚÄÄæĀÄÄæĀÄÄæŚÄĀÄæŚÄÄætm ŚÄÄæ ĄæŚŁ³ ÄæĆÄÄ´ ĆÄÄŁ³ ĆÄÄ´³ ³ĆÄ ³ ĄÄÄæ Ä´ ĄŁ ĄÄÄŁĮ Į Į ĮÄÄŁĮ ĮĮ ĄĮÄÄŁ Į ĄÄÄŁ ĄÄÄŁ File Formats and more Covered Programs: ž VGA Planets (the original: Planets, Maketurn, Unpack, Host), by Tim Wisseman ž WinPlanets Shareware (ditto) ž Planets Command Center (PCC, a general client program), by Streu [that's me!] ž PView 2.0, by Frank (comfortable, universal starcharts) ž AFSim 1.2, by Sean Martens (battle simulation) ž VPA, by Alex Ivlev (client program) ž PHost (the portable Host) Last Change: 03 Jan 1998 - more WinPlan info - WPVCR.DLL updated ANNOTATIONS - This file is for programmers only ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ Contents ÄÄÄÄÄÄÄÄÄ This file contains descriptions of the file formats of the strategic game VGA Planets(tm) 3.00 by Tim Wisseman, and of 3rd party utility programs for that game. The file is meant as a help to programmers of new utility programs. I don't know where the programmers of existing utilities got their information from as I didn't found a file comparable to this one yet. I started from nothing with my hex editor and a debugger. If you don't want to do this too, here are my results. I just can't stand if there are files on my hard disk and I don't know how they are built up. But also technically interested Planets players may find one or another useful information. Some may be far from being fair... Planets is cheat-proof, but only to 99% as it's doc says. Well, we have the freedom of information. As stated above, this list was created with the famous `Trial and Error' method and doesn't claim to be complete and always correct. Entries marked with [V] were verified with Wisseman's PD programs (for example, VPCPLAY) and the Host documentation. Really unknown information is marked with ?, other work correctly in my daily use. I do not guarrantee for anything. If you mess up your game with this information, it's your fault. If you get an advantage using this information, your'e a .... (sorry, I don't know vulgar English words ;-) and should be kicked out of the Echo Cluster. Anyway, do you want to play your turn with a Hex editor? Basics ÄÄÄÄÄÄÄ All original VGA Planets(tm) programs are written in BASIC. This has an effect on the used data types: - Character strings are, if not stated otherwise, stored in BASIC format. This means, they are padded with spaces and stored without a length byte. - Most fields are WORDs and DWORDs. BASIC doesn't allow BYTE fields in files. All values are signed integers. - Pointers into files assume the file start having offset 1 in most cases, not 0 as usual. This list uses the standard conventions (files start at offset 0, offsets are given in decimal here). To use a pointer from a Planets file, you need to code something like "Seek(Pointer-1)" in Assembler/C/Pascal. - If there's an array with 500 elements and the description talks about "the ship", use a Ship-ID as index into the array. This is similar for Planets and Starbases, and for arrays with 11 elements and races. Another note on character strings: As many American programmers, Tim didn't do much to support foreign characters (high ASCII), such as accented or umlauted ones. If you use these characters, there are 3 possibilities: - The characters simply disappear (if the nice selfmade font is used in PLANETS.EXE, see description of TECH.MOF). - The characters are replaced with spaces (Host Logs and -Messages, Passwords) - The string is invalid and gets assigned a default value (Fcodes with ASCII characters over 80h are set to AAA). Only in player messages, special characters are guaranteed to be kept intact, unless they crash PLANETS.EXE before - see note at the MDATAx.DAT description. Be careful. See also MESS35x.DAT for a fourth possibility what can happen with foreign characters. The most 3rd party programs I have used allow the high ASCII chars. This file also uses these. More specifically, it uses Code Page 437. For people who want to convert this file automagically into a hypertext format (Norton Guides, ...), a hint: New chapters always start with a line of text underlined with ASCII 205 ('Ķ'). New topics start with a heading of up to 2 lines which is underlined with ASCII 196 ('Ä'). If you do not want to do this yourself, I already have a program that makes a NG file and one that makes HTML. Of course, I assume you are familiar with common programmer's terminology... The "Sum of Characters" means the sum of the ASCII codes, not some string or whatever. DIV stands for integer division (17 DIV 5 = 3). This is the English version of the file. I started this thing in German and quickly translated it into English when some people on Usenet wanted it. If you think, my English is not good enough, please complain - my e-mail address is at the end of the file. At least my spellchecker doesn't find more typos. Stefan Member of Security Team Special Thanks ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - to Franki, for PView, and decoding RESOURCE.PLN - to Andy, for all those nice VCRs and his FIZZ.BIN. - to Westi, since I have decoded most of these files in _his_ CS lessons. - to Tim Wisseman who likes the number 13. This has made decoding many files much easier to me. Sections of this file ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - PLAYER DATA contains information on files a player has on his hard disk while playing his turn. - TRN FILE and RST FILE are separate sections, since these are the most complicated file formats of VGA Planets. - HOST DATA describes the files the Wisseman Host uses to keep universe data and other information. - FIXED DATA means files that are normally constant throughout a game, such as the xxxSPEC files or name lists. - The CHECKSUMS section lists all checksums you may need to update if you write a player-side program. - A 3rd PARTY section contains file formats of various 3rd party programs (not by Tim Wisseman). If you wish your file format to be added here, feel free to contact me. - Finally, there is a somewhat complete description of what happens while a HOST RUN. PLAYER DATA ĶĶĶĶĶĶĶĶĶĶĶĶ The 'x' in names match the player number (1 to 11). For a description of the signatures see GENx.DAT. For starships, planets and starbases there is a .DAT and a .DIS file. The .DAT file contains changes made by the player. The .DIS contains the information as extracted from the RST file (.DIS = `discarded'???). MAKETURN looks for differences between these and makes a TRN file. Note about Windows Planets ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The WinPlan Shareware version is technically nearly identical with the DOS Planets client. It creates DOS TRNs and unpacks only DOS RSTs. The Windows resource files (wpvcr.dll, BMP/WAV directory) are used anyway, as are version 3.5 message files (mess35x.dat). BDATAx.DAT - New Base Data [V] BDATAx.DIS - Old Base Data [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of Starbases +2 n BYTEs Records, 156 bytes each +m 10 BYTEs BDATAx.DAT: Signature 2 BDATAx.DIS: Signature 1 One Starbase Record: +0 WORD Base ID (=Id of planet with this base) +2 WORD Owner +4 WORD Defense +6 WORD Damage +8 WORD Engine Tech Level +10 WORD Hulls Tech Level +12 WORD Weapon Tech Level +14 WORD Torpedo Tech Level +16 9 WORDs Engines in storage (for the 9 engines from ENGSPEC.DAT) +34 20 WORDs Hulls in Storage. Each race has up to 20 possible hulls it can build. In TRUEHULL.DAT these 20 positions are assigned a hull from HULLSPEC.DAT. This is the assignment used for the 20 hulls that may be in storage: the first position here is the number of hulls of the first type in TRUEHULL this starbase has, and so n. That's the reason why the hull is destroyed when recycling a ship, while weapons and engines are kept. Not always the hull may be stored in this array. +74 10 WORDs Beam Weapons in storage +94 10 WORDs Torpedo Launchers in storage +114 10 WORDs Torpedoes in storage +134 WORD Number of fighters (<=60) +136 WORD Ship to be recycled/repaired +138 WORD What to do with that ship: 0 Nothing 1 Fix 2 Recycle +140 WORD Mission (Primary Order) 1 Refuel 2 Max Defense 3 Load Torps onto ships 4 Unload freighters 5 Repair base 6 Force a surrender +142 WORD Type of ship to build (Hull, index into the array[20] with the hulls in storage) +144 WORD Engine Type +146 WORD Beam Type +148 WORD Beam Count +150 WORD Torpedo Type +152 WORD Torpedo Count +154 WORD According to CPLAYER.BAS a fighter count. When building a ship this value is effectively ignored, that's why PLANETS.EXE puts zero in here. This field should always be zero, after the build as many fighters as shown here are destroyed... CONTROL.DAT - Checksums CONTRLx.DAT - WINPLAN - Checksums ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ DOS Planets: CONTROL.DAT exists once per directory, even for more than one player. Then it contains information for all players who need to play in the same game. WINPLAN: For each player a single CONTRLx.DAT file. +0 500 DWORDs Checksums of all ships For each ship in SHIPx.DAT, the sum of all bytes in the record is created. Positions of unavailable ships are undefined and contain deleted files. +2000 -"- Checksums of all planets. The same for all planets in PDATAx.DAT +4000 -"- Checksums of starbases The same for all starbases in BDATAx.DAT +6000 WORD 0 ? The last word might be a side-effect when the file is created: To make room for 6000 bytes, do a Seek(6000) followed by some Write statement. If this information is incorrect, Planets doesn't show an error message. It corrects the problem, but only if the erroneous record is accessed from within the client program. MAKETURN aborts with the following error message if it finds any mismatch: "DATA ENCRIPT ERROR". (This typo has successfully hidden itself in all versions, from DOS Planets up to WinPlan 3.52...) FIZZ.BIN - Even more checksums ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file exists once per directory, even for more than one player. Then it contains information for all players. All must use the same Planets version (shareware/registered). +0 33 BYTEs 11 records of 12 bytes for each race. Undefined if this race doesn't play in this directory: +0 DWORD Checksum for ships, equal to the number in GENx.DAT, increased by 667 +4 DWORD Checksum for planets, equal to the number in GENx.DAT, increased by 1667 +8 DWORD Checksum for starbases, equal to the number in GENx.DAT, increased by 1262 +132 DWORD ? (probably unused) +136 25 DWORDs String 1 (encrypted, s.u.) +236 25 DWORDs String 2 (encrypted, s.u.) +336 DWORD Checksum. Equal to the sum of all DWORDs in the above strings, increased by 668 (a number having nothing in common with 13). The Strings are calculated as follows: FOR i:=1 TO 25 DO Value[i] := Ord(Character[i]) * i * 13; { Ord(x) = ASCII code of x } This is a signature for the registered/unregistered version of Planets. For the Shareware version the strings have the values "VGA Planets shareware " "Version 3.00 " resp. " V3.5 for windows " The Host checks the first line to identify the shareware version. For registered players, both lines need to be equal to be identified as the same player. The strings are written to REG.LOG in each Host run. They are also stored in PLANETS.EXE. No, I won't describe this here... If the values from PLANETS.EXE and FIZZ.BIN don't match, Planets refuses to run with the message: "Switching PLANETS.EXE program in the middle of a turn is not allowed. (blah blah) This is to prevent errors and cheating.". UNPACK doesn't create FIZZ.BIN. However, PLANETS.EXE will always create and update the file. MAKETURN won't run if FIZZ.BIN is missing and displays a rather long error message. Probably there was already some 3rd party registration utility. If the second line of the registration signature starts with "REG#13", the Host will ignore TRNs from that player. GAMESTAT.DAT - WINPLAN - Game Definitions ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is located in the WINPLAN directory and contains information on up to 8 active games. These are presented in the game menu. +0 8 RECORDs of 206 bytes each +0 WORD 0 (?) +2 11 WORDs The races being played by the player. Each WORD is -1 if the race is played, 0 otherwise. +24 80 BYTEs TRN Download path +104 80 BYTEs RST Upload path +184 20 BYTEs Name of the game +204 WORD 0 (?) +1648 BYTE unused, contains garbage +1649 WORD Number of the game selected last in the menu The unpacked game data is always in the WINPLAN\VPWORKx directory, where x is the sequential number of the record (1..8). GENx.DAT - General ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 18 BYTEs Timestamp (10 bytes date mm-dd-yyyy, 8 bytes time hh:mm:ss) +18 88 BYTEs 11 score records of 8 bytes each: +0 WORD Number of planets, 10 points each +2 WORD Number of capital ships, 10 points each +4 WORD Number of freighters, 1 point each +6 WORD Number of starbases, 120 points each +106 WORD Player Id +108 20 BYTEs Password The password has 10 characters (padded with NULs). Each character of the password is calculated as follows: ch[i] = pw[i]-pw[19-i]+32 where pw=this array indexed from 0 to 19, i runs from 0 to 9 The string 'NOPASSWORD' disables the password check. +128 BYTE unused This field may belong to the password data. If you define an array of size 20 in BASIC, this field really gets 21 elements (0 to 20). The password only uses 0 to 19. +129 DWORD Checksum of SHIPx.DAT/DIS +133 DWORD Checksum of PDATAx.DAT/DIS +137 DWORD Checksum of BDATAx.DAT/DIS +141 WORD 0, if the password has changed 13dec +143 10 BYTEs New password, if any: each byte is increased by 32h (50 dec) +153 WORD Turn number +155 WORD Checksum of the time stamp = sum of bytes at 0 to 17 From these data, a file signature is constructed: +118 10 BYTEs (second part of password data) Signature 1 is these 10 bytes. Increase the first byte by 1, the second by 2 and so on. The result is Signature 2. The values at 129, 133 and 137 are calculated as follows: - add all bytes of the DAT file - add all bytes of the DIS file - add the two results and store in the appropriate field. Note on passwords ------------------ Passwords are padded with NULs, not spaces. Decoding the passwords uses signed numbers, ASCII codes above 127 are negative and thus equivalent to NUL. This is important for newly MASTERed games. pw[i] is zero, while pw[19-i] contains a random character. After the player changes his password first, this anomaly disapperar. PLANETS.EXE correctly fills the new password with zeroes. INIT.TMP - Player List ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Congratulations, Tim Wisseman! You have been fooling me with this file name for several weeks! This file has a name as a temporary file but isn't one. It contains 11 WORDs that are 1 if information on that player is available, and zero otherwise. If all these WORDs are zero or the file doesn't exist, Planets tells one "No player data files found (blahblah)", even if the files do exist. Planets will highlight the player name if a word is 1 in this file, even if there are no files. And, it's very "funny" if you program the automatic harddisk cleanup job to kill temporary files :-( . Of course, this file exists once per directory. KOREx.DAT - WINPLAN - Starcharts ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 9 BYTEs ? +9 10 BYTEs Signature 2 (see GENx.DAT) +19 83 BYTEs ? +102 500 RECORDs of 8 bytes each: Mine fields +4102 50 RECORDs of 12 bytes each: Ion storms +4702 50 RECORDs of 4 bytes each: Explosions +4902 100 RECORDs of 78 bytes each: UFOs +12702 4 BYTEs Signature "1211", if all visual contacts fit into the normal TARGETx.DAT file, "1120" otherwise. --- Additional Visual Contacts --- +? 16 BYTEs ? (unused) +? DWORD Number of contacts +? n RECORDs of 34 bytes each, see ETEMP.TMP --- always --- +? 10 BYTEs Signature 2 (see GENx.DAT) For a description of the data formats, see the RST file description. This one contains a very similar data structure, except that there is the race names file included. MDATAx.DAT - Received Messages ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of messages +2 n*6 BYTEs Records of 6 bytes each +0 DWORD Address of message in file + 1 +4 WORD Length of message in bytes +x y BYTEs undefined, or the messages The messages texts are encrypted: each ASCII code is increased by 13dec. A single carriage return (ASCII 0Dh, encrypted 1Ah) is a line break. Empty lines are stored as a line break only (no spaces). Messages do not need to be all of the same length. Characters with an ASCII code above 242 can't be encrypted in messages. The encryption is without "wraparound" (then, 250 + 13 would be 7). Attention: Planets doesn't check this and exist with an 'Illegal Function Call' message. The host knows about this problem and replaces the characters with ASCII 13h (encrypted 20h = " "). Received messages normally start with a header like this: (-xy000)<<< Type >>> The hyphen identifies this message as a message from the current turn. If there is an 'o' instead, it's an older message since the player has missed some turns. xy000 is a (normally) five-letter code for the origin of the message where x is a letter and 000 a number. y may be a number or a letter and specifies the races referred by this message. In most cases, y is '0'. Classification by header lines ------------------------------- ž (-90###)<<< Sub Space Message >>> HISS message from planet ####. (-90###)<< ??? >> Also for other special missions (Dark Sense etc.) ž (-a0###)<< ??? >> Used by 3rd-party programs. See note on WinPlanets below. ž (-c0000)<<< Priority Points >>> (-c0000)<<< Subspace Message >>> Tim Continuum attacks a ship (-c0###)<<< Subspace Message >>> Tim Continuum attacks planet ###. ž (-d0###)<<< Space Dock Message >>> Ship was built on starbase ### (-d0###)<<< Planet Message >>> New starbase at planet ###. (-dX###)<< SUBSPACE MESSAGE >> A ship of race X surrendered at base ###. ž (-e0###)<<< ION STORM >>> Ship ### has been pulled off course or damaged by an ion storm (-e0###)<< DISTRESS CALL >> Own ship ### has run on a mine. The same text as for -n####. ž (-f0###)<<< Fleet Message >>> Ship ### has captured/destroyed a ship (-f0###)<<< Fleet Message >>> Ship ### has been defeated by planetary defense/has captured a planet (-f0###)<<< Fleet Message >>> One of your ships has captured planet ###. ž (-g0000)< Message from your host > HConfig. ž (-h###)<<< Subspace Message >>> Message from host (SENDMESS program). The number has only 3 digits here. Two lines follow: FROM: Host TO: 1 2 (Race numbers) ž (-i0###)<<< ION Advisory >>> Ion storm warning, storm ### ž (-l0###)<<< Sub Space Message >>> A ship has laid a mine field. The mine field ID is ###. ž (-m0###)<<< Long Range Sensor >>> A ship is sweeping mine field ###. ž (-n0###)<< MESSAGE FROM YOUR ENEMY >> Enemy ship ### is run on a mine. (-n0###)<< INTERCEPTED MESSAGE >> Sabotage teams landed on planet ###. ž (-p0###)<<< Sub Space Message >>> Ship with 'Colonize' mission has reached planet ###. (-p1###)<< Planetary Message >> 'New native life has been discovered.' (-pc###)<<< Distress Call >>> 'The climate is killing us!' (-pc###)NEWS FLASH: Sabotage or overtaxing: inhabitants demolish factories, don't pay taxes... (-p0###)<<< Planetary Message >>> 'Ship XXX is using transporters to beam down cargo....' (-p0###)<<< Fleet Message >>> Defense systems on planet ### have defeated an attack. (-p0###)<<< Sub Space Message >>> Planet ### lost in ground combat. ž (-rX###)<<< Sub Space Message >>> Message from race X. A FROM: and a TO: line follow. Anonymous messages have a different header line: (-r000)From: (random chars) ž (-s0###)<<< Planetside Message >>> 'Colonists set up house keeping', the colonists dropped from ship ###. (-s0###)<<< Transporter Log >>> 'Trying to beam up minerals...', Ship ### (-s0###)<<< SUBSPACE MESSAGE >>> Ship ### has crossed a minefield. (-s0###)<<< NAVIGATION >>> Ship ### has passed a chunnel (-s0000)<<< GLORY DEVICE >>> ... (-s0###)<<< Planetside Message >>> Colonists dropped by ship ### have taken planet in ground combat. (-s0###)<<< Sub Space Message >>> Ship ### has been robbed by the Privs. ž (-t0###)<<< TERRAFORM STATUS >>> Message from planet ### ž (-x0###)<< Long Range Sensors >> 'Distress call and explosion detected' ### = sequential number of explosion ž (-y0###)<<< Deep Space Scanner Report >>> e.g. Large Meteor, planet ### ž (-z0###)<<< SENSOR SWEEP >>> Scanner report for planet ###. (-z0###)<<< BIO SCANNER >>> FROM line with ship name follows. (-z0###)<<< Sub Space Message >>> 'There are no enemy colonists living on that planet.', means planet ### Summary -------- ž Messages about planets: (-p####) (-t####) (-y####) (-z####) (-9####) (-c####) [if #### is not 0] ž Messages about starbases: (-d####) ž Messages about starships: (-s####) (-n####) (-e####) (-f####) [not always] ž (-i####) - Ion storms (-l####) (-m####) - Mine fields ž Others: (-g####) (-h###) (-rX###) (-r000) (-x####) (-a####) Classification in WinPlanets ----------------------------- WinPlan sorts the messages by the second letter in the header line: 9 Special Missions a Alt Messages c Tim Continuum d Space Dock e Ship Emergency f Combat g Configure h Host i Ion Storms l Mine Laying m Mine Sweeping n Intercepted p Planets r Alien Races s Ships t Terraforming w Web Mines x Explosions y Meteors z Sensor Scan For most messages, WinPlan shows a picture. For example, a native of a planet, or the sender of the message. There is an interface for 3rd party programs to display their own images here. The number in the heading line "(-a0###)" (a for "Alt Messages") is an image number. If there is a matching file WINPLAN\BMP\ vpaux###.bmp (three-digit number), this one is displayed. Of course, the player needs to have the image file already, it is not transferred with the RST. To avoid colissions with ID numbers, Tim assigns these to programmers. MESSx.DAT - Sent Messages ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of messages +2 50*10 BYTEs records of 10 bytes each, for all messages: +0 DWORD Address of message in file + 1 +4 WORD Length off message in bytes +6 WORD Sender (=PlayerId, otherwise the host rejects it). +8 WORD Addressee (race number 1..11, 12=for the Host) +502 n BYTEs First message. Encrypted, see MDATAx.DAT. THe first message starts at offset 502dec (1F6h), so that new messages can be inserted without having to copy the old information each time. So you can send up to 50 messages. If you use PCC, the first message starts at 1502, so that up to 150 messages are possible. Messages to many races, such as Universal Messages, are stored as several single messages, one per addressee. The Client program (PLANETS.EXE/PCC) inserts the headers ("<<< Universal >>>"), not the Host. The host adds a TO- and a FROM line, plus an empty line. Messages to the Host show up in the Host log and in HOSTMESS.TXT. The TO: line reads as "TO: Unknown Race". PCC and WinPlanets can send these messages. MESS35x.DAT - WINPLAN - Sent Messages ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ WinPlan uses this file instead of MESSx.DAT to send messages. Sending messages to several people is supported by the file format, but WinPlan does NOT insert header lines like the DOS clients as Planets and PCC ("<<< Universal >>>"). MakeTurn disassembles messages into single commands. +0 WORD Number of sent messages +2 18 BYTEs ? (unused, rubbish) +20 n RECORDs containing the messages. Probably, a variable record size is possible: +0 BYTE Flag. If the message is valid, this byte is 31h ('1'). If the message has been deleted, the value is 30h ('0'). +1 12 BYTEs Addressees. If the message goes to race N, the appropriate byte is 31h ('1'), otherwise it is 30h ('0'). Race 12 is the Host +13 WORD Length of message text - 1. In my files, the value is always 600. +15 n BYTEs Encrypted message: Each byte has been increased by 13. A line break is encoded as CR + LF (encrypted 1Ah 17h). The message is padded with encrypted spaces (2Dh). If a message is deleted, WinPlan doesn't truncate the file but copies all messages back some positions and sets the flag at the first invalid message to '0'. If the file is empty (no message has been sent yet) it contains a single zero word only. Some notes on the message text: - WinPlan uses the Windows Editor Control. This is a full editor capable of doing automatic line breaks. CR/LF is only in the text, if one has really pressed ENTER. If you have written down a complete paragraph, it will contain no single CR/LF, line breaks were done at display time. - Windows uses the ANSI character set. Although there's a Kernel Function to convert ANSI to ASCII and back, Tim trusts an own creation. If the option "Translate ASCII (German Letters)" is active, some accented and umlauted characters (but not all) are translated into ASCII after sending the message. This gives characters that are invalid in ANSI and are displayed as little boxes in Windows. After re-loading the message, the conversion is not undone. NOTESx.DAT - WINPLAN - Notes ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 500 Records of 200 bytes each: Notes to planets. For planets, there are 2 separate notes that can be edited independantly: +0 100 BYTEs Note #1 (padded with spaces, can contain CR/LF) +100 100 BYTEs Note #2 +? 500 Records of 200 bytes each: Notes to starships. For starships, it seems to be a single note twice as long as for planets: +0 200 BYTEs Note +? 500 BYTEs ? +? 640 BYTEs Color names, 16 BASIC strings of 40 bytes each +? 11 BYTEs Colors for starships of the 11 races. I omitted file offsets here. They all would have been 6 digits long. PDATAx.DAT - New Planet Data [V] PDATAx.DIS - Old Planet Data [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of planets +2 n BYTEs Records of 85 bytes each +m 10 BYTEs PDATAx.DAT: Signature 2 -> GENx.DAT PDATAx.DIS: Signature 1 One Planet record: +0 WORD Player Id, 0 for unowned planets +2 WORD Planet Id +4 3 BYTEs Friendly Code +7 WORD Number of mines +9 WORD Number of factories +11 WORD Number of defence posts +13 DWORD Mined Neutronium +17 DWORD Mined Tritanium +21 DWORD Mined Duranium +25 DWORD Mined Molybdenum +29 DWORD Colonists (Clans of 100 men) +33 DWORD Supplies +37 DWORD Megacredits +41 DWORD Neutronium in ground +45 DWORD Tritanium in ground +49 DWORD Duranium in ground +53 DWORD Molybdenum in ground >4999 abundant 1200.4999 very common 600..1199 common 100..599 rare 1..99 very rare 0 none +57 WORD Neutronium density +59 WORD Tritanium density +61 WORD Duranium density +63 WORD Molybdenum density 70..100 large masses 1 mine extracts 1 kt 40..69 concentrated 2 mines extract 1 kt 30..39 dispersed 3 mines extract 1 kt 10..29 scattered 5 mines extract 1 kt 0..9 very scattered 10 mines extract 1 kt +65 WORD Colonist taxes +67 WORD Native taxes +69 WORD Colonist happiness +71 WORD Native happiness 90..100 happy 70..89 calm 50..69 unhappy 40..49 very angry 20..39 rioting <20 fighting +73 WORD Native Government (SPI = Socio Political Index) 0 none 0% 1 Anarchy 20% 2 Pre-Tribal 40% 3 Early-Tribal 60% 4 Tribal 80% 5 Feudal 100% 6 Monarchy 120% 7 Representative 140% 8 Participatory 160% 9 Unity 180% +75 DWORD Natives (Clans of 100 men) +79 WORD Native Race 0 none 1 Humanoid 2 Bovinoid 3 Reptilian 4 Avian 5 Amorphous 6 Insectoid 7 Amphibian 8 Ghipsoldal 9 Siliconoid +81 WORD Temperature (Temperature in Fahrenheit = 100 - this value) 0..15 desert (85..100ųF) 16..35 tropical (65..84ųF) 36..60 warm (40..64ųF) 61..85 cool (15..39ųF) 86..100 arctic (0..14ųF) +83 WORD 1=Build base, 0 otherwise The colonist's happiness change is calculated as sqrt(Clans) 3*abs(Temp-50) Mines+Factories 10 - ÄÄÄÄÄÄÄÄÄÄÄ - 0.8*Taxes - ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ - ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 100 100 300 For the natives sqrt(Clans) Mines+Factories 5 + SPI/2 - ÄÄÄÄÄÄÄÄÄÄÄ - 0.85*Taxes - ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 100 200 Cut the digits after the decimal point (TRUNC). The result equals the value shown in PLANETS.EXE as follows: -ģ .. -6 Hate you -5 .. -1 Are angry at you 0 Are undecided about you +1 .. +4 Like your leadership +5 .. +ģ Love you PATH.DAT - Game Directory ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains the path used to call a PLANETS program last time. To access a file of that game, just append the file name to the string read from this file. Except for the path name no other character may be in this file, neither a line feed nor a Ctrl-Z. Programs should not rely on this file but support the calling convention PROG ®pathÆ. VCR requires PATH.DAT. SHIPx.DAT - New Ship data [V] SHIPx.DIS - Old Ship data [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of ships +2 n BYTEs Records of 107 bytes each +m 10 BYTEs SHIPx.DAT: Signature 2 -> GENx.DAT SHIPx.DIS: Signature 1 A ship record: +0 WORD Ship ID +2 WORD Player ID +4 3 BYTEs Friendly Code +7 WORD Warp factor +9 WORD X distance to waypoint (destination-X minus X-position) +11 WORD Y distance to waypoint (destination-Y minus Y-position) THe distances must be in range -3000 .. +3000 +13 WORD X position +15 WORD Y position +17 WORD Engine type +19 WORD Hull type +21 WORD Beam weapon type +23 WORD Number of beams +25 WORD Number of fighter bays (if not zero, the T-Launcher type and T-Launcher number values are ignored/set to 0, since a ship may never have Torpedoes and Fighters) +27 WORD Torpedo Launcher Type +29 WORD Number of Torpedoes/Fighters +31 WORD Number of Torpedo launchers +33 WORD Mission 1 Explore 2 Mine sweep 3 Lay mines 4 Kill 5 Sensor Sweep 6 Colonize 7 Tow 8 Intercept 9 Race specific missions 1 = Federation Super Refit 2 = Lizard Hisssss! 3 = Bird Man Super Spy 4 = Fascist Pillage Planet 5 = Privateer Rob Ship 6 = Cyborg Self Repair 7 = Crystal Lay Web Mines 8 = Evil Empire Dark Sense 9 = Robots Build Fighters 10 = Rebel Rebel Ground Attack 11 = Colonies Build Fighters 10 Cloak 11 Beam up fuel 12 Beam up Duranium 13 Beam up Tritanium 14 Beam up Molybdenum 15 Beam up Supplies 16..19 undefined 20..999 3rd party extensions. These mission numbers are ignored by the Host. The Tow-Id and Intercept-Id fields may contain additional parameters between 0 and 500. See M.I.T. below. +35 WORD Primary Enemy +37 WORD Id of ship to tow. +39 WORD Damage % +41 WORD Crew +43 WORD Colonist Clans +45 20 BYTEs Name +65 WORD Neutronium +67 WORD Tritanium +69 WORD Duranium +71 WORD Molybdenum +73 WORD Supplies +75 7 WORDs `Unload Cargo' +75 WORD Neutronium +77 WORD Tritanium +79 WORD Duranium +81 WORD Molybdenum +83 WORD Colonists +85 WORD Supplies +87 WORD Planet Id or 0 for Jettison +89 7 WORDs Transfer to enemy ship +89 WORD Neutronium +91 WORD Tritanium +93 WORD Duranium +95 WORD Molybdenum +97 WORD Colonists +99 WORD Supplies +101 WORD Ship ID or 0 +103 WORD ID number for intercept mission. This field must contain a valid ship ID or zero, even if 3rd-party missions are used. +105 WORD Money M.I.T. Extended Missions ------------------------- M.I.T. stands for Mission-Intercept-Tow. This is WinPlan's interface to 3rd party programs. The mission number is in the range 20 to 999 (the Wisseman Host will ignore these missions). The Intercept and Tow IDs may contain parameters. Note that the Wisseman host accepts valid ship IDs or 0 only for the Intercept value. PHost, the portable Host, introduces some more missions that replace various Friendly Codes. It accepts every value as parameter, not only valid IDs. The real mission numbers may be configured, here the default values: 20 Make Torpedoes (same as the Friendly Code 'mkt') 21 Lay Minefield Intercept = Maximum number of torpedoes to use (0=all) Tow = Owner of minefield (0=the player laying the field) 22 Lay Web Minefield (Crystals only, parameters as for mission 21) 23 Scoop Torpedoes from Minefield (same as Fcode 'msc'). Intercept = max. number of torpedoes to make (0=all) 24 Load Minerals and make Torpedoes (similar to 'lfm' for fighters). Intercept = max. number of torpedoes to make (0=no limit) 25 Beam Down Money (like 'bdm') Intercept = megacredits (0=all) 26 Transfer Torpedoes to ship (like 'btt') Intercept = Ship ID (other player, same location) Tow = Number of torpedoes (0=as many as possible) 27 Transfer Fighters to ship (like 'btf', Parameter like mission 26) 28 Transfer Money to ship (like 'btm') Intercept = Ship ID (other player, same location) Tow = megacredits (0=all) 29 (unused) 30 Cloak. Like mission 10, if the client program blocks that 31 Extended Mission. Like mission 9, if the client program blocks that These missions are defined in MISSION.INI. SHIPXYx.DAT - Ship coordinates ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each ship a record of 8 bytes. Ships that are invisible or have not yet been built are stored as (0,0). The file ends with Signature 2. These ships are visible on the starcharts. A ship record: +0 WORD X position +2 WORD Y position +4 WORD Owner +6 WORD Mass in kt SNOOKER.DAT - WINPLAN - ??? ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ SNOOKER.DAT contains timestamps for all active games, plus some unknown data. The file is located in the WINPLAN directory. +0 WORD Number of the current entry, that is the one containing the timestamp of the last unpacked turn. +2 40 RECORDs of 18 bytes each, containing the time stamps of unpacked turns. The first entry has number 1. +722 40 RECORDs of 44 bytes. These entries correspond with the timestamp entries and contain ?????. The Windows UNPACK creates these records, but I don't know where they are used. WINPLAN doesn't complain if this data is missing or wrong. WINPLAN checks if the time stamp of the turn being loaded is contained in this list and refuses to run ("Game data is stale") if this is not the case. This blocks using 3rd party UNPACK programs. TARGETx.DAT - Visible enemy ships (`Contacts') [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file should contain all ships scanable with `V', all in the range up to 200 light years from a planet. Host 3.20 stores information on all ships in SHIPXYx.DAT here (300 ly). Only 50 contacts are stored, Planets doesn't support more. VPHost (a 3rd-party add-on) sorts contacts by their distance. The original Host also leaves out the farthest contacts if the limit would be exceeded. In Windows RSTs there is no such sorting. If you use such a file with a DOS client there may be a situation that you can't scan a ship orbiting your planet, but one in the deepest space. +0 WORD Number of ships +2 n BYTEs Records or 34 bytes each +m 10 BYTEs Signature 2 A ship record: +0 WORD Id Number +2 WORD Owner +4 WORD Warp +6 WORD X position +8 WORD Y position +10 WORD Type of starship hull +12 WORD Heading in degrees, 0=North, 90=East, 180=South, 270=West +14 20 BYTEs Ship name TEMP.PLN - Temporary file TEMP.BMP - WINPLAN - Temporary file ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is in the Planets directory, not with the player data. It contains a piece of RESOURCE.PLN, the picture shown last. Some information is missing. In the Windows version this file contains a picture from WPVCR.DLL. This file can be deleted in any case. TEMPLOCK.DAT - Checksums ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains 11 DWORDs with a checksum for each player. These sums are used in TRN files. MAKETURN creates the TEMPLOCK file. The checksums deal with TRN files, the contents of TEMPLOCK is included in each TRN file. These checksums enable a player to play several races in a game with one copy of registered Planets. If a TRN file "knows" the checksum of another TRN, the host knows that these have been made on the same computer. If a TRN doesn't known another, Host assumes one of the players has given his PLANETS.EXE away. That's why you need to play two races in a game in the same directory to avoid being attacked by the Tim Continuum. Values for players for which MAKETURN doesn't make a Turn file should be set to zero. For some unknown reason, Tim's MAKETURN puts 0F31h at the position of player 11. VPMakeTurn (3rd party MAKETURN program) sets this value to 0. Each checksum is calculated as: TempLock_Sum = File_Sum + (3 * Timestamp_Checksum) + 13 "File_Sum" is the sum of all bytes in the Turn file, except for the block containing the checksums: the header, pointers and commands are processed. for Windows TRNs, the beginning of the signature block is also included. "Timestamp_Checksum" means the sum of all bytes in this Turn's time stamp, see also GENx.DAT. This file exists once per directory. It is never used again and can be safely deleted. VCRx.DAT - Visual Combat Recordings ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A Visual Combat Recording is NOT a video or something like this, although the name implies this. In fact, it is a list of the starting parameters of the battle. The VCR program runs the battle using the same algorithm as the Host. Since this is not that simple, I didn't encounter any 3rd party VCR program yet... [Correction 18/Sep/97: Except for the one in PCC...] +0 WORD Number of VCR's +2 n BYTEs Records of 100 bytes each +x 10 BYTEs Signature 2. A VCR record: +0 DWORD Initial value for Random Number Generator. This value must be in the range 1..119. The Random Number Generator in VCR uses a table with 119 "Random Numbers", that are used one after the other and scaled to the required range. Since this table is _not_ equally distributed, the rumours about a Left/Right advantage may be not that wrong ;-] +4 WORD Temperature of planet for a Ship/Planet battle +6 WORD Type of battle 0 Ship/Ship 1 Ship/Planet +8 WORD Mass of left object +10 WORD Mass of right object +12 42 BYTEs Left object (Ship) +0 20 BYTEs Name +20 WORD Damage at beginning +22 WORD Crew +24 WORD Id Number +26 WORD Owner +28 WORD Picture. This field contains the picture number (RESOURCE.PLN) only, palette rotations as done by the Planets program are not taken into account. So the Alchemy Ships look exactly the same as a Super Transport Freighter. +30 WORD Type of beams +32 WORD Number of beams +34 WORD Fighter Tubes +36 WORD Torpedo Type +38 WORD Number of Fighters/Torps +40 WORD Number of Torpedo Launchers +54 42 BYTEs Right object (Ship/Planet). The same format as for the left one. +96 WORD Shields of left object +98 WORD Shields of right object A Note on Planets ------------------ A planet is always the second (right) object in a battle. In this case, the picture given in the VCR record is ignored. VCR uses a calculated picture, see also description of RESOURCE.PLN. For this calculation, the planet temperature is needed. For planets, the Crew field indicates whether the planet has shields or not. If it is zero, the planet starts with 0% shields, otherwise the maximum possible value (100%). VCRINIT.TMP - Temporary file ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is used for communication between PLANETS and VCR. Exactly spoken, VCR can be run only if this file exists, otherwise it branches to PLANETS. PLANETS will ignore a password query if VCRINIT.TMP exists and load the given player's data immediately. If a program needs to call VCR, it needs to perform the following steps: - Generate a VCRx.DAT. The signature may be missing, VCR doesn't perform integrity checks. GENx.DAT is not required. - Generate a VCRINIT.TMP containing the player number. It is possible to use player number 12 to avoid file name collisions. - Generate a PATH.DAT that contains the path to be used. The path must be usable immediately, that is, it must be possible to append a file name and use it ("D:\PATH\", not "D:\PATH"). - Create a copy of VCR.EXE. At locations 155A3h and 15828h you need to put the name of some EXE file (without .EXE), which should be run after VCR terminates. By default, these locations contain 'planets' resp. 'PLANETS'. The new file name also needs to have 7 letters. The program must only terminate itself. - Change to the Planets directory, otherwise VCR can't locate it's data files. - Execute the VCR copy. - Delete the VCR copy and VCRINIT.TMP. If VCRINIT.TMP remains existing, Planets will skip the password query and load the player's game immediately when run in that directory (of course, this can be useful, too... :-) +0 WORD Player Number +2 WORD Signature 667 (29Bh) +4 4 BYTEs 0 TRN FILE ĶĶĶĶĶĶĶĶĶ +0 WORD Player ID +2 DWORD Number of commands, max. 5000 +6 10 BYTEs Date of last turn: mm-dd-yyyy +16 8 BYTEs Time of last turn: hh:mm:ss +24 WORD ? (contains deleted data) +26 WORD Timestamp Checksum +28 BYTE ? (contains deleted data, missing if no commands) +29 n DWORDs File positions of the commands, each increased by 1 Command: +0 WORD Command Code +2 n BYTEs Data A command is a request for the host to change a value. For example, the action "build a factory" is encoded as three commands: PlanetChangeFactories, PlanetChangeMoney and PlanetChangeSupplies. MAKETURN looks for differences between the XXX.DAT and XXX.DIS files. There are 4 groups of commands (values in decimal, not all groups are used completely): 1..19 - Ships (SHIPx.DAT/.DIS) 20..39 - Planets (PDATAx.DAT/.DIS) 40..59 - Starbases (BDATAx.DAT/.DIS) >= 60 - general (Password, messages - GENx.DAT, MESSx.DAT) Unknown numbers are rejected as "Unknown OPP", the host shows as probable reason Cheating but doesn't do something against the player. The command names given below are these used in my UN-TRN program, you should recognize what they do from their names. Identification of TRN files ---------------------------- After the last command a data structure follows. This one is different after the location of the TRN file and contains information on the registration. The positions are calculated backwards from the file ending. That's why the host complains if you use X/Y Modem: these protocols may append Ctrl-Z at the end of the file. The host recognizes Ctrl-Zs and deletes them if necessary. Other characters make the file unusable. Windows TRN files with Ctrl-Z are not recognized as such. === Structure for VGA Planets for DOS (256 bytes) === +0 DWORD Checksum "X" +4 DWORD ? (contains erased data) +8 204 BYTEs Signature from FIZZ.BIN (offset 136, the 2 strings + sum) +212 11 DWORDs Contents of TEMPLOCK.DAT The checksum "X" comes from TEMPLOCK.DAT, see there. If the TRN file doesn't contain any command, this block is at position 28 in the file. This block is not used when calculating the TEMPLOCK.DAT checksums. WinPlanets Shareware is identical to DOS planets from this point of view and creates the same file format. === Structure for WinPlanets (572 bytes) === +0 6 BYTEs Signature "VER3.5" +6 2 BYTEs Sub-version "00", "01"... +8 DWORD VPH35 Value, part A +12 DWORD VPH35 Value, part B +16 25 BYTEs String 1, part A (Serial number) +41 25 BYTEs String 1, part B +66 25 BYTEs String 2, part A (Registration date) +91 25 BYTEs String 2, part B +116 50 BYTEs String 3 (Name of player) +166 50 BYTEs String 4 (Address of player) +216 100 BYTEs ??? --- the DOS structure follows here --- +316 DWORD Checksum "X" +320 DWORD ? (contains erased data) +324 204 BYTEs Signature from FIZZ.BIN (offset 136, the 2 strings + sum) +528 11 DWORDs Contents of TEMPLOCK.DAT The Strings 1 and 2 give the exactly the same text as in FIZZ.BIN. Here, they are encoded as Character[i] := ( PartA[i] XOR PartB[i] ) The strings 3 and 4 appear "as is" in REG.LOG, they are unencoded. String 1 is interpreted as a serial number, 2 as registration date. The both DWORDs at position 8 and 12 give a value "Y": Y = ( VPHValue_A XOR VPHValue_B ) AND 7FFFFFFFh This equals the record VPH_Record(Turn_Number) from VPH35.DLL, see there. The values actually written to the TRN file come from SCRAM21.OLE. The Windows structure is included in the checksum calculation for TEMPLOCK.DAT except for the last 4 fields (DOS structure). Probably there was already a 3rd party registration program. The host rejects TRN files if their second string starts with "REG#13". For WinPlanets users the first string is the serial number, the second one the registration date. Valid Commands --------------- For WORDs, possible values are 0 .. 10000, for DWORDs the range is 0 to 0 .. 1,000,000,000 (1 Billion / Milliard), ID numbers have a possible range of 0 .. 500. These ranges are the reason that ships may not carry more than 10000 mc, and that the parameters for 3rd- party missions (Intercept ID, Tow ID) must be between 0 and 500. See also the descriptions of the appropriate DAT files. --- Code 1 (01h=ShipChangeFc) --- +0 WORD Ship ID +2 3 BYTEs New Friendly code --- Code 2 (02h=ShipChangeSpeed) --- +0 WORD Ship ID +2 WORD New Warp factor (0..9) --- Code 3 (03h=ShipChangeWaypoint) --- +0 WORD Ship ID +2 WORD X Waypoint, difference to current location +4 WORD Y Waypoint, difference to current location (range -3000 .. 3000) --- Code 4 (04h=ShipChangeMission) --- +0 WORD Ship ID +2 WORD New mission see SHIPx.DAT --- Code 5 (05h=ShipChangePrimaryEnemy) --- +0 WORD Ship ID +2 WORD New Primary enemy --- Code 6 (06h=ShipTowShip) --- +0 WORD Ship ID +2 WORD Id of ship to be towed --- Code 7 (07h=ShipChangeName) --- +0 WORD Ship ID +2 20 BYTEs New name --- Code 8 (08h=ShipBeamDownCargo) --- +0 WORD Ship ID +2 WORD Neutronium +4 WORD Tritanium +6 WORD Duranium +8 WORD Molybdenum +10 WORD Colonists +12 WORD Supplies +14 WORD Target planet ID (0 for Jettison) --- Code 9 (09h=ShipTransferCargo) --- +0 WORD Ship ID +2 WORD Neutronium +4 WORD Tritanium +6 WORD Duranium +8 WORD Molybdenum +10 WORD Colonists +12 WORD Supplies +14 WORD Target ship ID --- Code 10 (0Ah=ShipIntercept) +0 WORD Ship ID +2 WORD Id of ship to intercept --- Code 11 (0Bh=ShipChangeNeutronium) --- +0 WORD Ship ID +2 WORD Neutronium / kt --- Code 12 (0Ch=ShipChangeTritanium) --- +0 WORD Ship ID +2 WORD Tritanium / kt --- Code 13 (0Dh=ShipChangeDuranium) --- +0 WORD Ship ID +2 WORD Duranium / kt --- Code 14 (0Eh=ShipChangeMolybdenum) --- +0 WORD Ship ID +2 WORD Molybdenum / kt --- Code 15 (0Fh=ShipChangeSupplies) --- +0 WORD Ship ID +2 WORD Supplies / kt --- Code 16 (10h=ShipChangeColonists) --- +0 WORD Ship ID +2 WORD Colonist Clans --- Code 17 (11h=ShipChangeTorpedoes) --- +0 WORD Ship ID +2 WORD Number of Torpedoes --- Code 18 (12h=ShipChangeMoney) --- +0 WORD Ship ID +2 WORD Money / mc The codes 19 (13h) and 20 (14h) are unused. --- Code 21 (15h=PlanetChangeFc) --- +0 WORD Planet ID +2 3 BYTEs New Friendly Code --- Code 22 (16h=PlanetChangeMineCnt) --- +0 WORD Planet ID +2 WORD Number of Mines --- Code 23 (17h=PlanetChangeFactories) --- +0 WORD Planet ID +2 WORD Number of Factories --- Code 24 (18h=PlanetChangeDefense) --- +0 WORD Planet ID +2 WORD Number of Defense Posts --- Code 25 (19h=PlanetChangeNeutronium) --- +0 WORD Planet ID +2 DWORD Neutronium / kt --- Code 26 (1Ah=PlanetChangeTritanium) --- +0 WORD Planet ID +2 DWORD Tritanium / kt --- Code 27 (1Bh=PlanetChangeDuranium) --- +0 WORD Planet ID +2 DWORD Duranium / kt --- Code 28 (1Ch=PlanetChangeMolybdenum) --- +0 WORD Planet ID +2 DWORD Molybdenum / kt --- Code 29 (1Dh=PlanetChangeColonists) --- +0 WORD Planet ID +2 DWORD Colonist Clans --- Code 30 (1Eh=PlanetChangeSupplies) --- +0 WORD Planet ID +2 DWORD Supplies / kt --- Code 31 (1Fh=PlanetChangeMoney) --- +0 WORD Planet ID +2 DWORD Megacredits --- Code 32 (20h=PlanetColonistTax) --- +0 WORD Planet ID +2 WORD Tax rate --- Code 33 (21h=PlanetNativeTax) --- +0 WORD Planet ID +2 WORD Tax rate --- Code 34 (22h=PlanetBuildBase) --- +0 WORD Planet ID The codes 35 (23h) to 39 (27h) are unused. --- Code 40 (28h=BaseChangeDefense) --- +0 WORD Base ID +2 WORD Base Defense Count --- Code 41 (29h=BaseUpgradeEngineTech) --- +0 WORD Base ID +2 WORD New Tech Level --- Code 42 (2Ah=BaseUpgradeHullsTech) --- +0 WORD Base ID +2 WORD New Tech Level --- Code 43 (2Bh=BaseUpgradeWeaponsTech) --- +0 WORD Base ID +2 WORD New Tech Level --- Code 44 (2Ch=BaseBuildEngines) --- +0 WORD Base ID +2 9 WORDs Number of engines of that type on the base --- Code 45 (2Dh=BaseBuildHulls) --- +0 WORD Base ID +2 20 WORDs Number of Hulls of that type at the base. These are the 20 ship types from TRUEHULL.DAT, that the player can build. --- Code 46 (2Eh=BaseBuildWeapons) --- +0 WORD Base ID +2 10 WORDs Number of Beams of that type on the base --- Code 47 (2Fh=BaseBuildLaunchers) --- +0 WORD Base ID +2 10 WORDs Number of Torpedo Launchers of that type on the base --- Code 48 (30h=BaseBuildTorpedoes) --- +0 WORD Base ID +2 10 WORDs Number of Torpedoes of that type on the base --- Code 49 (31h=BaseBuildFighters) --- +0 WORD Base ID +2 WORD Number of Fighters on the base --- Code 50 (32h=BaseFixRecycleShip) --- +0 WORD Base ID +2 WORD Ship ID --- Code 51 (33h=BaseFixRecycleShip) --- +0 WORD Base ID +2 WORD Action 0 none 1 fix 2 recycle --- Code 52 (34h=BaseChangeMission) --- +0 WORD Base ID +2 WORD Primary Order (see BDATAx.DAT) --- Code 53 (35h=BaseBuildShip) --- +0 WORD Base ID +2 WORD Hull Number +4 WORD Engine +6 WORD Beam Weapon Type +8 WORD Beam Weapon Count +10 WORD Torpedo Type +12 WORD Torpedo Count +14 WORD Number of Fighters (?) --- Code 54 (36h=BaseUpgradeTorpTech) --- +0 WORD Base ID +2 WORD New Tech Level The codes 55 (37h) to 59 (3Bh) are unused. --- Code 60 (3Ch=SendMessage) --- +0 WORD Length of message +2 WORD Sender (=Player ID) +4 WORD Receiver +6 n BYTEs Message (encrypted): Each byte is increased by 13dec. While DOS programs only encode a single byte for a line feed (0Dh, encrypted as 1Ah), Windows MAKETURN uses 0Dh 0Ah (encrypted 1Ah 17h). See also MDATAx.DAT / MDATA35x.DAT. --- Code 61 (3Dh=ChangePassword) --- +0 WORD 0 (?) +2 10 BYTEs New password, encrypted. Each character is increased by 32h Attachments ------------ It is possible to embed files in a TRN file. These are then copied into the Game directory. I did not yet find a tool that can do this, and also the host docs don't tell me something about this, but here is the description of the changed TRN file: +0 10 BYTEs Signature 'NCC1701AD9' (where this string may come from?) +10 DWORD Location of original TRN data in this file (as usual, + 1) +14 DWORD Size of original TRN file in bytes +18 10 RECORDs of 20 bytes each: +0 DWORD Position of embedded file ( + 1) +4 DWORD Length of embedded file +8 12 BYTEs File name, padded with spaces. You cannot send BAT, DAT, EXT, HST, INI, LOG, NM, RST or TRN files. Fill all bytes with spaces if this "slot" doesn't contain a file. Following are the "attachments" and the TRN file. The host uses the data at +10 and +14 to extract the original TRN file. After extracting, a valid TRN file matching the above descriptions must be created. I don't know which hosts can do this. The 3.00 host coming with VGA Planets Shareware can't do it, neither can 3.14. Host 3.20 can do it. May be, between those there was a description plus program for this interface? Note that this opens a giant security hole. It is possible to send an AUXHOSTx.EXE or HOST.EXE file that changes information of a player (more money or better tech etc.). Note that these are the "harmless" possibilities. You can also format the host's harddisk... Note that there is a possibility to prevent these actions: The EXE files need to be in the Host directory, not the game directory. Sending an EXE file needs to include a path specification originated at the game directory, such as "..\HOST.EXE". A much longer name isn't possible with 12 characters. So simply put your game data _TWO_ subdirectory levels below the host, or a completely different branch: - Host in C:\HOST - Game in C:\HOST\GAMES\GAME1, or C:\GAME1 Setting HOST.EXE read-only won't help, since the host will then crash when trying to overwrite a r/o file. RST FILE ĶĶĶĶĶĶĶĶĶ +0 8 DWORDs Addresses of the file sections, each + 1 --- Host 3.20+ --- +32 6 BYTEs Signature "VER3.5" for WinPlanets RSTs. +38 2 BYTEs Sub-Version, currently either "00" or "01". +40 DWORD File position of the WinPlanets data, when existant. +44 DWORD Position of LEECHx.DAT, if existing (0 otherwise). --- Host 3.22+ --- +48 DWORD Position of extended UFO database Normally, the data follows at 96 (60h). The 8 sections correspond with the following files in that order. The length of each section must be found out from it's contents: For 1, 2, 3, 4 and 8 the first word contains the number of entries of the given size. SHIPXY and GEN always have a fixed size, for MDATA see below. WinPlanets RSTs are sent if the Host didn't get a TRN file, or if it got a Windows Turn file. WinPlan RSTs contain a "DOS part" built up exactly as the normal DOS file. Windows RSTs contain additional information, see below. Sections --------- 1. SHIPx.DAT / .DIS x * 107 2. TARGETx.DAT x * 34 3. PDATAx.DAT / .DIS x * 85 4. BDATAx.DAT / .DIS x * 156 5. MDATAx.DAT 6. SHIPXYx.DAT 4000 7. GENx.DAT (see note below) 144 8. VCRx.DAT x * 100 THe signatures are not stored in a RST file. Note to MDATAx.DAT ------------------- MDATAx.DAT contains offsets of the messages in the file. The image of the MDATA file in an RST doesn't contain offsets into MDATA, but into the RST file. These need to be translated before using. Note to GENx.DAT ----------------- The GENx.DAT is stored somewhat modified in the RST file. The following assignments are used: GENx.DAT ³ RST file ³ Meaning ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ bytes 0..107 ³ bytes 0..107 ³ Timestamp, scores & Id bytes 108..127 ³ bytes 108..127 ³ Password byte 128 ³ (n/a) ³ always 0 (?) bytes 129..140 ³ (indirect) ³ Checksums bytes 141..152 ³ (n/a, set to zero) ³ New password bytes 153..156 ³ bytes +140..143 ³ Turn Number, Timestamp Sum The RST image of GENx.DAT contains similar checksums as GENx.DAT. The sums in the RST file are checksums of the SHIPx.DAT, PDATAx.DAT and BDATAx.DAT images, the both first bytes of each image (number of objects) are ignored. WinPlanets data ---------------- +0 500 RECORDs of 8 bytes each; Mine fields +0 WORD X +2 WORD Y +4 WORD Radius +6 WORD Owner. 1..11 = Normal minefield belonging to race X. 12 = Web mine field of the Crystal People, 0 = not visible +? 600 BYTEs Ion storms, 50 records of 12 bytes each +0 WORD X +2 WORD Y +4 WORD Radius +6 WORD Voltage in MeV, 0 = non-existant +8 WORD Warp +10 WORD Heading in degrees see also GREY.HST below +? 50 RECORDs of 4 bytes each: Explosions +0 WORD X (0 = non-existant) +2 WORD Y +? 682 BYTEs Contents of RACE.NM. RACE.NM remains unchanged if this field is empty (only spaces). +? 7800 BYTEs Contents of UFO.HST +? 4 BYTEs Signature "1211", if all visual contacts fit into the normal TARGETx.DAT file, "1120" otherwise. I don't know how Windows UNPACK evaluates this number. The number appears as a literal in HOST.EXE. --- Additional Visual Contacts --- +? DWORD Number of contacts +? n RECORDs of 34 bytes each, see ETEMP.TMP After the visual contacts the file LEECHx.DAT follows, as specified by the offset in the header. The first is a DWORD giving the file size, then the file contents follows. I don't know whats the reason for the LEECHx.DAT is, but you only need to put it into your Host directory and Host will send it to the players. WinPlan UNPACK will unpack it and place it in the game directory. In Host 3.22, the extended UFO database may follow (with up to 1000 UFOs). The offset in the file header points to this structure: +0 WORD Total number of UFOs (including those in the "normal" part). +2 n RECORDs of 78 bytes each: the UFOs. UFOs 1 to 100 are stored in the normal structure, this field only contains UFOs from ID 101 onwards, if existant. HOST DATA ĶĶĶĶĶĶĶĶĶĶ BDATA.HST - Starbase Data [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Same as BDATAx.DAT. The first word (number of bases) is undefined (?). All 500 bases are stored. After the base data, a WORD containing the current turn number follows. This number must be equal to the one in NEXTTURN.HST. If the numbers don't match, an error message is printed and the number from BDATA.HST is used. However, for intact games it is safer to use the number from NEXTTURN.HST. BUFF.TMP - Temporary File BUFFPNT.TMP - Temporary File ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ These files contain all anonymous messages. BUFF.TMP contains the texts, BUFFPNT.TMP contains sender and addressee information. The format is similar to MESS.* and MESSPNT.* described below. The addressee has been set to 0 to indicate that the message has been delivered. For some unknown reason, this file is never deleted. Quite interesting to read old anonymous messages, when people have just discovered "*w*": "Who the fuck has messed up the message file!" ETEMPx.TMP - Temporary File ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is created while making the TARGETx.* records for the Result files. It contains "superfluous" targets that do not fit into the DOS part of the RST file. The format is similar to the normal TARGETx.DAT, but the ship name is encrypted. Why?? That the host-master doesn't spy out you? For some unknown reasons, this file is deleted sometimes, and sometimes it is not... +0 DWORD Number of records +4 n BYTEs Records of 34 bytes each Ship record: +0 WORD ID Number +2 WORD Owner +4 WORD Warp +6 WORD X location +8 WORD Y location +10 WORD Type of hull +12 WORD Heading in degrees, 0=North, 90=East, 180=South, 270=West, -1=??? +14 20 BYTEs Ship name, encrypted. For each character, Encrypted[i] := Original[i] XOR (155 - i) where i runs from 1 to 20. 155 = 12*13 - 1 GEN.HST - Passwords and other ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 46 BYTEs ? +46 11 WORDs 1, if the race is playing, 0 otherwise +68 220 BYTEs Passwords. This field can be defined as pw:ARRAY[1..22,1..10] OF BYTE The password for player X is then calculated as FOR i:=1 TO 10 DO password[i] := Chr( pw[X,i] - pw[X+11,11-i] + 32 ) For some games, you get characters with a code greater than 128 (negative numbers). For example, in a newly MASTERed game, pw[X,i] is zero while pw[X+11,11-i] contains some random character. Probably these characters are to be taken as spaces. When the player changes his password, this anomaly disappears. +288 n BYTEs ? +448 WORD ID of starbase that built the last "normal" ship (not a priority build). Fields marked with "?" are probably unused. They contained deleted data in my game (greetings from your tax office...) GREY.HST - Miscellaneous ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 500 WORDs Experience values of starship crews (?) Increased by 1 in each turn in which the ship moves. +1000 n BYTEs Ion storms: 50 records of 16 bytes each +0 WORD X +2 WORD Y +4 WORD Radius +6 WORD Voltage in MeV +8 WORD Heading in degrees: 0=North, 90=East, ... +10 WORD Probably 0:weakening, 1:growing +12 2 WORDs ? (may be unused; WinPlanets-RSTs contain the first 12 bytes only) Sorry, I don't know where the storm speeds are stored. An active storm is identified by a non-zero voltage. Storms that have disappeared are still stored but have voltage 0. There may only be as many ion storms as specified in the HConfig file (default: 5), so that normally not all fields could contain real storms. When a new game is started, there are always some active Ion storms. It may happen that a player gets a message about a storm with 0 MeV. Due to the encoding here, the storm won't appear on the starcharts. +1800 11 WORDs Build Priority Points --- HOST 3.22.007 and later --- +1822 11 WORDs Alliances. This field contains information on who a player has declared an ally: Bit 0 1=the player set the Feds as his ally Bit 1 1=the player set the Lizards as his ally ... Bit 10 1=the player set the Colonies as his ally Ships of the player won't attack ships of his allies. An alliance must be two-way, that is, the ally must also have set the player as as friend to avoid that his ships attack the player. [Wow, Tim discovered the "Bitfield" data type... But to get 2^n he still uses the co-processor] HCONFIG.HST - Configuration [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Fields marked with - contain Yes/No values: 1=yes, 0=no. Probabilities are given in percent in most cases. +0 WORD Recycle Rate for `Colonize' mission, % +2 WORD Odds of a meteor +4 WORD -Minefields (independant of Web Mine setting) +6 WORD -Alchemy ships +8 WORD -Delete old messages --- the Host 3.00 HConfig ends here --- +10 WORD -Disable passwords +12 12 WORDs Ground combat: Attack ratio for each player +36 12 WORDs Ground combat: Defense ratio for each player +60 12 WORDs Free fighters on starbase per turn, for each player +84 12 WORDs Mining rates for each player (50..500%) +108 12 WORDs Tax rates for each player (50..500%) These fields contain 12 words. The first word in each range is 0, the remaining 11 entries contain the data. +132 WORD -Rebels can build fighters on ships +134 WORD -Colonies can build fighters on ships +136 WORD -Robots can build fighters on ships +138 WORD Odds of cloak failure (0..50%) +140 WORD -Privateer can rob cloaked ships (Rob Ship mission) +142 WORD Sensor range (ships visible) +144 WORD Dark Sense range +146 WORD -Lizard: Hissss mission +148 WORD -Rebel: Ground attack +150 WORD -Federation: Super Refit +152 WORD -Crystal: Web Mines +154 WORD Fuel used for cloaking in kt (1..50) +156 WORD Range of Sensor Sweep mission +158 WORD -New natives appear on planets +160 WORD -Planets attack ships +162 WORD Cyborg assimilation rate +164 WORD Web Mine decay rate +166 WORD Mine decay rate +168 WORD Maximum mine field radius +170 WORD Trans Uranium Mutation rate (`isotope TUDR') +172 WORD Structure decay +174 WORD -Overpopulation eat supplies +176 WORD -Ships without fuel can move +178 WORD Odds of running on a mine +180 WORD Odds of running on a Web mine +182 WORD Range from with mine fields can be seen +184 WORD -Mines destroy enemy mines +186 WORD -Engine Shield Bonus +188 WORD Engine Shield Bonus Rate +190 WORD Colonies: mine sweep rate when sweeping with fighters +192 WORD -Colonies: can use fighters for mine sweeping +194 WORD Mine Sweep Rate +196 WORD Web Mine Sweep Rate +198 WORD Lizard: Hissss Effect +200 WORD Privateer: odds of a Rob Ship failure +202 WORD -Rebel can be attacked by planets +204 WORD -Fascist can be attacked by planets +206 WORD Mine Sweep range +208 WORD Web Mine Sweep range +210 WORD -Terraforming missions (`science missions') +212 WORD Odds to run on a mine with a cloaked ship, in 1/10 % +214 WORD Damage level that prevents cloaking +216 WORD -Federation: Crew bonus ("Scotty Bonus") +218 WORD Information on small meteors +0 WORD Probability +2 DWORD Minimum Neutronium +6 DWORD Minimum Duranium +10 DWORD Minimum Tritanium +14 DWORD Minimum Molybdenum +18 DWORD Maximum Neutronium +22 DWORD Maximum Duranium +26 DWORD Maximum Tritanium +30 DWORD Maximum Molybdenum +252 34 BYTEs Information on large meteors, same as above +286 WORD -Send messages for meteor impacts +288 WORD -One-Engine ships can tow +290 WORD -Hyperdrive ships +292 WORD `Climate death rate' +294 WORD -Gravity wells +296 WORD -Crystal: immune against extreme climate (desert advantage) +298 WORD -Mines destroy web mines +300 WORD -Climate limits population --- The Host 3.14 HConfig ends here --- +302 DWORD Maximum income per planet +306 WORD Maximum number of Ion storms (0..100) +308 WORD -Firecloud Chunnel +310 WORD -Super Spy Deluxe +312 WORD -Ion storms hide mine fields +314 WORD -Glory Device +316 WORD -Loki anti-cloak +318 WORD -Lady Royale gambling +320 WORD -Cloaked ships attack +322 WORD -Ship cloning +324 WORD -Crystal and Privateer: boarding (tow capture) +326 WORD -Imperial Assault +328 WORD Neutronium made by the Cobol ship per ly travelled +330 WORD -Aries ship can do alchemy +332 WORD -Bioscanner +334 WORD Hull tech level, from which onwards ships are not slowed down by mine hits (Hull tech mine slowdown) --- the Host 3.21 HConfig ends here --- New hosts normally append their new settings after the end of the file. More exactly spoken, they let the HConfig program do this. If an invalid HConfig file (wrong file size) is found, Host uses default values. That's why you need to run HCONFIG after _ANY_ Host update! LASTTURN.HST - Timestamp ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 18 BYTEs Timestamp of last host run +18 WORD 0 This file is updated after writing the RSTs. Programs run as AUXHOST use the old value. MESS.OLD - Old Messages (=sent last turn) MESS.EXT - External Messages (sent by Host master) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ These files contain - encrypted the usual way, see MDATAx.DAT - the Old and External message texts. The MESSPNT files contain pointers into these files. The MESS.EXT file contains messages sent with the SENDMESS program. MESS.OLD contains all messages sent the in the last host run. If a player didn't send in a Turn, he gets the "missed" messages once again (up to 100 messages). All messages sent by the Host itself (Sensor sweep etc.) and external messages are added to this file. See also BUFF.TMP. MESSPNT.OLD - Pointers for Old messages MESSPNT.EXT - Pointers for External messages ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 WORD Number of messages in the file +2 n BYTEs Records of 8 bytes each +0 WORD Receiver +2 DWORD Address in MESS.* Note: Addresses are numbered from 1 onwards, not from 0 as usual! +6 WORD Length of message See also BUFFPNT.TMP. MINES.HST - Mine fields ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 500 records of 12 bytes each +0 WORD X +2 WORD Y +4 WORD Owner +6 DWORD Number of Mine Units. The radius of each mine field is the square root of this value. Each turn the value is reduced to (count') := ((count) - 1) * (1 - (mine_decay%)) The maximum value here is 3000ż=9,000,000 (3000 is the maximum possible mine field radius that can be set in HCONFIG), resp. 25,000,000 (maximum set by the Host program). +10 WORD Type 0 Normal Mines 1 Web Mines Unused minefields are identified by the radius and owner being zero. For Web Mines, the Owner setting is somewhat meaningless, all Web Mine fields are counted as "Crystal People". If one lays a Web Mine field under another Id using the "miX" Fcode, the host may get confused: when finding the Mine field Fcodes, the owner stored here is used, but only the Crystals are immune against Web Mines, regardless of the "real" owner. NEXTTURN.HST - Timestamp ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 18 BYTEs Timestamp of last Host run +18 WORD Current Turn number This file is updated before reading in the TRNs. Programs run as AUXHOST use the new turn number. OLDFIG.HST - Host Configuration ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is basically the same as HCONFIG.HST. It contains the configuration of the last Host run. If this file differs from HCONFIG.HST, the new HConfig is sent to the players as message. PDATA.HST - Planet data ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Same as PDATAx.DAT. The first word (planet count) is undefined (?). All 500 planets are stored. REFDATA.HST - Victory Conditions ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is created by MASTER, but not used by the Host. The external REF program uses this file. +0 WORD 1 = if a scenery was chosen in RCONFIG, 0 otherwise +2 WORD Scenery chosen in MASTER (starting conditions) 1 Classic (Homeworlds in a circle) 2 Custom (Homeworlds at selected positions) 3 Wandering Tribes (all in freighters at the same spot) 4 Wandering Tribes (all in freighters at selected pos.) 5 Wandering Tribes (`mass confusion') 6 Ashes of the Empire 7 Crazy Intermix (no borders) 8 Disunited Kingdoms (all with a number of planets) Master 3.00 can do sceneries 1 to 3 only. +4 WORD ? (0) +6 11 WORDs ID numbers of homeworlds, 0=none (Wandering Tribes or race is not playing) +28 WORD ? (0) +30 11 WORDs Number of turns the race already controlled the Tantalus machine. +52 WORD ID of planet with Tantalus machine +54 WORD Number of turns a player needs to control the Tantalus machine in order to set it off +56 WORD Race playing the empire (for "Ashes of the Empire") +58 WORD Scenery chosen in RCONFIG (victory condition) 1 Elections 2 Ship Tonnage 3 Election + Ship Tonnage 4 Tantalus Machine 5 Moly The Spice of Life (Molybdenum) 6 Ashes of the Empire 7 Invasion (capture homeworlds) +60 DWORD ? (0) +64 11 DWORDs Current scores (REF scores, not the usual scoring system!) +156 DWORD Score required to win (all except "Ashes..." and "Tantalus") +160 DWORD ? (0) +164 WORD Winning race, 0 = no one yet The fields marked ? are probably remainders of the BASIC arrays again... SHIP.HST - Ship Data ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Same as SHIPx.DAT. The first word (number of ships) is undefined (?). All 500 ships are stored. SHIPXY.HST - Ship Coordinates ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Same as SHIPXY.DAT. All ships are stored. Probably, this file is re-created after each AUXHOST run. TONS.HST - Ship tons "sunk" this turn [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is created by the host, but never used again. The TONS.EXE program can make a LOG file from this file. +0 11 DWORDs Sum of sunk ships (masses, total) +44 11 DWORDs Sum of sunk ships this turn (masses) UFO.HST - Ufos, 3rd party additions [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains UFO data. These are not used within the Host program, but sent to WinPlan users in RST files. This file allows third-party programs to create completely new objects. Players can interact with these UFOs using the mission codes 20-999, special FCodes or messages. The file contains 100 records of 78 bytes each: +0 WORD Color (1..15) The object is displayed as an X with a rectangle around it. 0 means this UFO doesn't exist. The color is the usual encoding for colors in text and graphics modes. +2 20 BYTEs Name of object Shown on the star charts +22 20 BYTEs Info 1 +42 20 BYTEs Info 2 Shown when the object is selected. +62 WORD X (0..4000) +64 WORD Y (0..4000) +66 WORD Warp speed (0..15) +68 WORD Heading in degrees: 0=North, 90=East, 180=South, 270=West +70 WORD Distance from which a planet can see the object +72 WORD Distance from which a ship can see the object Valid values are 1..5000, all other values are equal to 5000. +74 WORD Radius of object +76 WORD Type of object. A program always should use only objects if it knows their type. To avoid collisions, each programmer should get a range of ID numbers from Tim Wisseman. These are already assigned: 101 - 150 Dan Gale 151 - 200 Jan Peter Dijkstra 201 - 250 Sean Martens 300 - 310 Norman Violet 311 - 350 Scott Zinssell VCR.HST - VCRs ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains all VCRs from a turn: +0 WORD Number of VCRs +2 n RECORDs of 100 bytes each (VCRs, see VCRx.DAT) XYPLAN.DAT - Planet coordinates XYPLAN.HST - Planet coordinates ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 500 records of 60 bytes each: +0 WORD X coordinate (1000..3000, 1000=left) +2 WORD Y coordinate (1000..3000, 1000=bottom) +4 WORD Owner. In the .DAT file which is also used by the Planets program, this field is 0. MASTER makes a copy with the name .HST. PLANETS.EXE checks if XYPLAN has changed by adding all X coordinates. The result must be exactly 998681. Otherwise, it refuses to run with the message "ERROR: Data file XYPLAN.DAT has been tampered with. Program terminated to avoid a security breach." There is a patch available, since "custom universes" are quite popular. FIXED DATA ĶĶĶĶĶĶĶĶĶĶĶ Some of these files are some bytes longer than required. These bytes are not used and contain only parts of deleted files on Wissemans hard disk. Hope that nothing of this ought to be confidential... ;-) By the way, Tims CONFIG.SYS was exactly 215 bytes large on 9/May/1992 at 9:03 pm. The ship specification files need to have a fixed size: - BEAMSPEC.DAT 360 bytes - ENGSPEC.DAT 598 bytes (4 bytes too much) - HULLSPEC.DAT 6300 bytes - TORPSPEC.DAT 470 bytes (90 bytes too much) PLANETS.EXE calculates a checksum each time it is started to prevent using modified files. The sum of all bytes of these 4 files must be exactly 338817. Otherwise Planets refuses to run with the message "ERROR: Main data files have been tampered with." BEAMSPEC.DAT - Beam weapons [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each weapon (10) a record of 36 bytes: +0 20 BYTEs Name +20 WORD Cost (mc) +22 WORD Tritanium needed +24 WORD Duranium needed +26 WORD Molybdenum needed +28 WORD Mass +30 WORD Tech Level +32 WORD Kill value +34 WORD Damage value ENGSPEC.DAT - Engines [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each engine (9) a record of 66 bytes: +0 20 BYTEs Name +20 WORD Cost (mc) +22 WORD Tritanium needed +24 WORD Duranium needed +26 WORD Molybdenum needed +28 WORD Tech Level +30 9 DWORDs Fuel used to travel 1 month at the given speed, for each warp factor, for a 100000 kt ship Fuel usage: Fuel used to travel d light years with a ship of m kt at speed v: d * m * X(v) d N = ÄÄÄÄÄÄÄÄÄÄÄÄ t = ÄÄÄ v*v * 100000 v*v N is the fuel required, t the time required (E.T.A.) and X(v) is the value from the table above. When travelling longer than 1 month (t>1), the fuel usage is calculated again each month since the ship mass changes (less Neutronium aboard). HULLSPEC.DAT - Starship Hulls [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each hull (105) a record of 60 bytes: +0 30 BYTEs Name +30 WORD Number of picture in RESOURCE.PLN Some pictures are used more than once, but with a different palette (e.g., Super Transport Freighter + Merlin Class Alchemy Ship + Neutronic Refinery Ship). I don't know where this information comes from, it seems to be hard-coded. +32 WORD =1. In VPCPLAY.BAS this field is identified as `image of a heavily damaged ship'. May be this is an information used by PLANETS/VCR to shift the palette. +34 WORD Tritanium needed +36 WORD Duranium needed +38 WORD Molybdenum needed +40 WORD Fuel tank size +42 WORD Crew size +44 WORD Number of engines +46 WORD Hull mass (empty) +48 WORD Tech Level +50 WORD Cargo room +52 WORD Number of fighter bays +54 WORD max. Number of torpedo launchers +56 WORD max. Number of beam weapons +58 WORD Cost (mc) Information whether a hull has a cloaking device is hard-coded in PLANETS.EXE / SHIPS.EXE / HOST.EXE. The following hulls always have a cloaking device: 21 22 25 26 27 28 29 31 32 33 36 38 43 44 45 46 47. Information on Gravitonic Accelerators and other 'bells and whistles' is also hard-coded and can't be changed in custom ship lists. The number of possible starship hulls needs to be 105 or less, although the game concept would allow up to 220 different hulls. The host simply refuses to build ships with a higher number. LANG.PLN - Host Language [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains texts used in screen messages and messages sent to players from the Host. The file is required by Host 3.22.012 and later. The current version contains 990 records but not all of them are actually used. Probably the file size will change in the future. +0 100 BYTEs unused +100 990 RECORDs of 6 bytes each, describe the strings. This field is indexed from 1 onwards: +0 DWORD location of string in file, as usual "+1" +4 WORD Length of string +6000 n BYTEs the strings (raw data, always N bytes where N is the length of the string - no BASIC strings filled with spaces). The strings are not encrypted. Tim Wisseman supplies a PD program to create/modify this file (pcklang1.bas). The strings may contain carriage returns. Some use 0Dh 0Ah as line feed character (screen messages), others use a single 0Dh (subspace messages). MISSION.INI - WINPLAN - Missions ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This text file contains definitions for the "extended" missions that may be accessed via the M.I.T. window in WinPlan. Each line of the file has the following format: ### Name..... * # /123456789ab ĄĀŁ ĄÄÄÄĀÄÄÄŁ ³ ³ ĄÄÄÄÄÄÄÄÄÄÄĮ If specified, the races that can use this ³ ³ ³ ³ mission, otherwise all races can use it. ³ ³ ³ ĄÄ If specified, the mission requires a Tow parameter ³ ³ ĄÄÄÄ ditto for the Intercept parameter ³ ĄÄÄÄÄÄÄÄÄÄ Name of the mission ĄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Mission number (ASCII number, exactly the first 3 columns are evaluated) PLANETS.NM - Planet names ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each of the 500 planets 20 characters. PLNHELP.DAT - Help texts ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 600 BYTEs Records of 6 bytes each +0 DWORD Address of text in this file + 1 +4 WORD Length of text in bytes +600 y BYTEs Help texts This file has a similar structure as the message file (MDATAx.DAT). Only the ®CountÆ field is missing, the number of records is always 100. The texts are encrypted like the messages: Each ASCII code is increased by 13. Line ends are encoded as Line feed + Carriage return (0D 0A). Some help texts contain the text 'RESERVED ... nn'. Of course, they don't appear in the program. RACE.NM - Race names ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 330 BYTEs Long form of 11 names (30 chars): "The Robotic Empire" +330 220 BYTEs Short form of 11 names (20 chars): "The Robots" +550 132 BYTEs Adjective of 11 names (12 chars): "Robotic" Umlauts and other characters with a code >= 80h can be entered into RACE.NM (using the NAMERACE program), but the Host replaces these characers with spaces in his Log files and messages. PLANETS.EXE can't handle these characters and simply doesn't display them. REG.KEY - WINPLAN - Registration Key ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ (Read-only Information. I could give more information, but I don't want that every wannabe is able to fake his own reg-key...) +0 50 BYTEs Name of user +50 50 BYTEs Address of user These values are entered when registered WINPLAN is run first after registering. Both are encrypted, by adding 13 to the ASCII codes. +150 DWORD Signature - 13: key is valid - 666771: key is valid, but must be unlocked by filling in the form displayed when WINPLAN is run. RESOURCE.PLN - Pictures ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ RESOURCE.PLN contains 151 images numbered from 1 to 151 (important if another file such as HULLSPEC references an image). Every picture consists of a 5537 byte record built up as follows: +0 WORD Width of image, always 105 +2 WORD Height of image, always 93 +4 n BYTEs For each scanline 4 byte sequences. Each of the byte sequences is ((Width+7) DIV 8) bytes long, in this case 4x14 bytes. The first seqence contains information for the color plane 0, where bit 7 is left. Then the color planes 1 to 3 follow. This matches the organization of VGA video memory (the BASIC commands PUT and GET normally work with memory dumps, like here). +x n BYTEs unused +5306 15 WORDs Color palette (see note below). +x n BYTEs unused. Non-existant for the last picture (#151). The Windows version doesn't use RESOURCE.PLN, the images are stored as single Bitmap files, as WINPLAN\BMP\vpl##.bmp, ## is a 1- to 3-digit bitmap number. There are 262 images following this scheme, most are new planet pictures. See also WPVCR.DLL. Additionally, there are the WINPLAN\BMP\VPAUX###.bmp files. These are used when reading messages from 3rd-party programs, see MDATAx.DAT. Notes on the Color Palette --------------------------- Planets uses the 16 color mode of the VGA card. from these 16 colors, 11 are fixed: Color ³ Red Green Blue ³ ĶĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶ 0 ³ 0 0 0 ³ Black 6 ³ 37 18 3 ³ Red 7 ³ 42 42 42 ³ Light gray 8 ³ 20 19 22 ³ Dark gray 1 9 ³ 0 0 62 ³ Light blue 10 ³ 12 55 12 ³ Light green 11 ³ 17 17 17 ³ Dark gray 2 12 ³ 58 0 0 ³ Light red 13 ³ 11 11 11 ³ Dark gray 3 14 ³ 60 59 0 ³ Yellow 15 ³ 57 57 57 ³ White Colors 1 to 5 may be defined for each single picture. For this reason, RESOURCE.PLN contains 5x3 WORDs that may have values from 0 to 63. The sequence is RED, BLUE, GREEN (not RGB, as usual). For ships as "Merlin" and "Neutronic Refinery" the sequence is different. I don't know where this information comes from. For planets, PLANETS.EXE uses the palette to change the images. Desert planets appear in sand colors while arctic planets appear cold as ice. In pictures for factories, defense and mines the ground has the same color as the planet so that the buildings always stay on a different ground. See also the section on planets below. Some images may not use the special colors 1 to 5: - 8 (scanner), always combined with a ship image - 21, 48, 52, 71, 83, 93, 94, 115, 126, 138, 151 (Logo), always combined with a race member (main menu) or ship image (build screen) Images of ships or planets may not use colors 6 to 10. In VCR, where 2 ships appear side by side, colors 1 to 5 of one ship are translated into colors 6 to 10, since a ship always needs the special colors. PLANETS.EXE doesn't do such translations, so that it needs to hide the planet picture by putting the scanner image (pic. 8) on it each time you request a visual scan from the planet or base screen. Assignment of the images ------------------------- All pictures not listed in the tables below are starship or planet images, see also HULLSPEC.DAT. Race ³ Logo ³ Person ³ Fighter ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶ 1 (Feds) ³ 21 ³ 22 ³ 34 2 (Lizard) ³ 48 ³ 44 ³ 81 3 (Bird Men) ³ 52 ³ 53 ³ 82 4 (Fascist) ³ 71 ³ 70 ³ 82 5 (Privateer) ³ 83 ³ 75 ³ 80 6 (Cyborg) ³ 93 ³ 91 ³ 92 7 (Crystal) ³ 94 ³ 95 ³ 96 8 (Empire) ³ 115 ³ 116 ³ 111 9 (Robot) ³ 126 ³ 127 ³ 125 10 (Rebel) ³ 138 ³ 139 ³ 130 11 (Colony) ³ 151 ³ 150 ³ 145 Pic. ³ Meaning ĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ 8 ³ Scanner Screen 23 ³ Starbase 30 ³ unused ship picture (*) 35 ³ Defense Post 36 ³ Factory 37 ³ Mine 38 ³ Planet for Mining Survey 51 ³ Explosion (VCR) 43 ³ unused planet picture A note on picture 30: This image is not used in the hullspec. Anyway, it is required. In one turn, I got 2 VCRs. In both I fought against a Nebula Class Cruiser. Once, it used picture #16 (normal), once #30. For exactly the same ship! Mystery... Planet pictures ---------------- To display a planet picture, the temperature and ID number are needed: INDEX := ( [Temperature_Value] + [ID_Number] ) MOD 13 The Temperature_Value is the value stored in the planet record, not the Fahrenheit temperature. Each of the Index values equals one planet picture: INDEX ³ Planeten-Picture(s) ĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ 0 ³ 1 1..4 ³ 39 .. 42 5..7 ³ 2 .. 4 8..12 ³ 24 .. 28 The palette (special colors 1-5) are calculated separately. SCRAM21.OLE - WINPLAN - Registration Protection ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ (Read-only Information. I could give more information, but I don't want that every wannabe is able to fake his own reg-key. Tim might not like this...) +178 311 DWORDs VPH Array, Part A +3710 311 DWORDs VPH Array, Part B Only these both fields are important, SCRAM21.OLE doesn't contain information that couldn't be retrieved from other files. An important thing is that each SCRAM21.OLE needs to correspond with it's REG.KEY. The both values are required for MAKETURN. Index into the array is the current turn number, which is decremented by 311 until the result is a value in the range 1..311. (VPH-ArrayA[X] XOR VPH-ArrayB[X]) give the record VPH_Record(X). The both values from this file are written to the TRN file, but are not necessarily identical to those of VPH35.DLL. Only the XOR result needs to be the same. STORM.NM - Names for Ion storms ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each possible Ion storm (50 = IDs 1 to 50) 20 characters. Ion storms of the classes 1-3 (Ion Disturbances) get an ID number only. Strong Ion Storms get a name corresponding with the ID number. TECH.MOF - Font ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ TECH.MOF contains 96 characters, the ASCII codes 33 (21h) to 128 (80h). These character have a constant height of 16 and are 0 to 16 pixels wide. Each character is encoded as 16 WORDs. Each of those has one bit set if the corresponding pixel is set, otherwise it is clear. The least significant bit is left (not right as in other picture formats). The width of each character is equal to the right-most pixel. That's why the space character for example can't be encoded in this format. The characters 64 and 125 to 128 differ from Standard ASCII: Code ³ ASCII ³ TECH.MOF ĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶŲĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ 64 ³ @ ³ not displayable 125 ³ } ³ Left arrow 126 ³ ~ ³ Up arrow 127 ³ DEL ³ Right arrow 128 ³ € ³ Down arrow TORPSPEC.DAT - Torpedoes [V] ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each torpedo launcher (10) a record of 38 bytes: +0 20 BYTEs Name +20 WORD Cost (mc for a Torpedo) +22 WORD Cost (mc for a Launcher) +24 WORD Tritanium needed for Launcher +26 WORD Duranium needed for Launcher +28 WORD Molybdenum needed for Launcher +30 WORD Mass of Launcher +32 WORD Tech Level +34 WORD Kill Value +36 WORD Damage Value Torpedoes always need 1 kt of each mineral to build and have a mass of 1 kt. TRUEHULL.DAT - Assignment Player <-> Starship Hulls ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ For each player (11) an array with 20 WORDs. Each WORD contains the number of a hull that the player can build (Index into HULLSPEC.DAT) or 0. VPH35.DLL - Version 3.5 Support ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ +0 343 BYTEs Useless bytes that try to fake a DLL. +343 311 DWORDs Array 1 +1587 266 BYTEs useless +1853 311 DWORDs Array 2 +3097 n BYTEs useless Record VPH_Record(N) of VPH35.DLL is ( Array1[N] XOR Array2[N] ) AND 7FFFFFFFh N runs from 1 to 311. For larger values, counting starts at the beginning, that is 312 => 1, 313 => 2 etc. The values in the file seem to be random numbers. While the Task Manager from Windows 3.1, a 4 kB file, can be compressed by 55% using PKZIP, this file which is 5 kB and should offer more redundant data, can only e compressed to save 1%. WPVCR.DLL - WINPLAN - Images for the WinPlan VCR ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Another faked DLL. The file contains the monochrome counterparts for the ship images in the Bitmap files. There are ships flying to the left and ships flying to the right. These are used in the VCR. --- Ships flying to the right --- +0 160 DWORDs Addresses of images in the file, as usual + 1. Some images are unused and contain address 0. +640 9 BYTEs unused +649 160 WORDs Sizes of these images +969 31 BYTEs unused --- Ships flying to the left --- +1000 the same 4 fields again. --- Images --- +2000 Here are the pictures addressed by the fields above. They are all complete 50x50 monochrome bitmap files. To display a picture, WinPlan copies the image to TEMP.BMP and displays that file. It is a real BMP file that can be edited with Paintbrush. XYPLAN.DAT - Planet Coordinates ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ See under Host Data. ALL CHECKSUMS AT A GLANCE ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ CONTROL.DAT CONTRLx.DAT ÄÄÄÄÄÄÄÄÄÄÄÄ +0 500 DWORDs Checksums for ships +2000 -"- Checksums for planets +4000 -"- Checksums for bases +6000 WORD 0 FIZZ.BIN ÄÄÄÄÄÄÄÄÄ +0 33 BYTEs 11 records of 12 bytes for each race, undefined if no data for that race. +0 DWORD Ship checksum = GENx.DAT value + 667 +4 DWORD Planet checksum = GENx.DAT value + 1667 +8 DWORD Base checksum = GENx.DAT value + 1262 +132 DWORD ? (deleted data) +136 51 DWORDs Registration signature GENx.DAT ÄÄÄÄÄÄÄÄÄ +0 18 BYTEs Timestamp (10 bytes date mm-dd-yyyy, 8 bytes time hh:mm:ss) +18 88 BYTEs 11 score records of 8 bytes each +106 WORD Player Id +108 20 BYTEs Password +128 BYTE 0 +129 DWORD Checksum of SHIPx.DAT/DIS +133 DWORD Checksum of PDATAx.DAT/DIS +137 DWORD Checksum of BDATAx.DAT/DIS +141 WORD 0, if the password has changed 0Dh +143 10 BYTEs New password (if any) +153 WORD Turn Number +155 WORD Timestamp Sum The values at 129, 133 and 137 are the sum of all bytes of the appropriate DIS- and DAT-files. TEMPLOCK.DAT ÄÄÄÄÄÄÄÄÄÄÄÄÄ 11 DWORDs with TRN file checksums, or 0 if no TRN file. Each sum is TempLock_Sum = File_Sum + (3 * Timestamp_Checksum) + 13 "File_Sum" = Sum of all bytes in the Turn file, without the checksum block. "Timestamp_Checksum" = see GENx.DAT. Static files ÄÄÄÄÄÄÄÄÄÄÄÄÄ The sum of all X coordinates of all planets in XYPLAN.DAT gives 998681. The sum of all bytes of BEAMSPEC.DAT, ENGSPEC.DAT, HULLSPEC.DAT and TORPSPEC.DAT gives 338817, where the listed files need to have exact sizes. Other Files ÄÄÄÄÄÄÄÄÄÄÄÄ The files SNOOKER.DAT and VPH35.DLL may need to be read or changed, since they contain more protection functions. The TRN and RST files also contain checksums. DATA OF 3rd PARTY PROGRAMS ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ A "packed" Pascal string is a byte giving the length and a number of bytes containing the string itself. An "unpacked" Pascal string is similar, but the number of characters is constant, it is padded with nonsense if necessary: 'Hello' packed: 05 48 65 6C 6C 6F unpacked with length 10:05 48 65 6C 6C 6F xx xx xx xx xx (undef.) AFSIM.SAV - AFSim - Saved simulation setup ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains a battle simulation saved in AFSim. Informer (a utility by the same author) can pass "real" simulation in this format to AFSim. +0 WORD Number of ships in the simulation +2 50 RECORDs of 54 bytes: ships in the battle +0 BYTE 3 (Length of Fcode) +1 3 BYTEs Fcode of ship +4 WORD ? (1000, for empty records 2000) +6 WORD Shields +8 WORD Engine (1..9) +10 WORD Hull (1..105) +12 20 BYTEs Name, a BASIC String. The name is assigned by AFSim if the ship data is changed. When exporting the battle from Informer, a "real" ship name is stored here. +32 WORD Damage% +34 WORD Crew +36 WORD Id (for empty records 1500) +38 WORD Owner (1..11, for empty records 15) +40 WORD Number of image in RESOURCE.PLN +42 WORD Beam Type (1..10) +44 WORD Beam Count +46 WORD ? (0) +48 WORD Torpedo Type +50 WORD Number of Torpedoes/Fighters +52 WORD Number of Torpedo launchers +2702 BYTE 3 (Length of Fcode) +2703 3 BYTEs Fcode of planet, if playing +2706 WORD Planet owner or 0 +2708 WORD Defense on planet +2710 WORD Starbase beam tech or 0 +2712 WORD Number of starbase fighters +2714 WORD Defense on starbase Unused ship records are filled with FFh, except for the fields at offset 4, 36 and 38. If there is neither a planet, nor a starbase playing, the last 14 bytes are 0. CC.RES - PCC - Resources ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ With this section I want to prevent that anyone tries to completely analyze my resource file... +0 2 BYTEs Signature 'RZ' +2 DWORD File offset of resource directory +6 WORD Number of entries in file Resource Directory ------------------- The RD contains a record for each entry of the file: +0 WORD ID Number +2 DWORD Location of entry in resource file +6 DWORD Size of entry in bytes The entries ------------ The entries in the file are identified by their ID number and are images of other files that have approximately (many) different formats: - compressed pictures - uncompressed pictures - Fonts with and without anti-aliasing - Help texts - Vector graphics - and the original .DAT / .NM files Before I forget: TITLE.CC is yet another compressed picture. In another file format... Since I didn't plan to disassemble the graphics engine and other interna of PCC here, I do not give further explanations. Well, and the file currently has approximately 400 entries and listing the assignment of ID numbers would get quite complicated. I will release a program to extract and change the images, if there is enough interest in PCC. HULLSPEC.CC - PCC - Extended Hull Specification ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file is in the PCC directory and remains constant (in most cases). When using a custom universe, it may be changed and placed in the game directory. PCC will then use that file. HULLSPEC.CC contains a record of variable length for each hull (105). That records describe additional hull features. Note that this information is used only to display in the `Build Hull' and ship mission screens (`Cloak'). They don't affect the real ship behaviour, the Host uses it's own information. It can lead to problems if a `normal' ship has the `Clock' bit set here, and the PCC interface is used to set the Cloak mission. This depends upon the Host (older hosts allow cloaking in this case, newer block it). If you use customized HULLSPEC.DAT and TRUEHULL.DAT, this file may be edited with CCSETUP. Each ship record has the following structure of variable length: +0 n BYTEs Short name of the hull, a packed Pascal String, max 12 chars. (for use in ship lists, e.g., "Nocturne") +n WORD Special capabilities of the hull: Bit 0 - Cloaking Bit 1 - Hyperdrive Bit 2 - Gravitonic Accelerators Bit 3 - Bio Scanner Bit 4 - Alchemy +n+2 m BYTEs Special capabilities that didn't fit into the above WORD, a packed Pascal string (e.g. "Chunnel"), for Alchemy ships a description of the reaction. CHARTx.CC - PCC - Starchart entries ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains information on various things that are on the player's starcharts and are archived over a few turns. +0 n BYTEs 500 records +0 WORD Color of planet (see below) +2 n BYTEs Description as packed Pascal string +n WORD Number of stored planets. All planets ever seen with a Sensor Sweep Mission or visited by a ship are stored here. +n+2 m BYTEs Records of 65 bytes each +0 WORD ID number of planet +2 WORD Owner, 0=unowned +4 4 DWORDs Minerals on surface (N, T, D, M) +20 4 DWORDs Minerals in ground (N, T, D, M) +36 4 WORDs Mineral density (N, T, D, M) +42 WORD Temperature +44 WORD Native race +46 DWORD Number of natives (Clans) +50 DWORD Number of colonists (Clans) +54 BYTE 1, if starbase exists, 0 otherwise +55 WORD Industrialization (1=light, 2=heavy, 0=unknown) +57 WORD Turn for information at +55 +59 WORD Turn for information at +4..+36 +61 WORD Turn for information at +46..+48 +63 WORD Turn for information at +52 If one of the turn numbers is 0, no information is available. The turn number it the age of the newest value in each group. +y WORD Number of mine fields. All minefields ever seen are stored here. The original size is saved, PCC always calculates the current size itself. +y+2 @ BYTEs Records of 16 bytes each +0 WORD Id +2 WORD X +4 WORD Y +6 WORD Owner +8 DWORD Number of mine units +12 WORD Type 0 Normal Mines 1 Web Mines +14 WORD Turn of last information on this field +n WORD Number of user paintings in starcharts +n+2 x BYTEs Records of 10 bytes each +0 BYTE Type of element 0 Line 1 Rectangle 2 Circle +1 BYTE Color +2 WORD X1 +4 WORD Y1 +6 WORD X2 (Circles: radius) +8 WORD Y2 (Circles: unused) Colors in PCC -------------- 1 Dark gray 2 Light gray 3 Green 4 Red 5 Dark green 6 Light blue 7 Blue 8 Dark blue 9 Yellow 15 White 128..137 Additional colors in 256 color mode. Displayed as white in 16 color modes. Values not shown here give undefined results. MESSx.CC - PCC - Signature and sent messages ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains the template for messages from the appropriate player (the "signature"), and sent messages if the PCC file format is used (n/a yet). +0 656 BYTEs Message template. 16 pascal strings with up to 40 characters (16 x 41 bytes). For messages to a single player, this information is copied into the message text directly. Messages to more than 1 player have one line less (used for "CC: xxx" or "<<< Universal >>>"), so line 9 of the template is left out. +656 WORD Number of sent messages +658 n RECORDs of variable length: +0 WORD Addressees (Bitfield, Bit 0=player 1, to Bit 10=player 11, Bit 11=Host) +2 WORD Length of text +4 n BYTEs Text in the usual encoding, without title line ("<<< Universal >>>" etc.) OBJx.CC - PCC - Objects in the starcharts ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The file consists of several chunks of variable length. It ends with a block with all values 0. The file contains the unpacked version of the WinPlan part of a RST file. Records that were empty in the WinPlan file do never appear here. +0 WORD Number of records in this chunk +2 WORD Type of record 0 End of File 1 UFO 2 Target 3 Explosions 4 Ion Storms 5 Mine fields others are reserved and ignored +4 WORD Size of one record of this kind --- Records --- ž For UFOs ID Number + UFO records as in UFO.HST, 80 bytes per record ž For Targets normal TARGETx.DAT records (the ones exceeding the 50 targets limit of DOS Planets), 34 bytes / record ž For explosions 6 bytes/record +0 WORD ID (ignored) +2 WORD X +4 WORD Y ž For Ion storms 14 bytes/record +0 WORD Id +2 WORD X +4 WORD Y +6 WORD Radius +8 WORD Voltage +10 WORD Warp +12 WORD Heading ž For Mine fields 10 bytes/record, as in the WinPlan RST file +0 WORD Id +2 WORD X +4 WORD Y +6 WORD Radius +8 WORD Owner (1..11), 12=Crystal Web Mines PVIEW.NTP - PView - Notepad ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains notes on an object (notepad function). Addresses into the file use 0 as file start as usual. This file exists once per directory. +0 500 DWORDs Addresses of notes for planets 500 DWORDs Addresses of notes for ships 50 DWORDs Addresses of notes for Ion storms The addresses are 0 if there is no note for that object +4200 n BYTEs Notes. Each note entry is 10 unpacked Pascal strings of length 40, so each note is 410 bytes total STAT.CC - PCC - Statistics ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file exists once per directory, even for more than 1 player. PCC expects all information coming from the same game, the original Planets also expects this. The scores from that player data are stored in STAT.CC and can be called on several places in the game. +0 8 BYTEs Signature "CC-Stat"^Z +8 WORD Number of entries in file +10 WORD Size of a record. If the size of a record is expanded some day, old files can still be read. +12 x RECORDs of N bytes. The current size is 130 bytes: +0 WORD Turn Number +2 10 BYTEs Date mm-dd-yyyy +12 8 BYTEs Time hh:mm:ss +20 88 BYTEs 11 records of 8 bytes each +0 WORD Planets of 10 points each +2 WORD Capital Ships of 10 points each +4 WORD Freighters of 1 point each +6 WORD Bases of 120 points each +108 11 WORDs Priority Build Points VPAx.DB - VPA - Database ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file contains history and other information of the VGA Planets Assistant. The file begins with a signature: +0 15 BYTEs 'VPA Database',13,10,6 Then, for each turn, a block follows. It has the following structure: +0 4 BYTEs Block name = 'TURN' +4 DWORD Size of data (counted from offset 116 onwards) +8 WORD Turn Number +10 18 BYTEs Timestamp of turn +28 11x4 WORDs Scores (see GENx.DAT) +116 n BYTEs Data The Data block consists of several Sub Blocks containing various information: +0 4 BYTEs Block name +4 DWORD Total size of data (offset 10) +8 WORD "Count" Number of elements (=ships, planets, ...) in the block, if more than 1 are possible. 0 otherwise (e.g., for PBPs). +10 n BYTEs Data The following paragraphs describe the various sub-blocks in the file: ž "BASE" - Starbase data Contains information on starbases (records as in BDATAx.DAT) ž "EPLN" - Planet information 500 records of the following structure, one per planet. The Count field is 500. +0 WORD Owner of planet, 0=unknown +2 WORD Flags. Bit 7 Starbase exists Bit 6 ??? (Planet was scanned?) ž "NPLN" - ??? 500 records of 1 byte each. Has something to do with planets... ž "PBPS" - Priority Build Points Contains 11 WORDs with the PBPs of the players. A value is -1 if the race doesn' play or the number is unknown. The Count word in the block header is 0. ž "PLAN" - Planet data This block contains the information of PDATAx.DAT and information on scanned planets. Normal planet records are used, unknown values are set to -1. ž "SHIP" - Ship data Contains data for all starships, same as SHIPx.DAT, plus all scanned ships. Normal ship records are used, unknown values are -1. ž "VCRS" - VCR records ž "VERS" - VPA Version Number The Count field in the header contains the version number, encoded as 351dec for 3.51. The data area itself is empty (size 0). ž "XYPL" - Planet Coordinates 500 records with an X and Y WORD each. HOST RUN ĶĶĶĶĶĶĶĶĶ ...which takes approx. 2 to 2« hours on a 286/12 with 400 ships, 400 planets and 40 bases. On a Pentium-75 with 2 MB write cache one minute (without the cache 3.5 minutes). Recommendation... buy a coprocessor. There are people among us that calculate n^2 = exp(2 * ln(n)) The Host program directly depends on PLANETS.EXE - or vice versa. For example, host limits waypoints to approx. 200 light years since DOS PLANETS.EXE can't display more. PLANETS.EXE in turn assumes to get only those waypoints, otherwise it crashes with an "Illegal Function Call". - Loading planets, ships and starbases - Universe Mass Check One - Add all minerals a player owns. - Loading and executing TRN files (=making Host files the same as the player files, but not execute missions and mineral transport involving a Freight Transporter). After this step, the Host has exactly the same files as the players. Even before this: extracting the TRN file attachments. - Universe Mass Check Two - Compare the sums of the minerals against the sums from Check One. The Mass Check compares each single mineral so it isn't possible to turn one mineral into another. However, it is possible to "beam" minerals from one planet to another. - Data Status Message: >> GREEN << - Everything O.K. >> YELLOW << - Smaller errors, e.g., minerals disappeared >> RED << - Larger errors, e.g., minerals appeared from nothing If minerals appeared, a message indicating how many it was is printed and the mineral amount on the planet is DECREASED instead of INCREASED. So you CAN NOT use external Meteor programs. Why Tim still delivers a METEOR.EXE with his distributions? - If one of the files AUXHOST1.EXE or AUXHOST1.BAT exist in the Host directory, all data is saved and the file is executed. If AUXHOST1.INI exists in the game directory, it is executed line by line. - Meteors - De-Cloaking of ships if their cloaking device fails or they are influenced by a Loki - Super Spy Deluxe - Change Fcodes - Freight Transfer - Ship to Planet - Ship to Enemy Ship - Transfer using Friendly Codes ('bdm' etc.) - Gather Missions - Alchemy Ships - Laying mines - Ion storms - Moving, Joining - Affecting ships - Messages - New storms (+Messages) - Mine sweeping - Minefield functions - Finding Fcodes - Webmines: fuel draining - "CHEAT.EXE detect", prevents buying more than Tech 6 in the Shareware version You get your tech downgraded and your money back. - Ship repairing - Building new ships - Cloning ships - Federation Super Refit Mission - Surrendering at starbases - Privateer Rob Ship Mission (might happen before surrendering) - Movement ("Figuring mass of all ships" for fuel usage) - Intercept Missions - Glory Device - Loki Anti-Cloak, part 2 - Starbase functions (free fighters etc.) - Colonize Missions ("Figuring mass of all ships" for recycling and shield strength) - AUXBATT interface. If the file AUXBATT.INI exists in the game directory, Host doesn't perform combat but executes AUXBATT.INI as a Batch file. If a file AUXBC.INI exists, it is run before the combat; if afterwards still a combat is detected, Host performs it (AUXBC.INI from Host 3.22 onwards). - Ship to Ship combat - Ship to Planet combat ("Figuring mass of all ships" for Shield strength) - Terraforming Missions - Fascist Pillage Planet, Rebel Ground Attack - Planetary production (population grows, factories, mines) - Super Spy Mission - Spy Friendly Code - Message Transfer - If one of the files AUXHOST2.EXE or AUXHOST2.BAT exist in the Host directory, all data is saved and the file is executed. If AUXHOST2.INI exists in the game directory, it is executed line by line. - Make RST files ADVERTISEMENTS ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ Of course, I will use this location to advertise for my own VGA Planets programs ;-) Most of them are Freeware - and are based on this information. ADDMSG - Message Sender ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Sends a message to a player, after the host has run. This is a program for the host. ADDMSG can be used, for example, to send the scores of an alternate scoring system (VGASCORE), or send a "flame" to cheating players. The message is put directly into the RST, without using the Host files. EXP - Crew Experience ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Creates reports on the experience values of ship crews. This is a program for hosts. If you do not keep these values secret as the rules want it, you can get the values with EXP. The players can't get experience reports from their own data only, the Host data is required. GH - Game Host Shell ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A comfortable interface for hosts. The most important options are copying RSTs and TRNs to/from diskettes without needing to touch the keyboard. Then there are functions to call the most important host utilities (HConfig, SendMess), to read the Log files and, of course, to call the Host itself. Optionally, an alternative scoring system (VGASCORE) may be used. KILLRACE - Kill a Race ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Removes a race/player from the game quick and easy. All remains of the race are removed: Planets, ships, bases, minefields. This is a program for hosts, but requires the player's password for security reasons. PCC - Planets Command Center ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ My largest VGA Planets project until now. A new, fast, graphical user interface completely replacing PLANETS.EXE. Contains many comfortable functions and complete mouse support, but uses the same keystrokes as Planets in most cases (such as "H"=Help) <<< Still under development >>> SWEEP - Clean up... ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Somewhat more flexible than Tim's SWEEP.BAT: delete only one player, delete WinPlanets data etc... U-ED - Universe Editor ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Still under development: A program to edit Host data, with the option to make a universe from player data only - for 100% realistic battle simulations. Uses the PCC interface: completely mouse-driven etc. UN-TRN - Turn File Un-assembler ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Extracts all commands from a Turn file. If you want to know what Planets does with your game. One of the most important tools writing this list... UNPACK - Result File Unpacker ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Replaces the original UNPACK. This UNPACK is approx. 10 times faster than the original and offers you (among others) not to delete the RST file after unpacking it. UNPACK is included with the PCC package, the code is also contained in the PCC program. VIEWMESS - Message Display ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A quick program to show incoming and outgoing messages. Includes an option to print and archive the messages. My first planets program - without password support... VIEWSHIP - Ship Viewer ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ A program to display ships in the game. Usable for both Hosts and players - it simply displays everything it can find. ...plus several Trick and Cheat Programs... ;-) AUTHOR & COPYRIGHT ĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶĶ This list was created by Stefan Reuther in the years 1995 to 1997. Hereby, I donate it to the PUBLIC DOMAIN. That is, you may do anything with it: copy it around, change it, translate it... But if you change the list or your new product is based in large parts on this list, a reference to the original should not be missing. If you have new information, bugfixes etc. and send them to me, I will add them to the next release. YOU GET THESE DOCUMENTATION FILE ON AN "AS IS" BASIS, WITHOUT ANY WARRANTIES, THAT IS, EVEN WITHOUT A WARRANTY FOR THE CORRECTNESS, UNDERSTANDABILITY AND CORRECTNES OF THE INFORMATION GIVEN. YOU USE THE INFORMATION AT YOUR OWN RISK. YOU ARE RESPONSIBLE FOR ALL DAMAGE DONE TO YOU USING THIS INFORMATION. IN NO CASE THE AUTHOR, Stefan Reuther, MAY BE HELD RESPONSIBLE FOR THIS. Well, the information seems to be somewhat correct - I've been using much of this for a long time now. If you don't believe this, I refer you to C:\DOS\DEBUG.EXE and C:\NU\DISKEDIT.EXE. If you want to contact me for whatever reason, mailto:Streu@gmx.net (Stefan Reuther) Updates and (soon) some other VGA Planets stuff will be released on my web page http://www.inf.tu-dresden.de/~sr21 (currently under construction). Oh, remember: VGA Planets is (c) copyright and (tm) Trademark by Tim Wisseman. -EOF-