Copyright (C) 2003, 2004, 2005 Ulf Lorenz Copyright (C) 2004, 2005, 2006 Andrea Paternesi Copyright (C) 2007, 2009 Ben Asselstine This document describes the format of a lordsawar save game. The save game files are in uncompressed tar format. The first file is the scenario file, which is an xml file. It is this scenario file format that is described in this document. The rest of the files are in the tar file are: citysets, shieldsets, armysets, tilesets and their associated image (.png) files. The scenario file is known as a "savegame" in this document. The tags are displayed here as they appear in the save game. The text in between the tags are comments. There are two kinds of tags: - tags to structure the savefile - data tags The first kind of tags defines a structure for the savegames, which is important when loading it. The latter tags actually store the data. As an example, here is a draft of the list of players: player's Id player's name ... ... ... The player tags here enclose the definition of a single player. The actual name etc. of these players are stored within data tags. Data tags always start with a "d_". Order of the data tags does not matter, but the order of the sections does matter. The version of the savegame is encoded in the first opening "lordsawar" tag. This value should be always higher than the largest Id that has been assigned since new Id's will be assigned from this value on. Unique successive Ids are given to newly created game objects, and this value holds the next Id to assign. the Id of the active player the Id of the neutral player the Id of the player the name of the player (boolean) player lives on after losing all cities the rgb values for the player separated by spaces; e.g. "255 0 152" Id of the player's armyset Lines up with in army//.xml the gold owned by the player true, if player is dead, false if not the type of the player 0 human player 1 ai player of type AI_Fast 2 ai player of type AI_Dummy 4 ai player of type AI_Smart if d_type=1 (boolean) the ai merges stacks together if d_type=1 (boolean) the ai razes all cities it occupies number of gold pieces paid this turn for upkeep a space separated list of army type Ids that determine the order in which armies fight in battle. These Ids line up with order of armies in the armyset. The only tag common to all history types is the tag "type". Everything else depends on the type of the history event. The whole historylist of a player comes here with as many tags as necessary. For example purposes, one history tag will be shown for each kind of history event. This data is used to populate the history reports. 1 (player starts a turn) 2 (player's hero finds a sage) the hero's name 3 (player gold report) how much gold the player has 4 (player has a hero emerge somewhere) the hero's name the name of the city 5 (player took over a city) the Id of the city the player took over 6 (player razed a city) the Id of the city the player razed 7 (player's hero starts a quest) the hero's name 8 (player's hero completes a quest) the hero's name 9 (player's hero killed in a city) the hero's name the name of the city 10 (hero killed in battle outside of a city) the hero's name 11 (hero killed while searching a ruin) the hero's name 12 (hero takes over a city) the hero's name 13 (player total score report) an integer between 0 and 100 representing how well the player is doing 14 (player is vanquished) This list contains all stacks of the player. the Id of the current activestack the Id of the stack the Id of the stack's player x position of the stack on the map y position of the stack on the map is the stack defending? (defending stacks will be ignored if the player clicks on "next stack") is the stack parked? This just means the player doesn't want to deal with this stack again this turn. Which point in the path we stop moving at because we will run out of movement points. This value is an index, starting at 0. how many items does the path contain a space separated list of all x coordinates (in order) of the path's items the same for the y coordinates Up to eight army tags follow. Order of armies is the order within the stack. the Id of the army the type of the army (0 means first army type of the armyset, 1 second etc.) Id of the army's armyset how many hitpoints the army has how many movement points the army has left maximum number of movement points the army can move the strength of the army the experience points of the army the value data tags are three boolean values separated by spaces one foreach medal type; 0 means no medal 1 means medal how many battles this army has fought the view radius on hidden map how many xp this army is worth if killed whether or not this army is in a ship whether or not this army is a hero a space separated list of temple Ids that the army has been blessed at the name of the hero the gender of the hero the name of the item can this item be planted> this id of player who can plant this item a unique Id of the item type of the bonus for the item See Item.h for a listing. ... ... the rest is the same as the army tag ...more armies or heroes... ...more stacks... width of the map height of the map fog of war information each line contains WIDTH numbers, and a new line there are a total of HEIGHT lines if a number is 0, then that tile is hidden if a number is 1, then that tile is exposed The following data is used to fill out the triumphs report: a space separated list of the number of heroes we have killed, per player a space separated list of the number of special armies (dragons, etc) that we have killed, per player a space separated list of the number of normal armies we have killed per player a space separated list of the number of ships we have killed per player a space separated list of the number of times we have captured an enemy's standard, per player The only tag common to all action types is the "d_type" tag. Everything else depends on the type of the action. The whole actionlist of a player comes here with as many tags as necessary. For example purposes, one action tag will be shown for each kind of action event. 1 (.. stack moved ..) the Id of the stack x position of the destination y position of the destination 2 (.. stack split ..) the Id of the original stack the Id of the freshly created stack a space-separated list of the 8 figures. They describe the Id's of the armies which have been added to stack new_army. If <8 armies have moved, the rest of the fields are filled with zeros 3 (.. stack fight ..) list of attacking stack's Ids separated by spaces list of defending stack's Ids separated by spaces it can also have an arbitrary number of subtags built like this: combat round id of the damaged unit amount of damage done 4 (.. stack joined ..) the Id of the army which survives the joining the Id of the army which is destroyd after the joining 5 (.. ruin searched ..) the Id of the searched ruin the Id of the searching stack has the keeper been defeated and the ruin successfully searched? 6 (.. temple searched ..) the Id of the visited temple the Id of the visiting stack 7 (.. city occupied ..) the Id of the occupied city 8 (.. city pillaged ..) the Id of the pillaged city 9 (.. city razed ..) the Id of the burnt down city 10 (.. city upgraded defense ..) the Id of the affected city 11 (.. city buy production ..) the city Id we bought production for the slot that got replaced the index of the army to be produced 12 (.. city change production ..) the city Id whose production is changed selected slot index 13 (.. a reward is given ..) Look at lordsawar.rewardlist for a description of a reward. 14 (.. hero gets a quest ..) the hero that has got the quest 1,2,3, depends on the quest type the Id of the object, depends on quest type 15 (.. hero picks up/drops an item ..) the hero that equips the item item that is equipped where the item is equipped 16 (.. army level-up ..) the army that has advanced a level the stat that was raised 17 (.. city sacked ..) the Id of the sacked city 18 (.. stack disbanded ..) the Id of the stack disbanded 19 (.. signpost changed ..) the Id of the signpost changed the new message on the sign 20 (.. city rename ..) the Id of the city that was renamed the new name of the city 21 (.. city vector ..) the Id of the city being vectored from the x position being vectored to the y position being vectored to 22 (.. fight order changed ..) a space separated list of army type Ids that represent the order in which they will fight in battle the x position being vectored to the y position being vectored to 23 (.. player resigns ..) 24 (.. player plants an item ..) the id of the hero the id of the item 25 (.. city produces army ..) the id of the army type the id of the destination city was it vectored here? 25 (.. vector army ..) the id of the army type the x position being vectored to the y position being vectored to ...more players... the width of the map the height of the map name of the tileset used First, there is a newline sign at the end of the string. Following this is a long long row of numbers indicating the type of terrain. The saving goes [0,0],[1,0],[2,0],...[0,1],[1,1] etc., i.e. first column 0, then column 1 etc. The numbers for the terrain: 0 grass 1 water 2 forest 3 hills 4 mountains 5 swamp each column ends with a newline an array of tilestyles. Each tilestyle is stored as a 2 digit hexadecimal number. It is space separated like the d_types tag. the x location of the item the y location of the item See lordsawar.playerlist.player.stacklist.stack.hero.backpack for a description of an "item". ... more itemstacks ... the Id of the city the name of the city x position of the city on the map y position of the city on the map Id of the city's owning player The index of the current production slot the amount of gold the city provides each turn true if the city has been razed defense level of the city true if this is a capital city the Id of the player who's capital this is. only present if d_capital is true. space separated position of where this city is vectoring to. x comes first, then y. if the city is not vectoring, then the value is "-1, -1". Now up to 4 armies appear. These aren't armies like they appear in stacks. These are army *templates* to be used to produce new armies in cities. ...more armies... ...more cities... the Id of the temple the name of the temple the type of the temple x position of the temple y position of the temple ...more temples... the Id of the ruin the name of the ruin the type of the ruin x position of the ruin y position of the ruin has the uin been searched yet? is this ruin a sage? (boolean) is this ruin hidden? (boolean) player id of player who can see this ruin this value is the neutral player's id if the ruin is visible by all. Look at lordsawar.rewardlist for a description of a reward. .... The stack the hero will fight (if not a sage) Here follows a complete description of the stack which guards the ruin. .... ...more ruins... the one-time reward list, where random rewards are chosen from The only tags common to all reward types is the tag "type", and "name". Everything else depends on the type of the reward. For example purposes, one reward tag will be shown for each kind of reward. 1 (..give gold..) amount of gold 2 (..give allies..) give this many allies the allies have this army type id the id of the armyset for this army type 3 (..give item..) the item to give See lordsawar.playerlist.player.stacklist.stack.hero.backpack for a description of an item. 4 (..show a hidden ruin..) the x position of the hidden ruin the y position of the hidden ruin 5 (..show a part of a hidden map..) the map is this many tiles high the map is this many tiles wide id of the map name of the map the upper left corner of the map, x position the upper left corner of the map, y position ...more rewards... the list of signs on the map the id of the signpost the message on the sign the x position on the map the y position on the map ...more signposts... the list of road tiles on the map the id of the road tile the name of the road (unused) the style of road the x position on the map the y position on the map ...more road tiles... the list of port tiles on the map the id of the port tile the name of the port (unused) the x position on the map the y position on the map ...more port tiles... the list of bridge tiles on the map the id of the bridge tile the name of the bridge (unused) the style of bridge the x position on the map the y position on the map ...more bridge tiles... the list of outstanding quests Every quest contains a common section, and then a specific section that depends on that quest type. The common section: Quest type. For example purposes, one quest per type will follow. the id of the hero the name of the hero whether or not this quest is pending deletion at the end of the round (boolean) the id of the player owning the hero 1 (..go kill a hero..) id of hero to kill 2 (..go kill some of a player's armies..) kill this many armies this many killed so far only count killed armies from th player with this id 3 (..go sack a city..) the id of the city to sack 4 (..go raze a city..) the id of the city to raze 5 (..go occupy a city..) the id of the city to occupy 6 (..go kill a particular kind of army..) the army type id of the army to kill 7 (..go pillage a certain amount of gold..) the amount of gold to pillage the amount pillaged so far ...more quests... the list of vectored units that are "in the air" the Id of the vectored unit the name of the vectored unit (unused) the source x position of the unit on the map the source y position on the map how many more turns before the vectored unit shows up the destination x position on the map the destination y position on the map the id of the player who is vectoring the unit the army template to be vectored this army layout is the same as the one in a city ...more vectored units... name of the scenario more info about the scenario the current turn number of the scenario boolean value used to set the armies healing at the beginning of the player's turn or at the beginning of the new round see enemy stack's contents. (boolean) see enemy production. (boolean) heroes can go on quests. (boolean) fog of war. (boolean) declare war before attacking. (boolean) a number between 0 and 2. 0 = Average 1 = Strong 2 = Active make fights more difficult. (boolean) make battle advice available. (boolean) switch-up player turns. (boolean)