Ultima Stones | Ultima IV Home | Development | File Details
CGA | CON | DNG | EGA | MAP | SAV | TLK | ULT


*.SAV File Specifications

    There are three specifications in the SAV group. The major one is the PARTY.SAV data type, 502 (0x1F6) bytes long. The second, for MONSTERS.SAV and OUTMONST.SAV is 256 (0x100) bytes. The last is DNGMAP.SAV, a type of 512 (0x200) bytes.

PARTY.SAV - Everything about the Party

    This is the main data file for persistent information. In terms of cheats, most of the appropriate data for modification is here. The file is a fixed size. Most of the data is in discrete character, 16 bit integer and 32 bit integer types. Because of the member data being alike for all eight units, a complex type can be defined. Figure 1. below defines the file. Figure 2. is the complex type for the party member units (B1 - B8).

Figure 1: Party Data Schematic

Figure 2: (B) Party Member Schematic – 39 (0x27) bytes

Format

The following is an explanation of the information in the above schematics.

  1. Moves [32 bit integer] – count of all entered commands in normal play.
  2. Party Member Data [39 byte complex type] –
  1. Hit Points [16 bit integer] –
  2. Maximum Hit Points [16 bit integer] –
  3. Experience Points [16 bit integer] –
  4. Strength [16 bit integer] –
  5. Dexterity [16 bit integer] –
  6. Intelligence [16 bit integer] – 99
  7. Magic Points [16 bit integer] – 99 point max in game set by trade and intelligence.
  8. Weapon Readied [16 bit integer] – index of current weapon readied to the hands, see weapon inventory for enumeration.
  9. Armour Worn [16 bit integer] – index of armour item worn, see armour inventory for enumeration.
  10. Name [16 element 8 bit character array] – name string of a maximum 15 total characters long terminated by the zero character 0x00.
  11. Gender [8 bit character] – 0x0B (M.gif (879 bytes)) for male 0x0C (F.gif (863 bytes)) for female
  12. Class [8 bit character] – 0x00 is a mage, followed by bard, fighter, druid, tinker, paladin, ranger, and lastly 0x07 is shepherd
  13. Health [8 bit character] –
    1. 0x47 ‘G’ – good
    2. 0x50 ‘P’ – poisoned
    3. 0x53 ‘S’ – slept
    4. 0x44 ‘D’ – dead

