Pharaoh Scenario Format

The scenario format for Pharaoh is mostly fixed size. There are only a few variable-length (compressed) parts of the file, and those are all near the end. I haven't figured out all, but most options in the editor are reflected here:

Offset (hex) Length (bytes) Description
0x0 4 Four bytes identifying the file format version
0x177c 207936 Graphic IDs, 4 bytes per tile - Each ID corresponds to a different graphic element / building
0x343BC 51984 Byte grid, edge data
0x40ECC 207936 Grid, 4 bytes per tile, terrain data
0x73B0C 51984 Byte grid, related to "randomness" in terrain. 00 or 20 (hex), 01 or 21 for 2x2 buildings, etc
0x8061c 51984 Byte grid, random numbers used for, among others: merging houses, tile appearance, minimap colours
0x8D12C 51984 Byte grid, all zeroes (was elevation for Caesar 3 - Pharaoh doesn't have elevation)
0x99c3c 8 Random number (seed?)
0x99c44 8 Camera X and Y position
0x99C4C 2 Starting year - negative = BC, positive = AD
0x99C56 10 Gods: Osiris, Ra, Ptah, Seth, Bast; 0 = unknown, 1 = local, 2 = patron
0x99C6C 4 Starting funds
0x99C70 2 Enemy type
0x99C78 4 Map size X
0x99C7c 4 Map size Y
0x99c88 24 Short description
0x99cc8 512 Description (unused)
0x99ED2 2 Image ID
0x99ED4 2 Open play yes/no
0x99ED6 2 Initial rank, 0 = village elder, 1 = village noble, ... 10 = pharaoh
0x99ED8 8 Killer spawn 1-4: X coordinate (short)
0x99EE0 8 Killer spawn 1-4: Y coordinate (short)
0x99EE8 16 Fishing point 1-8: X coordinate (short)
0x99EF8 16 Fishing point 1-8: Y coordinate (short)
0x99f34 32 Invasion point 1-16: X coordinate (short)
0x99f54 32 Invasion point 1-16: Y coordinate (short)
0x99F98 4 Culture goal
0x99F9C 4 Prosperity goal
0x99FA0 4 Monument goal
0x99FA4 4 Kingdom goal
0x99FA8 4 Housing level goal: number of houses
0x99FAC 4 Housing level goal: housing level, 0 = crude hut, 19 = palatial estate
0x99FB0 4 Goal yes/no flags: culture, prosperity, monument, kingdom
0x99FBC 4 Time limit toggle
0x99FC0 4 Time limit years
0x99FC4 4 Survival time toggle
0x99FC8 4 Survival time years
0x99FCC 4 Population goal yes/no
0x99FD0 4 Population goal
0x99fd8 4 Entry point X and Y (short)
0x99fdc 4 Exit point X and Y (short)
0x9A000 4 River entry point X and Y (short)
0x9A004 4 River exit point X and Y (short)
0x9A008 4 Pharaoh gift (bail-out loan)
0x9A00C 4 Milestone - 25% (years)
0x9A010 4 Milestone - 50% (years)
0x9A014 4 Milestone - 75% (years)
0x9A024 4 Climate: 0 = humid, 1 = normal, 2 = arid
0x9A034 16 Prey spawn 1-4: X coordinate (integer)
0x9A044 16 Prey spawn 1-4: Y coordinate (integer)
0x9A058 86 Buildings enabled
0x9A124 10 Osiris, Ra, Ptah, Seth, Bast: temple complex available
0x9A138 12 Disembark point 1-3: X coordinate (integer)
0x9A144 12 Disembark point 1-3: X coordinate (integer)
0x9A150 2 Interest rate on debt
0x9A154 6 Available monuments 1-3
0x9A160 120 Burial provisions, in order: grain, meat, lettuce, chickpeas, pomegranates, figs, fish, game meat, straw, weapons, clay, bricks, pottery, barley, beer, flax, linen, gems, jewelry, wood, gold, reeds, papyrus, plain stone, limestone, granite, (unused), chariots, copper, sandstone
0x9A27C 4 Current pharaoh, 0 = Amenemhet I, 62 = Weneg
0x9A280 4 Player incarnation, roman numerals
0x9A284 51984 Byte grid with all zeroes
0xA6D94 2 Number of events
0xA6D98 18600 Events 0-149, 124 bytes per event
0xAB640 4 Selected event in the editor (-1 = no event)
0xab658 variable Compressed: unknown purpose
variable variable Compressed: kingdom map
variable variable Compressed: unknown purpose
variable 51984 Byte grid with all FF's
variable variable Compressed: flood settings
variable 292 73x integer, unknown purpose
variable variable Compressed: related to grass / water

Last modified on 2008-07-06 15:23:29