1 Copyright (C) 2003, 2004, 2005 Ulf Lorenz
2 Copyright (C) 2004, 2005, 2006 Andrea Paternesi
3 Copyright (C) 2007, 2009 Ben Asselstine
4 This document describes the format of a lordsawar save game.
7 The save game files are in uncompressed tar format.
8 The first file is the scenario file, which is an xml file. It is this scenario file format that is described in this document.
9 The rest of the files are in the tar file are: citysets, shieldsets, armysets, tilesets and their associated image (.png) files.
12 The scenario file is known as a "savegame" in this document.
14 The tags are displayed here as they appear in the save game.
15 The text in between the tags are comments. There are two kinds of tags:
17 - tags to structure the savefile
20 The first kind of tags defines a structure for the savegames, which is
21 important when loading it. The latter tags actually store the data. As
22 an example, here is a draft of the list of players:
26 <d_id> player's Id </d_id>
27 <d_name> player's name </d_name>
36 The player tags here enclose the definition of a single player. The
37 actual name etc. of these players are stored within data tags. Data
38 tags always start with a "d_".
40 Order of the data tags does not matter, but the order of the sections
43 The version of the savegame is encoded in the first opening "lordsawar" tag.
47 <lordsawar version="xxx">
49 <d_curID> This value should be always higher than the largest Id that
50 has been assigned since new Id's will be assigned from this
52 Unique successive Ids are given to newly created game
53 objects, and this value holds the next Id to assign.
58 <d_active> the Id of the active player </d_active>
59 <d_neutral> the Id of the neutral player </d_neutral>
61 <d_id> the Id of the player </d_id>
62 <d_name> the name of the player </d_name>
63 <d_immortal> (boolean) player lives on after losing all cities</d_immortal>
64 <d_color> the rgb values for the player separated
65 by spaces; e.g. "255 0 152"
67 <d_armyset> Id of the player's armyset
68 Lines up with <d_id> in army/<name>/<name>.xml
70 <d_gold> the gold owned by the player </d_gold>
71 <d_dead> true, if player is dead, false if not </d_dead>
72 <d_type> the type of the player
74 1 ai player of type AI_Fast
75 2 ai player of type AI_Dummy
76 4 ai player of type AI_Smart
79 <d_join> if d_type=1 (boolean) the ai merges stacks together </d_join>
80 <d_maniac> if d_type=1 (boolean) the ai razes all cities it occupies </d_maniac>
81 <d_upkeep> number of gold pieces paid this turn for upkeep
83 <d_fight_order> a space separated list of army type Ids that
84 determine the order in which armies fight
86 These Ids line up with order of armies in
87 the armyset. </d_fight_order>
89 The only tag common to all history types is the tag "type".
90 Everything else depends on the type of the history event.
91 The whole historylist of a player comes here with as many
92 tags as necessary. For example purposes, one history tag
93 will be shown for each kind of history event. This data is
94 used to populate the history reports.
97 <d_type>1</d_type> (player starts a turn)
100 <d_type>2</d_type> (player's hero finds a sage)
101 <d_hero> the hero's name </d_name>
104 <d_type>3</d_type> (player gold report)
105 <d_gold> how much gold the player has </d_gold>
108 <d_type>4</d_type> (player has a hero emerge somewhere)
109 <d_hero> the hero's name </d_name>
110 <d_city> the name of the city </d_name>
113 <d_type>5</d_type> (player took over a city)
114 <d_city> the Id of the city the player took over </d_city>
117 <d_type>6</d_type> (player razed a city)
118 <d_city> the Id of the city the player razed </d_city>
121 <d_type>7</d_type> (player's hero starts a quest)
122 <d_hero> the hero's name </d_name>
125 <d_type>8</d_type> (player's hero completes a quest)
126 <d_hero> the hero's name </d_name>
129 <d_type>9</d_type> (player's hero killed in a city)
130 <d_hero> the hero's name </d_name>
131 <d_city> the name of the city </d_name>
134 <d_type>10</d_type> (hero killed in battle outside of a city)
135 <d_hero> the hero's name </d_name>
138 <d_type>11</d_type> (hero killed while searching a ruin)
139 <d_hero> the hero's name </d_name>
142 <d_type>12</d_type> (hero takes over a city)
143 <d_hero> the hero's name </d_name>
146 <d_type>13</d_type> (player total score report)
147 <d_score> an integer between 0 and 100 representing
148 how well the player is doing </d_score>
151 <d_type>14</d_type> (player is vanquished)
155 This list contains all stacks of the player.
157 <d_active> the Id of the current activestack </d_active>
160 <d_id> the Id of the stack </d_id>
161 <d_player> the Id of the stack's player</d_player>
162 <d_x> x position of the stack on the map </d_x>
163 <d_y> y position of the stack on the map </d_y>
164 <d_defending> is the stack defending? (defending stacks
165 will be ignored if the player clicks
168 <d_parked> is the stack parked? This just means the
169 player doesn't want to deal with this
170 stack again this turn.
172 <d_moves_exhausted_at_point>
173 Which point in the path we stop moving at because
174 we will run out of movement points.
175 This value is an index, starting at 0.
176 </d_moves_exhausted_at_point>
179 <d_size> how many items does the path contain </d_size>
180 <d_x> a space separated list of all x coordinates
181 (in order) of the path's items
183 <d_y> the same for the y coordinates </d_y>
186 Up to eight army tags follow. Order of armies is the
187 order within the stack.
190 <d_id> the Id of the army
192 <d_type> the type of the army (0 means first
193 army type of the armyset, 1 second etc.)
195 <d_armyset> Id of the army's armyset
197 <d_hp> how many hitpoints the army has
199 <d_moves> how many movement points the
202 <d_max_moves> maximum number of movement
203 points the army can move
205 <d_strength> the strength of the army
207 <d_xp> the experience points of the army </d_xp>
208 <d_medals> the value data tags are three boolean
209 values separated by spaces one foreach
210 medal type; 0 means no medal 1 means medal
212 <d_numberbattles> how many battles this army has fought
214 <d_sight> the view radius on hidden map
216 <d_expvalue> how many xp this army is worth if killed
218 <d_ship> whether or not this army is in a ship
220 <d_hero> whether or not this army is a hero
223 a space separated list of temple Ids that the
224 army has been blessed at
229 <d_name> the name of the hero
231 <d_gender > the gender of the hero
235 <d_name> the name of the item
237 <d_plantable> can this item be planted>
239 <d_plantable_owner> this id of player who
242 <d_id> a unique Id of the item
244 <d_bonus> type of the bonus for the item
245 See Item.h for a listing.
253 ... the rest is the same as the army tag
257 ...more armies or heroes...
265 <d_width> width of the map </d_width>
266 <d_height> height of the map </d_height>
267 <d_map> fog of war information
268 each line contains WIDTH numbers, and a new line
269 there are a total of HEIGHT lines
270 if a number is 0, then that tile is hidden
271 if a number is 1, then that tile is exposed
275 The following data is used to fill out the triumphs report:
276 <d_hero> a space separated list of the number of heroes
277 we have killed, per player
279 <d_special> a space separated list of the number of special
280 armies (dragons, etc) that we have killed, per
283 <d_normal>a space separated list of the number of normal
284 armies we have killed per player
286 <d_ship>a space separated list of the number of ships we have
289 <d_flag>a space separated list of the number of times we have
290 captured an enemy's standard, per player
295 The only tag common to all action types is the "d_type" tag.
296 Everything else depends on the type of the action. The whole
297 actionlist of a player comes here with as many tags as
298 necessary. For example purposes, one action tag
299 will be shown for each kind of action event.
303 <d_type>1</d_type> (.. stack moved ..)
304 <d_stack> the Id of the stack </d_stack>
305 <d_x> x position of the destination </d_x>
306 <d_y> y position of the destination </d_y>
310 <d_type>2</d_type> (.. stack split ..)
311 <d_orig_stack> the Id of the original stack </d_orig_army>
312 <d_new_stack> the Id of the freshly created stack </d_new_army>
313 <d_moved> a space-separated list of the 8 figures.
314 They describe the Id's of the armies which have
315 been added to stack new_army. If <8 armies
316 have moved, the rest of the fields are filled
322 <d_type>3</d_tag> (.. stack fight ..)
323 <d_attackers> list of attacking stack's Ids separated by spaces </d_attackers>
324 <d_defenders> list of defending stack's Ids separated by spaces </d_defenders>
326 it can also have an arbitrary number of subtags built like this:
329 <d_turn> combat round </d_turn>
330 <d_id> id of the damaged unit </d_id>
331 <d_damage> amount of damage done </d_damage>
336 <d_type>4</d_type> (.. stack joined ..)
337 <d_receiver> the Id of the army which survives the joining
339 <d_joining> the Id of the army which is destroyd after the
345 <d_type>5</d_type> (.. ruin searched ..)
346 <d_ruin> the Id of the searched ruin </d_ruin>
347 <d_seeker> the Id of the searching stack </d_seeker>
348 <d_searched> has the keeper been defeated and the ruin
349 successfully searched?
354 <d_type>6</d_type> (.. temple searched ..)
355 <d_temple> the Id of the visited temple </d_temple>
356 <d_stack> the Id of the visiting stack </d_stack>
360 <d_type>7</d_type> (.. city occupied ..)
361 <d_city> the Id of the occupied city </d_city>
365 <d_type>8</d_type> (.. city pillaged ..)
366 <d_city> the Id of the pillaged city </d_city>
370 <d_type>9</d_type> (.. city razed ..)
371 <d_city> the Id of the burnt down city </d_city>
375 <d_type>10</d_type> (.. city upgraded defense ..)
376 <d_city> the Id of the affected city </d_city>
380 <d_type>11</d_type> (.. city buy production ..)
381 <d_city> the city Id we bought production for </d_city>
382 <d_slot> the slot that got replaced </d_slot>
383 <d_type> the index of the army to be produced </d_type>
387 <d_type>12</d_type> (.. city change production ..)
388 <d_city> the city Id whose production is changed </d_city>
389 <d_prod> selected slot index </d_prod>
393 <d_type>13</d_type> (.. a reward is given ..)
395 Look at lordsawar.rewardlist for a description of a reward.
400 <d_type>14</d_type> (.. hero gets a quest ..)
401 <d_hero> the hero that has got the quest </d_hero>
402 <d_quest> 1,2,3, depends on the quest type </d_quest>
403 <d_data> the Id of the object, depends on quest type </d_data>
407 <d_type>15</d_type> (.. hero picks up/drops an item ..)
408 <d_hero> the hero that equips the item </d_hero>
409 <d_item> item that is equipped </d_item>
410 <d_dest> where the item is equipped </d_dest>
414 <d_type>16</d_type> (.. army level-up ..)
415 <d_army> the army that has advanced a level </d_army>
416 <d_stat> the stat that was raised </d_stat>
420 <d_type>17</d_type> (.. city sacked ..)
421 <d_city> the Id of the sacked city </d_city>
425 <d_type>18</d_type> (.. stack disbanded ..)
426 <d_stack> the Id of the stack disbanded </d_stack>
430 <d_type>19</d_type> (.. signpost changed ..)
431 <d_signpost> the Id of the signpost changed </d_signpost>
432 <d_message> the new message on the sign </d_message>
436 <d_type>20</d_type> (.. city rename ..)
437 <d_city> the Id of the city that was renamed </d_city>
438 <d_name> the new name of the city </d_name>
442 <d_type>21</d_type> (.. city vector ..)
443 <d_city> the Id of the city being vectored from </d_city>
444 <d_x> the x position being vectored to </d_x>
445 <d_y> the y position being vectored to </d_y>
449 <d_type>22</d_type> (.. fight order changed ..)
450 <d_order > a space separated list of army type Ids that
451 represent the order in which they will fight in
454 <d_x> the x position being vectored to </d_x>
455 <d_y> the y position being vectored to </d_y>
459 <d_type>23</d_type> (.. player resigns ..)
463 <d_type>24</d_type> (.. player plants an item ..)
464 <d_hero> the id of the hero </d_hero>
465 <d_item> the id of the item </d_item>
469 <d_type>25</d_type> (.. city produces army ..)
470 <d_army_type > the id of the army type </d_army_type>
471 <d_city > the id of the destination city </d_city>
472 <d_vectored> was it vectored here? </d_vectored>
476 <d_type>25</d_type> (.. vector army ..)
477 <d_army_type > the id of the army type </d_army_type>
478 <d_x> the x position being vectored to </d_x>
479 <d_y> the y position being vectored to </d_y>
490 <d_width> the width of the map </d_width>
491 <d_height > the height of the map </d_height >
492 <d_tileset> name of the tileset used </d_tileset>
494 First, there is a newline sign at the end of the string.
495 Following this is a long long row of numbers indicating the type of
496 terrain. The saving goes [0,0],[1,0],[2,0],...[0,1],[1,1] etc., i.e.
497 first column 0, then column 1 etc.
498 The numbers for the terrain:
505 each column ends with a newline
508 an array of tilestyles. Each tilestyle is stored as a 2 digit
510 It is space separated like the d_types tag.
514 <d_x> the x location of the item </d_x>
515 <d_y> the y location of the item </d_y>
517 See lordsawar.playerlist.player.stacklist.stack.hero.backpack
518 for a description of an "item".
521 ... more itemstacks ...
526 <d_id> the Id of the city
528 <d_name> the name of the city
530 <d_x> x position of the city on the map
532 <d_y> y position of the city on the map
534 <d_owner> Id of the city's owning player
536 <d_production> The index of the current production slot
538 <d_gold> the amount of gold the city provides each turn
540 <d_burnt> true if the city has been razed
542 <d_defense> defense level of the city
544 <d_capital> true if this is a capital city
546 <d_capital_owner> the Id of the player who's capital this is.
547 only present if d_capital is true.
550 space separated position of where this city is vectoring to.
551 x comes first, then y.
552 if the city is not vectoring, then the value is "-1, -1".
555 Now up to 4 armies appear. These aren't armies like they appear
556 in stacks. These are army *templates* to be used to produce
557 new armies in cities.
569 <d_id> the Id of the temple </d_id>
570 <d_name> the name of the temple </d_name>
571 <d_type> the type of the temple </d_type>
572 <d_x> x position of the temple </d_x>
573 <d_y> y position of the temple </d_y>
582 <d_id> the Id of the ruin </d_id>
583 <d_name> the name of the ruin </d_name>
584 <d_type> the type of the ruin </d_type>
585 <d_x> x position of the ruin </d_x>
586 <d_y> y position of the ruin </d_y>
587 <d_searched> has the uin been searched yet? </d_searched>
588 <d_sage> is this ruin a sage? (boolean) </d_sage>
589 <d_hidden> is this ruin hidden? (boolean) </d_hidden>
590 <d_owner> player id of player who can see this ruin
591 this value is the neutral player's id if the
592 ruin is visible by all.
595 Look at lordsawar.rewardlist for a description of a reward.
599 The stack the hero will fight (if not a sage)
600 Here follows a complete description of the stack which guards
611 the one-time reward list, where random rewards are chosen from
613 The only tags common to all reward types is the tag "type",
615 Everything else depends on the type of the reward.
616 For example purposes, one reward tag will be shown for
620 <d_type>1</d_type> (..give gold..)
623 <d_gold>amount of gold</d_gold>
626 <d_type>2</d_type> (..give allies..)
629 <d_num_allies> give this many allies
631 <d_ally_type> the allies have this army type id
633 <d_ally_armyset> the id of the armyset for this army type
637 <d_type>3</d_type> (..give item..)
642 See lordsawar.playerlist.player.stacklist.stack.hero.backpack
643 for a description of an item.
647 <d_type>4</d_type> (..show a hidden ruin..)
650 <d_x> the x position of the hidden ruin </d_x>
651 <d_y> the y position of the hidden ruin </d_y>
654 <d_type>5</d_type> (..show a part of a hidden map..)
657 <d_height> the map is this many tiles high</d_height>
658 <d_width> the map is this many tiles wide</d_width>
660 <d_id>id of the map</d_id>
661 <d_name>name of the map</d_name>
662 <d_x> the upper left corner of the map, x position </d_x>
663 <d_y> the upper left corner of the map, y position </d_y>
670 the list of signs on the map
672 <d_id>the id of the signpost</d_id>
673 <d_name>the message on the sign <d_name>
674 <d_x>the x position on the map<d_x>
675 <d_y>the y position on the map<d_y>
681 the list of road tiles on the map
683 <d_id>the id of the road tile</d_id>
684 <d_name>the name of the road (unused) <d_name>
685 <d_type>the style of road<d_type>
686 <d_x>the x position on the map<d_x>
687 <d_y>the y position on the map<d_y>
689 ...more road tiles...
692 the list of port tiles on the map
694 <d_id>the id of the port tile</d_id>
695 <d_name>the name of the port (unused) <d_name>
696 <d_x>the x position on the map<d_x>
697 <d_y>the y position on the map<d_y>
699 ...more port tiles...
702 the list of bridge tiles on the map
704 <d_id>the id of the bridge tile</d_id>
705 <d_name>the name of the bridge (unused) <d_name>
706 <d_type>the style of bridge <d_type>
707 <d_x>the x position on the map<d_x>
708 <d_y>the y position on the map<d_y>
710 ...more bridge tiles...
713 the list of outstanding quests
715 Every quest contains a common section, and then a specific
716 section that depends on that quest type.
718 <d_type> Quest type. For example purposes, one quest per type
721 <d_hero> the id of the hero
723 <d_hero_name> the name of the hero
725 <d_pending> whether or not this quest is pending deletion at the
726 end of the round (boolean)
728 <d_player> the id of the player owning the hero
732 <d_type>1</d_type> (..go kill a hero..)
734 <d_hero_name></d_hero_name>
735 <d_pending></d_pending>
736 <d_player></d_player>
738 <d_to_kill> id of hero to kill </d_to_kill>
741 <d_type>2</d_type> (..go kill some of a player's armies..)
743 <d_hero_name></d_hero_name>
744 <d_pending></d_pending>
745 <d_player></d_player>
747 <d_to_kill> kill this many armies </d_to_kill>
748 <d_killed> this many killed so far </d_killed>
749 <d_victim_player> only count killed armies from
750 th player with this id
754 <d_type>3</d_type> (..go sack a city..)
756 <d_hero_name></d_hero_name>
757 <d_pending></d_pending>
758 <d_player></d_player>
760 <d_city> the id of the city to sack </d_city>
763 <d_type>4</d_type> (..go raze a city..)
765 <d_hero_name></d_hero_name>
766 <d_pending></d_pending>
767 <d_player></d_player>
769 <d_city> the id of the city to raze </d_city>
772 <d_type>5</d_type> (..go occupy a city..)
774 <d_hero_name></d_hero_name>
775 <d_pending></d_pending>
776 <d_player></d_player>
778 <d_city> the id of the city to occupy </d_city>
781 <d_type>6</d_type> (..go kill a particular kind of army..)
783 <d_hero_name></d_hero_name>
784 <d_pending></d_pending>
785 <d_player></d_player>
787 <d_type_to_kill> the army type id of the army to kill
791 <d_type>7</d_type> (..go pillage a certain amount of gold..)
793 <d_hero_name></d_hero_name>
794 <d_pending></d_pending>
795 <d_player></d_player>
797 <d_to_pillage> the amount of gold to pillage</d_to_pillage>
798 <d_pillaged> the amount pillaged so far</d_pillaged>
805 the list of vectored units that are "in the air"
807 <d_id> the Id of the vectored unit </d_id>
808 <d_name> the name of the vectored unit (unused) </d_name>
809 <d_x> the source x position of the unit on the map </d_x>
810 <d_y> the source y position on the map </d_y>
811 <d_duration> how many more turns before the vectored unit shows up
813 <d_dest_x> the destination x position on the map </d_dest_x>
814 <d_dest_y> the destination y position on the map </d_dest_y>
815 <d_player> the id of the player who is vectoring the unit
818 the army template to be vectored
819 this army layout is the same as the one in a city
822 ...more vectored units...
825 <d_name> name of the scenario </d_name>
826 <d_comment> more info about the scenario </d_comment>
827 <d_turn> the current turn number of the scenario </d_turn>
828 <d_turnmode> boolean value used to set the armies healing at
829 the beginning of the player's turn or at the
830 beginning of the new round
832 <d_view_enemies> see enemy stack's contents. (boolean)
834 <d_view_production> see enemy production. (boolean)
836 <d_quests> heroes can go on quests. (boolean)
838 <d_hidden_map> fog of war. (boolean)
840 <d_diplomacy> declare war before attacking. (boolean)
842 <d_neutral_cities> a number between 0 and 2.
847 <d_intense_combat> make fights more difficult. (boolean)
849 <d_military_advisor> make battle advice available. (boolean)
850 </d_military_advisor>
851 <d_random_turns> switch-up player turns. (boolean)