The gray section in Fig. 2 is a 16 bit integer that does not affect any known attribute or setting. Its 0 except for Julia (1) and Katrina (6).

  1. Food Units [32 bit integer] – 0 to 999999 range, the value is in hundredths and the decimal part is not displayed in-game
  2. Gold Pieces [16 bit integer] – 0 to 9999 range.
  3. Virtue Table [8 element 16 bit integer array] – 0 to 99 range, level of each virtue attained, note that 0 is partial avatarhood, the elements in order are
  1. honesty,
  2. compassion,
  3. valor,
  4. justice,
  1. sacrifice,
  2. honor,
  3. spirituality,
  4. humility.
  1. Torches [16 bit integer] – 0 to 99 range, for use with Ignite command.
  2. Gems [16 bit integer] – 0 to 99 range, for use with View command.
  3. Keys [16 bit integer] – 0 to 99 range, for use with Unlock command.
  4. Sextants [16 bit integer] – 0 to 99 range, for use with Locate command, only one sextant is ever required for a use does not "use it up."
  5. Armour in Inventory [7 element 16 bit integer array] – 0 to 99 range each element, order is as follows:
  1. cloth,
  2. leather,
  3. chain,
  4. plate,
  1. magic chain,
  2. magic plate,
  3. mystic robe
  1. Weapons in Inventory [15 element 16 bit integer array] – 0 to 99 range each element, order as follows:
  1. staff,
  2. dagger,
  3. sling,
  4. mace,
  5. axe,
  1. sword,
  2. bow,
  3. crossbow,
  4. flaming oil,
  5. halberd,
  1. magic axe,
  2. magic sword,
  3. magic bow,
  4. magic wand,
  5. mystic sword.
  1. Reagents in Inventory [8 element 16 bit integer array] – 0 to 99 range each element, order as follows:
  1. sulfurous ash,
  2. ginseng,
  3. garlic,
  4. spider silk,
  1. blood moss,
  2. black pearl,
  3. nightshade,
  4. mandrake root.
  1. Spells Prepared [26 element 16 bit integer array] – 0 to 99 range each element, order as follows:
  1. awaken,
  2. blink,
  3. cure,
  4. dispell field,
  5. energy,
  6. fireball,
  7. gate travel,
  8. heal,
  9. iceball,
  1. jinx,
  2. kill,
  3. light,
  4. magic missile,
  5. negate magic,
  6. open,
  7. protection,
  8. quickness,
  9. resurrect,
  1. sleep,
  2. tremor,
  3. undead fear,
  4. view,
  5. wind-change,
  6. x-it,
  7. y-up,
  8. z-down.
  1. Quest Item Flags 1 [8 bit character] – 8 bit flags, aligned as follows:
  1. 0x80 - key of truth,
  2. 0x40 - key of love,
  3. 0x20 - key of courage,
  4. 0x10 - bell of courage,
  5. 0x08 - book of truth,
  6. 0x04 - candle of love,
  7. 0x02 - skull cast into the Abyss,
  8. 0x01 - skull of Mondain.
  1. Quest Item Flags 2 [8 bit character] – 8 bit flags, the three most significant bits being unknown bits, then:
  1. 0x10 - bell rung at the Abyss,
  2. 0x08 - book read at the Abyss,
  3. 0x04 - candle lit at the Abyss,
  4. 0x02 - wheel of the HMS Cape,
  5. 0x01 - silver horn.
  1. Longitudinal Position [8 bit character] – 0x00 to 0xFF range, X-coordinate of character on world map.
  2. Latitudinal Position [8 bit character] – 0x00 to 0xFF range, Y-coordinate of character on world map.
  3. Virtue Stone Flags [8 bit character] – 8 bit flags for virtue stones,
  4. Rune Flags [8 bit character] – 8 bit flags for runes,
  5. Number of Members in Party [16 bit integer] – 1 to 8, number of party members in the member table that have joined and are traveling with the avatar.
  6. Party Display Image Code [16 bit integer] – display tile index, usually 31 for the avatar image tile, also for horse, ship and balloon.
  7. Balloon/Dungeon State [16 bit integer] – (surface) 0 when not in the balloon or on the ground, or 1 in flight in the balloon. (dungeon) several flags not all typed.
  8. Felucca’s Phase [16 bit integer] – 0 to 7, one of the eight moon phases:
  1. new moon,
  2. waxing crescent,
  3. first half,
  4. waxing gibbous,
  5. full moon,
  6. waning gibbous,
  7. last half,
  8. waning crescent.
  1. Trammel’s Phase [16 bit integer] – Same format as Felucca’s phase.
  2. Ship Hull Strength [16 bit integer] – 0 to 99 range, hit points of a ship traveled on, normal maximum is 50 but is increased to 99 with addition of wheel item.
  3. Unknown 2 [16 bit integer] – 0 to 65535
  4. Unknown 3 [16 bit integer] – 0 to 65535
  5. Unknown 4 [16 bit integer] – 0 to 65535
  6. Last Meditation Moves [16 bit integer] – 0 to 65535; stores the amount of Moves divided by 100; if (Moves /100) == LastMeditatonMoves, the player cannot meditate at a shrine.
  7. Unknown 6 [16 bit integer] – 0 to 65535
  8. Unknown 7 [16 bit integer] – 0 to 65535
  9. Dungeon Direction [16 bit integer] – 0 to 3, 0 is facing west, 1 north, 2 east and 3 is south.
  10. Dungeon Level [16 bit integer] – 0 to 7, 0 being the first, highest floor
  11. Dungeon Inside [16 bit integer] – 0 when saved on the surface, 1 to 8 (for the dungeon) + 0x10 
  1. Deceit,
  2. Despise,
  3. Destard,
  4. Wrong,
  5. Covetous,
  6. Shame,
  7. Hythloth,
  8. Abyss.

Unknowns

    The first is a 32 bit integer, no equivalent data value is known. It is 0x00000000 in PARTY.NEW. The value is always increasing and seems to be a real time clock or some other counter.

    The two 16 bit slots before and after the armour list are always observed to be 0x0000. Several of the end of file slots (delineated as 16 bit integers) are changing during use and are still being researched. 

Knowns not saved

    Several items of game information are not saved. They are always random or run out if the game is quit. These include the Silver Horn timer and Wind Direction.

MONSTERS.SAV & OUTMONST.SAV - Hostile and Surface Object Storage

    These files hold type and position information of objects on the map and in dungeons. All hostiles are stacked in the lowest indexes first. The higher indexes hold things like frigates and gold from defeated enemies and stack towards the lower indexes. Note that this means you can have no more than 32 of these objects on the map. On an event like a move command input the unit latest info is updated with the previous info moved to the last info list. When inside dungeons, OUTMONST.SAV holds the data from MONSTERS.SAV so that MONSTERS can hold the dungeon creature information.

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
00 Unit Latest Tile
20 Unit Latest X Coord
40 Unit Latest Y Coord
60 Unit Last Tile
80 Unit Last X Coord
A0 Unit Last Y Coord
C0 Unused Padding
E0 Unused Padding

 

DNGMAP.SAV - The Dungeon Saved In

    When saving in a dungeon, all eight levels are copied to this file. This records any gold, triggered traps and used orbs that are player modifiable and reset (lost) when the player leaves. The data is formatted the same as the floor information from the dungeon file without the rooms at the end.