Ultima 5 (PC version) SAVED.GAM =============================== Last updated on 6-March-2004 Please send additions, corrections and feedback to this e-Mail address: Remove space + vowels from "marc winterrowd" and append "at yahoo dot com" SAVED.GAM --------- This file contains the current saved game. When you start a new game, "SAVED.GAM" is initalized from "INIT.GAM". offset length range purpose 0x0 2 ? ? 0x2 0x20 n/a character record 1 (Avatar) 0x22 0x20 n/a character record 2 0x42 0x20 n/a character record 3 0x62 0x20 n/a character record 4 0x82 0x20 n/a character record 5 0xA2 0x20 n/a character record 6 0xC2 0x20 n/a character record 7 0xE2 0x20 n/a character record 8 0x102 0x20 n/a character record 9 0x122 0x20 n/a character record 10 0x142 0x20 n/a character record 11 0x162 0x20 n/a character record 12 0x182 0x20 n/a character record 13 0x1A2 0x20 n/a character record 14 0x1C2 0x20 n/a character record 15 0x1E2 0x20 n/a character record 16 0x202 2 0-9999 food 0x204 2 0-9999 gold 0x206 1 0-99 keys 0x207 1 0-99 gems 0x208 1 0-99 torches 0x209 1 0,0xFF grapple 0x20A 1 0-99 magic carpets 0x20B 1 0-99 skull keys 0x20C 1 ? ? 0x20D 1 0,0xFF Amulet of Lord British 0x20E 1 0,0xFF Crown of Lord British 0x20F 1 0,0xFF Sceptre of Lord British 0x210 1 0,0xFF Shard of Falsehood 0x211 1 0,0xFF Shard of Hatred 0x212 1 0,0xFF Shard of Cowardice 0x213 1 ? ? 0x214 1 0-99 spy glasses 0x215 1 0,0xFF HMS Cape Plans 0x216 1 0-99 sextants 0x217 1 0,0xFF Pocket Watch 0x218 1 0,0xFF Black Badge 0x219 1 0,0xFF Sandalwood Box --- Items owned by the entire party --- --- Helmets --- 0x21A 1 0-99 Leather Helm 0x21B 1 0-99 Chain Coif 0x21C 1 0-99 Iron Helm 0x21D 1 0-99 Spiked Helm --- Shields --- 0x21E 1 0-99 Small Shield 0x21F 1 0-99 Large Shield 0x220 1 0-99 Spiked Shield 0x221 1 0-99 Magic Shield 0x222 1 0-99 Jewelled Shield --- Armor --- 0x223 1 0-99 Cloth 0x224 1 0-99 Leather 0x225 1 0-99 Ring Mail 0x226 1 0-99 Scale 0x227 1 0-99 Chain 0x228 1 0-99 Plate 0x229 1 0-99 Mystic Armor --- Weapons --- 0x22A 1 0-99 Dagger 0x22B 1 0-99 Sling 0x22C 1 0-99 Club 0x22D 1 0-99 Flaming Oil 0x22E 1 0-99 Main Gauche 0x22F 1 0-99 Spear 0x230 1 0-99 Throwing Axe 0x231 1 0-99 Short Sword 0x232 1 0-99 Mace 0x233 1 0-99 Morning Star 0x234 1 0-99 Bow 0x235 1 0-99 Arrows 0x236 1 0-99 Crossbow 0x237 1 0-99 Quarrels 0x238 1 0-99 Long Sword 0x239 1 0-99 2H Hammer 0x23A 1 0-99 2H Axe 0x23B 1 0-99 2H Sword 0x23C 1 0-99 Halberd 0x23D 1 0-99 Chaos Sword 0x23E 1 0-99 Magic Bow 0x23F 1 0-99 Silver Sword 0x240 1 0-99 Magic Axe 0x241 1 0-99 Glass Sword 0x242 1 0-99 Jeweled Sword 0x243 1 0-99 Mystic Sword --- Rings --- 0x244 1 0-99 Invisibility Ring 0x245 1 0-99 Protection Ring 0x246 1 0-99 Regeneration Ring --- Amulets --- 0x247 1 0-99 Amulet of Turning 0x248 1 0-99 Spiked Collar 0x249 1 0-99 Ankh --- Spell Mixtures --- 0x24A 1 0-99 In Lor 0x24B 1 0-99 Grav Por 0x24C 1 0-99 An Zu 0x24D 1 0-99 An Nox 0x24E 1 0-99 Mani 0x24F 1 0-99 An Ylem 0x250 1 0-99 An Sanct 0x251 1 0-99 An Xen Corp 0x252 1 0-99 Rel Hur 0x253 1 0-99 In Wis 0x254 1 0-99 Kal Xen 0x255 1 0-99 In Xen Mani 0x256 1 0-99 Vas Lor 0x257 1 0-99 Vas Flam 0x258 1 0-99 In Flam Grav 0x259 1 0-99 In Nox Grav 0x25A 1 0-99 In Zu Grav 0x25B 1 0-99 In Por 0x25C 1 0-99 An Grav 0x25D 1 0-99 In Sanct 0x25E 1 0-99 In Sanct Grav 0x25F 1 0-99 Uus Por 0x260 1 0-99 Des Por 0x261 1 0-99 Wis Quas 0x262 1 0-99 In Bet Xen 0x263 1 0-99 An Ex Por 0x264 1 0-99 In Ex Por 0x265 1 0-99 Vas Mani 0x266 1 0-99 In Zu 0x267 1 0-99 Rel Tym 0x268 1 0-99 In Vas Por Ylem 0x269 1 0-99 Quas An Wis 0x26A 1 0-99 In An 0x26B 1 0-99 Wis An Ylem 0x26C 1 0-99 An Xen Ex 0x26D 1 0-99 Rel Xen Bet 0x26E 1 0-99 Sanct Lor 0x26F 1 0-99 Xen Corp 0x270 1 0-99 In Quas Xen 0x271 1 0-99 In Quas Wis 0x272 1 0-99 In Nox Hur 0x273 1 0-99 In Quas Corp 0x274 1 0-99 In Mani Corp 0x275 1 0-99 Kal Xen Corp 0x276 1 0-99 In Vas Grav Corp 0x277 1 0-99 In Flam Hur 0x278 1 0-99 Vas Rel Por 0x279 1 0-99 An Tym --- Scrolls --- 0x27A 1 0-99 Vas Lor 0x27B 1 0-99 Rel Hur 0x27C 1 0-99 In Sanct 0x27D 1 0-99 In An 0x27E 1 0-99 In Quas Wis 0x27F 1 0-99 Kal Xen Corp 0x280 1 0-99 In Mani Corp 0x281 1 0-99 An Tym --- Potions --- 0x282 1 0-99 Blue 0x283 1 0-99 Yellow 0x284 1 0-99 Red 0x285 1 0-99 Green 0x286 1 0-99 Orange 0x287 1 0-99 Purple 0x288 1 0-99 Black 0x289 1 0-99 White --- Moonstones --- 0x28A 8 n/a x coordinate of each moonstone, only valid if it's buried (range = 0-0xFF) 0x292 8 n/a y coordinate of each moonstone, only valid if it's buried (range = 0-0xFF) 0x29A 8 n/a flag for each moonstone: 0 = buried 0xFF = in the party's inventory 0x2A2 8 n/a z coordinate of each moonstone, only valid if it's buried (range = 0,0xFF) 0 = buried in Britannia 0xFF = buried in the Underworld --- Reagents --- 0x2AA 1 0-99 Sulfur Ash 0x2AB 1 0-99 Ginseng 0x2AC 1 0-99 Garlic 0x2AD 1 0-99 Spider Silk 0x2AE 1 0-99 Blood Moss 0x2AF 1 0-99 Black Pearl 0x2B0 1 0-99 Nightshade 0x2B1 1 0-99 Mandrake Root --- mostly unknown --- 0x2B2 1 ? ? 0x2B3 1 ? ? 0x2B4 1 ? ? 0x2B5 1 1-6 number of characters in the party 0x2B6 0xF n/a non-regenerating object flags (see u5tech.txt, DATA.OVL) one bit per object bit = 0 --> object is still there bit = 1 --> object has been taken 0x2C5 1 ? ? 0x2C6 1 ? ? 0x2C7 1 ? ? 0x2C8 1 ? ? 0x2C9 1 ? ? 0x2CA 1 ? ? 0x2CB 1 ? ? 0x2CC 1 ? ? 0x2CD 1 ? ? 0x2CE 2 1-? current year 0x2D0 2 0-? current number of active monsters and charmed PC's (combat only) active = sleeping, good, poisoned inactive = charmed, dead, fled 0x2D2 2 0-? current number of active PC's and charmed monsters (combat only) 0x2D4 1 n/a icon currently shown between the stats window and the food/gold/date window (from one of the *.CH files) 0x2D5 1 0-5,0xFF active character 0-5 = character 1-6 0xFF = none 0x2D6 1 n/a mode of transportation (on foot, ship, skiff, horse, carpet) add 0x100 to get the real tile 0x2D7 1 1-13 current month (13 months per year) 0x2D8 1 1-28 current day (28 days per month) 0x2D9 1 0-23 current hour 0x2DA 1 0-23 copy of 0x2D9, todo: purpose 0x2DB 1 0-59 current minute 0x2DC 1 ? ? 0x2DD 1 ? ? 0x2DE 1 ? ? 0x2DF 1 0x30-0x37 phase of left moon If the hour is 0-4, this byte determines where moongates take the party. 0x2E0 1 0x30-0x37 phase of right moon If the hour is 20-23, this byte determines where moongates take the party. 0x2E1 1 0-0x10 Current moongate height (in pixels) Used to make moongates rise and fall gradually. This variable is used for all moongates. Note: all moongates rise at 8 PM and fall at 5 AM. 0x2E2 1 0-255 karma 0x2E3 1 ? ? 0x2E4 1 ? ? 0x2E5 1 0-0xFF number of turns since the beginning of the game (stops counting at 0xFF) 0x2E6 1 0-0xE number of hours until the party can get healed by camping set to 0xE when the party gets healed by camping decremented every full hour if this byte is 0 at the end of your camping rest, the party gets healed, but only if you rested for 6-9 hours; camping for 1-5 hours never heals the party 0x2E7 1 ? ? 0x2E8 1 n/a protective spell duration 0 = no protective spell is active 0xFF = spell remains active until removed (Badge, Crown, Sceptre, Amulet) else = turns until the spell expires (spell type is stored in 0x2D4) 0x2E9 1 ? ? 0x2EA 1 ? ? 0x2EB 1 0,1,0xFF Animations during the next frame When time has been stopped, the game sets this byte to 0 during every frame. 0 = skip animations during the next frame 1 = animate tiles during the next frame 0xFF = ? 0x2EC 1 0-4 wind direction 0 = calm 1 = north 2 = south 3 = east 4 = west 0x2ED 1 s.b. current party location (see below) 0x2EE 1 s.b. combat backup of 0x2ED when combat starts, 0x2ED is copied into this byte; when combat ends, 0x2ED is restored from this byte 0x2EF 1 0xFF,0-7 z coordinate of party (level) dungeons: 0 = level 1, 7 = level 8 settlements: 0xFF = basement, 0 = ground floor, 1 = first floor, etc. outside: 0 = Britannia, 0xFF = Underworld 0x2F0 1 0-[7|0xFF] x coordinate of party 0x2F1 1 0-[7|0xFF] y coordinate of party 0x2F2 1 0,1 crosshair visibility (combat only) 0 = hidden 1 = visible 0x2F3 1 0-0xA x coord of crosshair 0x2F4 1 0-0xA y coord of crosshair 0x2F5 1 0-0xF0 x coord of upper left chunk (see below) 0x2F6 1 0-0xF0 y coord of upper left chunk (see below) 0x2F7 1 0-? Attacker's weapon (combat only) When a PC attacks a monster during combat, the game stores the attack method in this byte. The attack method can be a weapon or a spell. 0x2F8 1 ? ? 0x2F9 1 0,1 Visibility state of the focus rectangle and crosshair (combat only, used to make them blink) 0 = not visible 1 = visible 0x2FA 1 0-6 When the first PC leaves a combat map, the direction he left in is stored in this byte; used in dungeon rooms, where all must use the same exit. 0 = no PC has left combat yet 1 = west 2 = east 3 = north 4 = south 5 = up 6 = down 0x2FB 1 s.d. combat type flags bit 0x80 = dungeon room (all must use same exit, can't leave with Esc) bit 0x4 = ? bit 0x2 = ? 0x2FC 1 ? ? 0x2FD 1 0,1 "no more enemies" flag 0 = pressing escape to leave combat doesn't work yet 1 = you can leave the battlefield by pressing escape (except in dungeon rooms) 0x2FE 1 0,1 0 = don't update/animate 2D map 1 = update and animate 2D map Ignored in dungeons. Set to 1 when you enter or leave a settlement. I don't know if the game ever sets it to 0. 0x2FF 1 0-? current light intensity The radius of the light globe around the party does not increase linearly with the light intensity. 0x300 1 0-0xFF remaining light spell duration (turns) In Lor spell = 0x64 Vas Lor spell = 0xFF Vas Lor scroll = 0xF0 0x301 1 0-0xF0 remaining torch duration (turns) borrowed torch = 0x64 ignited torch = 0xF0 0x302 0x20 n/a monster interference table: only used during combat, one byte per creature 0xFF = no monster interferes with this creature else = index of the monster that interferes with this creature 0x322 1 0-8,0xFF Shadowlord of Falsehood (location) 0 = none 1 = Moonglow 2 = Britain 3 = Jhelom 4 = Yew 5 = Minoc 6 = Trinsic 7 = Skara Brae 8 = New Magincia 0xFF = destroyed 0x323 1 0-8,0xFF Shadowlord of Hatred (location) 0x324 1 0-8,0xFF Shadowlord of Cowardice (location) 0x325 1 ? ? 0x326 1 0-0xFF ordained shrine quests bit 0 = honesty bit 1 = compassion bit 2 = valor bit 3 = justice bit 4 = sacrifice bit 5 = honor bit 6 = spirituality bit 7 = humility 0x327 1 ? ? 0x328 1 0-0xFF completed shrine quests, bits have the same meaning as in 0x326 0x329 1 ? ? 0x32A 8 n/a open/sealed flag for each dungeon 0 = sealed, 0x80 = open 0x332 8 n/a destroyed/ok flag for each shrine one byte per shrine, only bit 7 is used bit 7 = 0 --> ok bit 7 = 1 --> destroyed 0x33A 0xE n/a dungeon room cleared flags (7 dungeons, 2 bytes per dungeon) when you kill all monsters in a dungeon room, two things happen: 1) the bit corresponding to the dungeon room is set to 1 2) in the dungeon map at 0x3B4, the room's upper nibble is set to 0xA Note: there are no flags for Doom, because you can't leave Doom (except by winning the game) 0x348 0x20 n/a x coordinates of annotations 0x368 0x20 n/a y coordinates of annotations 0x388 0x20 n/a annotation tiles 0x3A8 1 0-0x20 number of entries in the annotation table (see below) 0x3A9 1 s.d. When you open a door, the game stores the door tile in this byte. Only one door can be open at any time. 0x3AA 1 0-0x1F x coord of open door 0x3AB 1 0-0x1F y coord of open door 0x3AC 1 0-FF Number of turns the door stays open. Decremented every turn, wraps around to 0xFF. 0x3AD 1 0-0xFF x coord of purchased ship (see 0x105F) 0x3AE 1 0-0xFF y coord of purchased ship (see 0x105F) 0x3AF 1 0-4 When you hoist your ship's sails and press an arrow key, the game stores the direction in this byte: 0 = none 1 = west 2 = east 3 = north 4 = south 0x3B0 1 0,1 New prompt at end of current turn 0 = don't display newline and prompt when the current turn ends 1 = display newline and prompt at end of current turn 0x3B1 1 0-0x19 number of drunken moves until you can move normally again; set to 0x19 when you get drunk 0x3B2 1 ? ? 0x3B3 1 ? ? 0x3B4 0x200 n/a map of the current dungeon 8 levels, 8x8 tiles per level 0x5B4 0x80 n/a "NPC killed" flags, 4 bytes (32 bits, 32 NPC's) per settlement flag = 0 --> NPC is alive flag = 1 --> NPC has been killed 0x634 0x80 n/a "NPC met" flags, 4 bytes (32 bits, 32 NPC's) per settlement flag = 0 --> party hasn't met NPC yet flag = 1 --> party has met the NPC ("met" means that the NPC has asked the Avatar's name and received a truthful answer) 0x6B4 0x100 n/a monster table (has 0x20 slots) monster format: see below 0x7B4 4 ? ? 0x7B8 0x200 n/a NPC schedules See *.NPC in u5tech.txt (used only in settlements) 0x9B8 0x200 ? ? 0xBB8 0x400 n/a Movement List Table (see below) 0xFB8 0x40 n/a Movement List Pointers (see below) 0xFF8 0x20 n/a NPC types See *.NPC in u5tech.txt (used only in settlements) 0x1018 0x44 ? ? 0x105C 1 ? copy of 0x105D? 0x105D 1 0-3 orientation in a dungeon 0 = north, 1 = east, 2 = south, 3 = west 0x105E 1 1-3 graphics for the current dungeon 1 = cave 2 = mine 3 = dungeon 0x105F 1 s.d. when you buy a ship or skiff, the game encodes your purchase in this byte: 0x40 = skiff n = frigate with (n-0x80) skiffs on board, n >= 0x80 when you leave the settlement where you bought the vessel, the game creates it at the coordinates stored in 0x3AD and 0x3AF Notes: 1) If you set one of the bytes at 0x322-0x324 to 0xFF, that just means the respective shadowlord won't visit the towns anymore. You'll still encounter the shadowlord in Stonegate, unless you've also set its "NPC killed" flag. 2) The Crown and the Sandalwood Box are treated as NPC's. When you take them, the game sets their "NPC killed" flag. Crown = NPC 1 in Blackthorn's castle Sandalwood Box = NPC 31 in Lord British's castle You can cast spells in Blackthorn's castle if you have the Crown in your inventory. If you don't have the Crown, the game assumes that it's still in Blackthorn's castle, and all spells you cast there will be absorbed. 3) Annotation table: When you're in a settlement, this table contains the locations of drawbridges. At 8 PM, the game places water tiles (tile 3) at the locations stored in the annotation table. At 5 AM, the game places the tiles stored in the annotation table at the corresponding locations. Changing the table in SAVED.GAM has no effect, because the game restores it from somewhere else when you Journey Onward. 4) Chunk cache: Britannia and the Underworld are divided into chunks of 16x16 tiles. Four of these chunks are cached in at any time; you see them when you view a gem. The coordinates of the upper left corner of the upper left chunk are stored at 0x2F5 and 0x2F6. Both coordinates are divisible by 0x10. In settlements, both coordinates are set to 0. --- Movement Lists --- When it's time for an NPC to move to a new location (as dictated by his schedule), the game calculates a path to the new location and stores this path in the NPC's movement list. The movement lists are stored at 0xBB8. There are 0x20 lists (one for each NPC). Each list can store up to 0x10 movement commands. The movement commands are made up of two bytes: the number of repetitions and the direction. struct Movement_List_Table { Movement_List mov_lists[0x20]; } struct Movement_List { Movement_Command mov_commands[0x10]; } struct Movement_Command { uint8 repeats; // 1 = east // 2 = north // 3 = west // 4 = south uint8 direction; } The table at 0xFB8 contains 0x20 word offsets (one for each NPC). Entries can have the following values: 0xFFFF = movement list for the NPC is empty else = offset into the NPC's movement list (must be a multiple of 2) If the NPC hasn't reached his destination after going through the movement commands, the game calculates a new path and stores it in the NPC's movement list. Notes: 1) There are no up/down movement commands. When an NPC wants to move to a location on another level, he goes to the nearest stair/ladder and then teleports to his destination. --- Monster Format --- offset length purpose 0 1 tile 1 1 tile 2 1 x coordinate 3 1 y coordinate 4 1 z coordinate (level) 5 1 depends on object type 6 1 depends on object type 7 1 depends on object type Notes: 1) The monster table contains not only monsters, but also inanimate objects (e.g. empty ships) and the party. 2) The party is always in slot 0. 3) Non-empty entries don't have to be contiguous. Todo: empty entries, object-specific fields --- Character record format --- offset length purpose range 0 9 character name zero-terminated string (length = 8+1) 9 1 gender 0xB = male, 0xC = female 0xA 1 class 'A'vatar, 'B'ard, 'F'ighter, 'M'age 0xB 1 status 'G'ood, etc. 0xC 1 strength 1-50 0xD 1 dexterity 1-50 0xE 1 intelligence 1-50 0xF 1 current mp 0-50 0x10 2 current hp 1-240 0x12 2 maximum hp 1-240 0x14 2 exp points 0-9999 0x16 1 level 1-8 0x17 1 ? ? 0x18 1 ? ? 0x19 1 helmet 0-0x2F,0xFF 0x1A 1 armor 0-0x2F,0xFF 0x1B 1 weapon 0-0x2F,0xFF 0x1C 1 shield 0-0x2F,0xFF 0x1D 1 ring 0-0x2F,0xFF 0x1E 1 amulet 0-0x2F,0xFF 0x1F 1 inn/party n/a Notes: 1) If the character is staying at an inn, the byte at offset 0x1F contains the settlement number (see "Party Location") of the inn. If the character is in the party, it contains 0. If the character hasn't joined the party yet, it contains 0xFF. If the character has been permanently killed, it contains 0x7F. --- Equipment --- 0 = Leather Helm ... 0x2F = Ankh 0xFF = none --- Party Location --- 0x0 Britannia/Underworld -- Towns -- 0x1 Moonglow 0x2 Britain 0x3 Jhelom 0x4 Yew 0x5 Minoc 0x6 Trinsic 0x7 Skara Brae 0x8 New Magincia -- Lighthouses -- 0x9 Fogsbane 0xA Stormcrow 0xB Greyhaven 0xC Waveguide -- Huts -- 0xD Iolo's Hut 0xE Sutek's Hut 0xF Sin'Vraal's Hut 0x10 Grendel's Hut -- Castles -- 0x11 Castle British 0x12 Castle Blackthorn -- Villages -- 0x13 West Britanny 0x14 North Britanny 0x15 East Britanny 0x16 Paws 0x17 Cove 0x18 Buccaneer's Den -- Keeps -- 0x19 Ararat 0x1A Bordermarch 0x1B Farthing 0x1C Windemere 0x1D Stonegate -- Castles of the Principles -- 0x1E The Lycaeum 0x1F Empath Abbey 0x20 Serpent's Hold -- Dungeons -- 0x21 Deceit 0x22 Despise 0x23 Destard 0x24 Wrong 0x25 Covetous 0x26 Shame 0x27 Hythloth 0x28 Doom -- Special -- 0xFF combat/resting/shrine Sources ------- Nytegard http://martin.brenner.de/ultima/u5save.html http://www.cosy.sbg.ac.at/~lendl/ultima/ultima5/ http://www.wi.leidenuniv.nl/~psimoons/ultima5t.htm