Header Format
From Populous Wiki
The Header (.hdr) is a Populous Level File which contains the level's attributes.
Spells
The three bytes starting at byte 0 defines which spells are available at the start of the level. Each of the eight bits of the byte represent one spell. If the bit is on the spell is available.
Byte 1
In this example (Hex 27), Blast and Swarm are available.
00100111 ||||||||--Leave on |||||||---Leave on ||||||----Blast |||||-----Lightning ||||------Tornado |||-------Swarm ||--------Invisibility |---------Hypnotise
Byte 2
In this example (Hex 54), Earthquake, Landbridge and Erode are available.
01010100 ||||||||----Firestorm |||||||-----Ghost Army ||||||------Erode |||||-------Swamp ||||--------Landbridge |||---------Angel of Death ||----------Earthquake |-----------Flatten
Byte 3
In this example (Hex F4), no spells are available. The other bits should be left unchanged.
11110100 | ||----Volcano | |-----Convert | |-------Magical Shield
Buildings
Building availability is handled in the same way as spells, but are kept in two bytes starting at byte 5.
Byte 5
In this example (Hex 0D), Hut and Guard Tower are available. Leave other bits unchanged.
00001101 ||||| | ||||| |-----Hut ||||| ||||| ||||--------Guard Tower |||---------Temple ||----------Spy Hut |-----------Warrior Hut
Byte 6
In this example (Hex FF), Firewarrior Hut, Boat Hut and Balloon Hut are available.
11111111 | | |----Firewarrior Hut | | | | | | | | | |---------Boat Hut | |-----------Balloon Hut
Spells Not Charging
Spells not charging starts at offset 16 and contains 3 byres of data. These three bytes represent data for which spells are toggled as charging on the Spells Panel at the start of the game. Any bit set to true will result in the corresponding spell being set to the "not charging" state at the beginning of the game, and any bit set to false will result in the corresponding spell being set to the "charging" state at the beginning of the game. The user can change this state by right-clicking the icon of the spell.
The bits used for each spell are identical to the bits used in the spells section.
Byte 16
In this example (Hex 27), Blast and Swarm are not charging at the start of the game.
00100111 ||||||||--Leave on |||||||---Leave on ||||||----Blast |||||-----Lightning ||||------Tornado |||-------Swarm ||--------Invisibility |---------Hypnotise
Byte 17
In this example (Hex 54), Earthquake, Landbridge and Erode are not charging at the start of the game.
01010100 ||||||||----Firestorm |||||||-----Ghost Army ||||||------Erode |||||-------Swamp ||||--------Landbridge |||---------Angel of Death ||----------Earthquake |-----------Flatten
Byte 18
In this example (Hex F4), all spells in question are charging at the start of the game. The other bits should be left unchanged.
11110100 | ||----Volcano | |-----Convert | |-------Magical Shield
Fog of War and God Mode
Fog of War and God Mode are stored in Byte 98.
Byte 98
00001101 ||----Fog of War |-----God Mode
Landscape and Tree Style
The Landscape Style is 1 byte starting at byte 96 and the Tree Style is 1 byte starting at byte 97.
Byte 96
There are 36 landscape styles. In hex that is from 00 to 24.
Byte 97
There are 5 tree styles. In hex, they are 00, 03, 04, 05, 06.
Max Tribes
Maximum Tribes sets the number of enemy tribes that will appear on the level. In Single Player you must set this to the last colour on your level or 03 for all of them. Colours go in the order (Blue, Red, Yellow, Green). If you wanted to have only Blue and Yellow on a level, then the number must still be set to 02. In Multiplayer you just set this to how many players the level has minus one as you cannot omit colours. It is 1 byte long and starts at byte 88.
Byte 89
01 - Blue 02 - Blue & Red 03 - Blue, Red & Yellow 04 - Blue, Red, Yellow & Green
AI Scripts
AI Scripts are 3 bytes long and starts at byte 89. Each byte is for each colour (Red, Yellow, Green). You must type the script number in hex for it to link to that script. (Cpscr010.dat = 010 = 0A)
Allies
Allies are kept in 4 bytes staring at byte 92.
Blue = 01 Red = 02 Yellow = 04 Green = 08
An ally equals the two colours together. To make yellow and blue allies you would add Blue(01) and Yellow(04) together which makes 05. Then put 05 for yellow and blue (05 02 05 08).
Level Name
The level name starts at offset 55 (37 in hex) and is 32 bytes (8 bit signed-characters) long.
Markers
Markers are the 256*2 offsets, starting at offset 100 (in decimal). Offset 100 being the x coordinate of marker 0, and Offset 101 being the y coordinate of marker 0.
This goes in a pattern until all 256 (0 to 255) markers are used up.