This is an unofficial specification I have created based on examining various SCN and EES files. SCN is used interchangeably with EES, they are the same format.
Types
Integer types:
The following values are used for X currently:
array<T>
stream<T>
bool
Defining structures:
String: struct {u32 length, array<u8>[length]}
Version: struct {u32 low, u32 high}
Now that we have basic types out of the way, lets get into the specification.
Main File Format
struct {
}
Header format
struct {
}
Lump Format
struct {
u32type: The type id of this lump.
u32size: The size of the data enclosed in this lump.
}
Date Format
struct {String formatted}
A string formatted like "DAY MON DD HH:MM::SS YYYY\n",
for example "Fri Nov 26 16:04:26 2010\n", where "\n" means an ASCII newline character. The reason for inclusion of a newline is unknown.
DAY may be: Mon, Tue, Wed, Thu, Fri, Sat Sun
MON may be: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Player Header Format
struct {
Player Header Flags
bit 0: IsHuman
bit 1: IsInactive (possibly)
bit 2: IsDefeated
Settings Header Format
struct {
Scenario Header Text
struct {
Lumps
Most data in SCN files is divided up into lumps. If data occurs in both the header and the lumps, then generally the version in the lumps takes precedence.
Mapping of LumpId to format
1 => Unknown
2 => Seed - Contains a single u32 representing the seed.
3 => CameraPosition - Contains the camera position with an unknown meaning.
4 => Terrain
5 => Players
6 => Triggers
7 => Diplomacy
8 => Unknown
10 => GfxEffects
11 => Calamities
12 => Unknown
Specification History
3 - Correct misordering of Lump fields - Version is first, not last
2 - Define player flags
1 - Define shared_los value
0 - Initial Revision
Integer types:
uX: An unsigned X-bit integer.
iX: A signed X-bit integer.
qX: X-bit integer, unknown if signed or unsigned.
8, 32
array<
An array of values with type T.
stream<
A stream of values. Like array, but without length prefix. Length is usually determined from another source.
bool
A u8, where 1 means true and 0 means false.
Defining structures:
A structure is defined in this document as "struct {", then comma seperated list of values with a type and name, then "}" to end the struct.
Example: struct {u8 x, u32 y} represents a struct containing a u8 named x, and a u32 named y.
String: struct {u32 length, array<
A length prefixed string, that contains a null byte at the end. The null byte is included in the length.
Example (hex): 0C 00 00 00 48 65 6C 6C 6F 20 57 6F 72 6C 64 00 -> "Hello World"
Version: struct {u32 low, u32 high}
A version number, can be printed as high.low
Now that we have basic types out of the way, lets get into the specification.
struct {
Header header: See Header Format for more info.
stream<Lump> lumps: The lumps of this file. Amount of lumps is determined by the length of lump_types in the header. See Lump Format for more info.
stream<
}
struct {
u32 file_size: Size of the rest of the file. Usually the size of the entire file - 4.
Stringname: The name of this SCN file.
Stringdescription: The description of this SCN file.
Versionversion: The version of this SCN file. EE uses 231.0, AOC uses 250.0.
Stringplayer_list: A list of players in this file. Do not use this for determining player names, as players with spaces in their name will not be distinguished from multiple players.
Datedate: A formatted date. See the Date Format section for more info.
u8unknown_0: Unknown
array<PlayerHeader> players: The player information. See the Player Header Format section for more info.
Settingssettings: The settings for the file. See the Settings Header Format section for more info.
Stringcampaign_name: The name of the campaign, minus the file extension. For example, "EETheGreeks" for the greek campaign.
Stringscenario_name: The name the scenario inside this campaign. For example, "The Peloponnessian War".
u32unknown_1: Unknown
u8unknown_2: Unknown
Stringforced_name: The name the player must be. In the Greek campaign, this is "Greeks"
u32unknown_3: Unknown
array<u32> lump_types: The list of the type of lumps that will appear after the header.
ScenarioTexttext: The text in this scenario. See Scenario Header Text for more info.
u32creation_uptime: How many seconds the host system has been up for when this file was created;
String
String
Version
String
Date
u8
array<
Settings
String
String
u32
u8
String
u32
array<
ScenarioText
u32
}
struct {
Version version: Version of this lump. Usually matches the header version.
u32
u32
}
struct {String formatted}
A string formatted like "DAY MON DD HH:MM::SS YYYY\n",
for example "Fri Nov 26 16:04:26 2010\n", where "\n" means an ASCII newline character. The reason for inclusion of a newline is unknown.
DAY may be: Mon, Tue, Wed, Thu, Fri, Sat Sun
MON may be: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
struct {
u8 unknown_0: Unknown
u8unknown_1: Unknown
boolshared_los: When this is true, people on the same team as this player can see what this player sees.
u32flags: See Player Header Flags for more info.
Stringname: Name of the player.
u32unknown_2: Unknown
u32id: Unique Id of this player.
u32color: Color index of this player (the color they select when starting the game)
u32team: Team this player is on.
u32starting_citizens: Citizens this player started with.
}u8
bool
u32
String
u32
u32
u32
u32
u32
bit 0: IsHuman
bit 1: IsInactive (possibly)
bit 2: IsDefeated
struct {
u8 unknown_0: Unknown
u8unknown_1: Unknown
u8unknown_2: Unknown
u32game_speed: An enumeration representing the game speed.
u32unknown_3: Unknown
u32game_variant: The game variant (Standard/Tournament/etc)
u32map_size: The map size (Tiny, Gigantic, etc)
u32start_epoch: The epoch all players start on.
u32end_epoch: The maximum epoch any player can attain.
u32resources: The starting resource level (Deathmatch/Tournament/etc)
u32max_units: The maximum units for all non World players.
u32wonders_for_victory: The amount of wonders needed to start a player's Wonder countdown timer.
u32ai_difficulty: The difficulty of the AI. (easy/medium/hard)
boolvictory_allowed: Can victory be triggered through default mechanics?
boollock_teams: Disables changing teams
boollock_speed: Disables changing of the game speed while in game
boolreveal_map: Whether the entire map is revealed to all players when the game starts.
boolcheat_codes: Whether cheat codes can be used.
boolunknown_4: Unknown
boolcustom_civs: Whether players may use custom civs or must use predefined ones.
boolunknown_5: Unknown
}u8
u8
u32
u32
u32
u32
u32
u32
u32
u32
u32
u32
bool
bool
bool
bool
bool
bool
bool
bool
struct {
String unknown: Unknown
Stringhints: Hints for the player playing the scenario.
Stringhistory: A background to the scenario's history.
Stringmovie: A path to a movie to be played.
Stringmap: A path to a map image.
Stringsoundover: A path to a soundover to be played while viewing the scenario breifing.
}String
String
String
String
String
Most data in SCN files is divided up into lumps. If data occurs in both the header and the lumps, then generally the version in the lumps takes precedence.
Mapping of LumpId to format
1 =>
Undocumented at this time.
2 =>
struct {u32 seed}
3 =>
struct {f32 x, f32 y, f32 unknown}
4 =>
Undocumented at this time.
5 =>
Undocumented at this time.
6 =>
Undocumented at this time.
7 =>
Undocumented at this time.
8 =>
Undocumented at this time.
10 =>
Undocumented at this time.
11 =>
Undocumented at this time.
12 =>
Undocumented at this time.
3 - Correct misordering of Lump fields - Version is first, not last
2 - Define player flags
1 - Define shared_los value
0 - Initial Revision
[This message has been edited by coderbot16 (edited 10-02-2016 @ 10:51 AM).]