|
||||||||||||||||||||||||||||||
The "Read As" column refers to how the bytes
on the left must be interpreted (little-endian layout):
|
The Equipment (EQP) file The PG2 equipment file has not a fixed size. This file holds all the data for every unit. Its size depend upon the number of units in the file. Along with the *.EQP file is a *.TXT with the same name, that hold all the names of the units. The equipment files (.eqp + .txt) must be on main game directory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bytes | Read as | Meaning | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | word | Number of units in the file. Depending on game patch you use this can be < 1000 for SSI 1.0x < 2000 for unofficial patch 102G < 4000 for unofficial patch 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Equip rec | #items x 73 bytes each | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If
the equipment file uses the +5 countries
extension allowed when using the patch 2.10,
the game needs 5 additional country names. Add the 5 country names at the end of the GUI97.TXT file (line 441-45). If the game finds >= 124 pictures in FLAGS1.SHP file the new country names will be used. To show the correct unit class name in the INSPECT UNIT and HQ screen, change also line 139 and 146 this way: 139: replace “Panzer General II" with "FlaK" 146: replace “Panzer General II" with "Level Bomber" 441: name of country #27 … 445: name of country #31 so you should have a GUI97.txt file with 445 lines instead of the 440 lines.> |
The Campaign (CAM) file The PG2 campaign file is always 31944 byte big. It can hold a maximum of 50 scenarios as it is. The campaign files has to be in the SCENARIO directory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bytes | Read as | Meaning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | word | Number of scenarios in campaign | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | word | Prestige points for player at start of campaign. If prestige goes higher then 65535 it will role over to 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | Arrav of char | Winning the campaign SMK filename | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | Array of char | Loseing the campaign SMK filename | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31800 | Scenario Data | 50 scenarios x 636 bytes each | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20 | Array of char | TXT filename for campaign intro | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
78 | byte | Unknown | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | byte | country flag to show on list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | byte | Unknown |
The map definition (MAP) file The PG2 map file is always 14561 byte big. It defines hexes attributes and the image to link The map definition files must be in the SCENARIO directory Built in game editor cannot be used (it will crash the game) if you have 200 or more .map files on the folder but to play it doesn't matter how many you have. | |||||||||||||||||
Bytes | Read as | Meaning | |||||||||||||||
2 | word | Map's image number, links this file with the MAP*.SHP files making up the imapge for the map. | |||||||||||||||
2 | word | X size, but game dos not use this value, real size is taken fron image size. | |||||||||||||||
2 | word | X size, but game dos not use this value, real size is taken fron image size. | |||||||||||||||
2 | ?? | Unknown | |||||||||||||||
2 | ?? | Unknown | |||||||||||||||
12600 | Hex data | 45 x 40 hexes x 7 bytes each one | |||||||||||||||
|
|||||||||||||||||
8 | ?.. | Unknown | |||||||||||||||
1753 | ?.. | Unknown |
The PG2 picture map file
is made up to 12 .SHP files each holding a piece of
the map up to 640x480 pixels. All the SHP files are named like Map#xy.shp, where [#] is the map link number (at least 2 dˇgits 0 padded), [x] the column number, and [y] the row number, The biggest size allowed is 1920x1920 pixels which makes 12 tiles arranged this way
|
The panzer2 (DAT) file The PG2 panzer2 file has not a fixed zˇsize. It holds all files the game needs to make up the interface, like GAME.PAL, interface SHP files and all unit's icons SHP files. The panzer2 file must be in the root game directory. | |||||||||||
Bytes | Read as | Meaning | |||||||||
4 | DWORD | Number of files included | |||||||||
Variable | Items dictionary | #items x 17 bytes (there is a record for each file included plus an empty entry at the end) | |||||||||
|
|||||||||||
Variable | SHP file | each file
included into the dictionary plus an empty one Most of them are shape (SHP) files, but it really can hold any file. GAME.PAL file should be included |
GAME.PAL file
hold the palette to be used - it is 1024 bytes size. It is a binary file with 256 contiguous records Each record is 4 bytes long containing red, green and blue components padded to 32 bits boundary (4 bytes) for each palette index. |
The sound (MEL) file The *.MEL file is the one holding all the unit sound, and some game sound. 10xx.mel, 20xx.mel and 30xx.mel are unit sound, selectable via the equipment file. 1.mel holds the sound when you click the mouse, and 5000.mel is for very low dark rumbling sound, not sure where its used. This is also the only file that has set repeat itself to endless (same as 0xFFFFFFF). The *.MEL files are on PCM RAW format - 16bit 22050 mono. and cannot be larger then 870-950Kb. If they are the game refuse to play it. | ||
Bytes | Read as | Meaning |
4 | ???? | unknown |
4 | DWORD | 1# Sample rate (prime sample rate) 0x00002B11=11025 0x00003E80=16000 0x00005622=22050 0x000061A8=25000 0x0000AC44=44100 0xFFFFFFFF=use random rate between 2# & 3# sample rate. |
4 | DWORD | 2# Sample rate (Random sample rate start) |
4 | DWORD | 3# Sample rate (Random sample rate end) |
4 | DWORD | Repeat 0 = Endless 1 = 1 time (normal) N = N times |
4 | ???? | unknown |
Variable | DWORD | Raw data 16 bit Every sample is 4 byte (Dword=16bit) and just go on like this to the end. |
Sample rate under 3000 is not really usefull. If 1# sample rate is 0xFFFFFFFF the a random sample rate is selected between 2# and 3#, every time a unit using that sound does something. |
The music (MUS) files The *.MUS file is the one holding all the sound you hear to the intro/victory txt for a campaign. All *.MUS files are plane simple RAW 8/16bit data. There is no sample rate header like in the *.MEL file, so they all have to be in PCM RAW format - 8bit 22050 stereo. Except the xxplay1-2.mus files they are in 16bit 22050 stereo. | ||
Bytes | Read as | Meaning |
Variable | word | Raw data 16 bit Every sample is 4 byte (Dword=16bit) and just go on like this to the end. |
The Scenario (SCN) file The PG2 scenario file has not a fixed size, its size depend upon the number of units in the file. Along with the *.SCN file is a *.TXT with the same name, that hold all the names for units and terrain, even if there ar no units nor terrain renamed this file is needed cause the first line defines which title will be shown for the scenario. Scenarios can be set as hidden (they don't show on scenario list) usualy when they belong to a campaign. They can be set also as "UseMade" scenarios (they show up blue on the list) which is the default for those scenarios made using built-in editor. Scenarios should be located on SCENARIO directory, unless they are UserMade type. UserMade type are expected to be located on USERSCEN folder instead. The scenario files (.scn + .txt) included in a campaign must be placed on the scenario directory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bytes | Read as | Meaning | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | Scenario Data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | Players | 4 players x 97 bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10800 | Map Hexes | 45 x 40 x 6 bytes | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
140 | Map Data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Units | 65 bytes each unit, up to 100 units per player | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Campaign Savegame (CSV) file This PG2 savefile has not a fixed size, its size depend upon the number of units in the file and the number of turns played. This files are located on SAVE folder. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bytes | Read as | Meaning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
268 | Savegame Header | Common struct for all savegames types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24 | Players status | 6 bytes x 4 players | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22 | Scenario Data | it is a copy of the scenario file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
388 | Players | It is a copy of the scenario file section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10800 | Map Hexes | It is a copy of the scenario file section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
140 | Map data | It is a copy of the scenario file section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42 | Set Up | here is the current basic setup data read at the start of each turn. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44 | Blown Bridges | Each bridge status. 0 = Ok, 1 = Blown | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Each byte refers to a bridge on the internal bridge table stored into the executable. file. The max number of bridges on any of the original SSI maps is indeed 44, this is why this section is 44 bytes big. Thats map 18. The numbers is simply representation of the way the graphic is lined up in BR_xx.shp, which again link directly to the order of X,Y in the execute file bridge table. When a bridge is blown graphic BR_xx.shp from Panzer2.dat is drawn instead. This doesn't work with any release bigger than 1.02 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
720 | Leaders | 12 bytes x 15 leaders x 4 players | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
856 | Dossier | 214 bytes x 4 players | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 | byte | HQ status ( 0 = In Scenario, 1 = In HQ ) This ref. to where you currently are. HQ is where you can over strength and upgrade. ONLY core units can be upgraded or over strength here. Works in all savegame types. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9999 | ?.. | Unknown. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Name Table 1 | Names defined on scenario TXT file | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This table contents everything from the TXT file, with the same name as the
used scenario file. Everything from this file is included,
regardless of any hex or unit actually uses the name. There is a first word defining how many items you should iterate, and then a list of items. If that number is 0, then there are no list of items and next word is the lenght of Name Table 2 Each entry is not fixed size, but it has all info needed to read it. You should iterate until all entries are read.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Name Table 2 | Names of units that get changed during a game. It has no fixed size | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There is a first word defining how many items you should iterate, and then a list of items..
If that number is 0, then there are no list of items and
next byte is number of items for Units byte Each entry is not fixed size, but it has all info needed to read it. You should iterate until all entries are read.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Units | 65 bytes each unit, up to 100 units per player | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
149 | Campaign Data | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | Units Honors | 5 bytes x 100 units x 4 players units battle honors. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Number represent the scenario it was given in.
The game will only display as many of them as the experience bars the unit has,
so it does not help to set all 5 of them if the unit does not have the bars,
they will not be displayed. If more BH carry the same scenario number
they will be displayed on the same line.
Note scenario numbers are normally counted in 0-49, while battle honors
number are counted in 1-50.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10000 | Scen Names | 200 bytes x 50 scenarios titles. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
500 | ?.. | Unknown. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 | Section 2 header | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Second part ... | A complete savegame consist of the current stats, that is the first part, - always on top of the file. The second part is the stat before the current turn. The 'section 2 header' is ONLY found in the first part of the savegame NOT the second part, understandable enough since this section describes the 2nd part of the savegame! The 'replay' section is found at the bottom of Part 2 of the savegame, and thus is NOT included in any of the two parts, but is a independent section, that actually describes the different between the two parts of the savegame. Part two + the 'replay' should be the Part one stats. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variable | Replay | Action codes | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is made by a series of action codes.
Near everyone is different in length (byte)
Every action of your unit is recorded. The byte in (xx) is the total
length of that action, including the action code it self. As one can
see this section is a LONG way from complete explored. It's going to
take some time before I am finished with this.
|
Play by e-mail Savegame (EML) file This savegame is particle sensitive to wrong setting from the original scenario its created from. Some settings in scenario can crash the PBEM savegame during replay, where in other savegames such setting will go unnoticed. Normally PBEM savegame consist ONLY of these two section. Different turns are NOT stored on top of each other. ONLY the current and the last turn is stored. However there is a bug in PBEM, where the file suddenly begins to grow turn for turn. this is caused by the fact that different version CANNOT play against each other. IF two different versions play against each other, like v1.00 vs. v1.02 each version will include its own two Parts, just putting them on top of each other. This also results in the 'replay of your own previous turn', where, if you replay the turn, see you own previous turn replay, instead of the correct current turn of the enemy. The correct replay IS in the savegame, but because each version reads from its own stored Parts, it replays your own replay. NEVER play against each other with different version, not only is there rule changes from version to version, but also this weird replay thing will happen. If a PBEM savegame grows over 100K you got such a case. Also unlike the other savegame the replay section is viewable from in-game, by using the replay bottom. | |||||||||||||||||
Bytes | Read as | Meaning | |||||||||||||||
268 | Savegame Header | Common header for all savegames | |||||||||||||||
24 | Players status | 6 bytes x 4 players * Same as defined for CSV | |||||||||||||||
22 | Scenario Data | it is a copy of the scenario file | |||||||||||||||
388 | Players | It is a copy of the scenario file section | |||||||||||||||
10800 | Map Hexes | It is a copy of the scenario file section | |||||||||||||||
140 | Map data | It is a copy of the scenario file section | |||||||||||||||
720 | Leaders | 12 bytes x 15 leaders x 4 players * Same as defined for CSV | |||||||||||||||
42 | Set Up | Setup data read at the start of each turn. * Same as defined for CSV | 44 | Blown Bridges | Each bridge status. * Same as defined for CSV | ||||||||||||
856 | Dossier | Same as defined for CSV | |||||||||||||||
1 | byte | HQ status ( 0 = In Scenario, 1 = In HQ ) This ref. to where you currently are. HQ is where you can over strength and upgrade. ONLY core units can be upgraded or over strength here. Works in all savegame types. | |||||||||||||||
9999 | ?.. | Unknown. | |||||||||||||||
Variable | Name Table 1 | Same as defined for CSV | |||||||||||||||
Variable | Name Table 2 | Same as defined for CSV | |||||||||||||||
Variable | Units | 65 bytes each unit, up to 100 units per player Same as defined for CSV | |||||||||||||||
84 | Passwords | 21 bytes (null terminated string) x 4 players | |||||||||||||||
| |||||||||||||||||
17 | Section 2 header | Same as defined for CSV | |||||||||||||||
Variable | Second part ... | Similar as dedˇfined for CSV. | |||||||||||||||
Variable | Replay | Same as defined for CSV |
Single Savegame (SAV) file This format is similar than those described before, but a little simpler | ||
Bytes | Read as | Meaning |
268 | Savegame Header | Common header for all savegames |
24 | Players status | 6 bytes x 4 players * Same as defined for CSV |
22 | Scenario Data | it is a copy of the scenario file |
388 | Players | It is a copy of the scenario file section |
10800 | Map Hexes | It is a copy of the scenario file section |
140 | Map data | It is a copy of the scenario file section |
42 | Set Up | Setup data read at the start of each turn. * Same as defined for CSV | 44 | Blown Bridges | Each bridge status. * Same as defined for CSV |
720 | Leaders | 12 bytes x 15 leaders x 4 players * Same as defined for CSV |
856 | Dossier | Same as defined for CSV |
1 | byte | HQ status ( 0 = In Scenario, 1 = In HQ ) This ref. to where you currently are. HQ is where you can over strength and upgrade. ONLY core units can be upgraded or over strength here. Works in all savegame types. |
9999 | ?.. | Unknown. |
Variable | Name Table 1 | Same as defined for CSV |
Variable | Name Table 2 | Same as defined for CSV |
Variable | Units | 65 bytes each unit, up to 100 units per player Same as defined for CSV |
17 | Section 2 header | Same as defined for CSV |
Variable | Second part ... | Similar as dedˇfined for CSV. |
Variable | Replay | Same as defined for CSV |