SAVE.DAT File Format

SAVE.DAT files are archived data files that contain data for savegames. Everything about the player, party members, global variables, and state of the world map is stored here. The only thing not included is information about each town, which is stored in individual .SAV files. While they have the .DAT extension, they do not have the same format as other .DAT files. These files are found in, XX representing the number of the save game.

Introduction
Almost everything has been verified for the Mac version of Fallout 2; there may be some differences between this and the Windows version.

A little explanation of the data types:


 * ASCII (C-style) strings end with a 0 byte - the hex value, not the character '0'. So, if the length of an ASCII string is 32, it can contain 31 characters with   at the end.


 * Most numbers are written as four byte integers, in big-endian (most significant byte first) format. Negative numbers are stored in two's complement format (e.g. -1 is ).


 * The data in a save.dat file is not written all at once, but in a series of separate functions. This can be seen when examining debug files (debug.log). When saving it has the following entries:

LOADSAVE: Save file header size written: XXXX bytes.

LOADSAVE: Save function #X data size written: XXXX bytes. ... where X is some number

This is done because different functions save different types of data (about quests, items, etc.). All the data is recorded sequentially. Therefore, to describe the file we divide the data into separate functions. There are 27 functions (not including the header). The numbering starts with zero.

Because parts of the data have variable sizes, it can be fairly difficult to find a particular part of the data. It is considerably easier with the help of the file description and looking in debug.log for the size of the right function.

Note: offsets for each function (beginning with the fourth) are shown relative to the end of the previous one.

Header
Size: 0x7563 (decimal 30051) bytes.

Function 0 - Unused
Size: 0x00 (decimal 0) bytes. This function never writes anything.

Function 1 - Unknown
Size: 0x04 (decimal 4) bytes.

Function 2 - GVARS
Size: variable. In Fallout 2 v1.02d it is 0x0AE0 (decimal 2784) bytes.

Function 3 - Maps
Size: variable.

Function 4 - GVARS
Size: variable. In Fallout 2 v1.02d it is 0x0AE0 (decimal 2784) bytes.

This is an exact duplicate of Function #2. It's not known why this was done.

Function 5 - Player and inventory
Size: variable. This appears to be in the same format used for objects on maps.

Function 6 - Player stats
Size: 0x0178 (decimal 376) bytes.

This section has the same format as PRO files for critters, starting at offset 0x30 in the PRO file.

Function 7 - Kill counts
Size: 0x4C (decimal 76) bytes.

Function 8 - Tag skills
Size: 0x10 (decimal 16) bytes.

Function 9 - Perks
Size: 0x02C8 (decimal 712) bytes.

Function 10 - Party
Size: variable. In Fallout 2 v1.02d it is 0x3058 (decimal 12376) bytes.

Function 11 - Combat
Size: 0x04 (decimal 4) when not in combat; variable when in combat.

Data marked * only present when in combat.

Function 12 - Party AI
Size: variable.

Function 13 - Experience and level
Size: 0x14 (decimal 20) bytes.

Function 14 - Unused
Size: 0x00 (decimal 0) bytes. This function never writes anything.

Function 15 - Traits
Size: 0x08 (decimal 8) bytes.

Function 16 - Unknown
Size: 0x04 (decimal 4) bytes.

Function 17 - Preferences
Size: 0x50 (decimal 80) bytes.

A 'text_line_delay' variable also exists, but doesn't seem to be stored here.

The Mac version has a "1" value between speech volume and brightness; its meaning is unknown.

Function 18 - Character window
Size: 0x05 (decimal 5) bytes.

Function 19 - World map
Size: variable. In Fallout 2 v1.02d it is 0x0AE0 (decimal 2784) bytes.

The contents of this function are the same as worldmap.dat.

Function 20 - Unused
Size: 0x00 (decimal 0) bytes. This function never writes anything.

Function 21 - Video Archives
Size: 0x11 (decimal 17) bytes.

Function 22 - Skill use
Size: 0xD8 (decimal 216) bytes.

Function 23 - Party
Size: variable.

Function 24 - Event queue
Size: variable.

Function 25 - Interface
Size: 0x10 (decimal 16) bytes.

Function 26 - Unused
Size: 0x00 (decimal 0) bytes. This function never writes anything.

Inventory item format
This appears to be the same format as items on maps. (This is correct for the Mac version of FO2; the PC version may be slightly different.)

List of skills
0x00: Small Guns 0x01: Big Guns 0x02: Energy Weapons 0x03: Unarmed 0x04: Melee Weapons 0x05: Throwing 0x06: First Aid 0x07: Doctor 0x08: Sneak 0x09: Lockpick 0x0A: Steal 0x0B: Traps 0x0C: Science 0x0D: Repair 0x0E: Speech 0x0F: Barter 0x10: Gambling 0x11: Outdoorsman

List of critter types
0x00: Men 0x01: Women 0x02: Children 0x03: Super mutants 0x04: Ghouls 0x05: Brahmin 0x06: Radscorpions 0x07: Rats 0x08: Floaters 0x09: Centaurs 0x0a: Robots 0x0b: Dogs 0x0c: Manti 0x0d: Deathclaws 0x0e: Plants 0x0f: Geckos 0x10: Aliens 0x11: Giant ants 0x12: Big Bad Boss

List of perks
Note: Starred (*) perks change other stats when they are chosen in-game, and have no effect in and of themselves. Daggers (†) indicate special perks that are used by the engine and not normally seen on the character screen. 0x00: Awareness 0x01: Bonus HtH Attacks 0x02: Bonus HtH Damage* 0x03: Bonus Move 0x04: Bonus Ranged Damage 0x05: Bonus Rate of Fire 0x06: Earlier Sequence* 0x07: Faster Healing* 0x08: More Criticals* 0x09: Night Vision 0x0A: Presence 0x0B: Rad Resistance 0x0C: Toughness* 0x0D: Strong Back* 0x0E: Sharpshooter 0x0F: Silent Running 0x10: Survivalist 0x11: Master Trader 0x12: Educated 0x13: Healer 0x14: Fortune Finder 0x15: Better Criticals* 0x16: Empathy 0x17: Slayer 0x18: Sniper 0x19: Silent Death 0x1A: Action Boy* 0x1B: Mental Block (FO1 only) 0x1C: Lifegiver 0x1D: Dodger* 0x1E: Snakeeater 0x1F: Mr. Fixit 0x20: Medic 0x21: Master Thief 0x22: Speaker 0x23: Heave Ho! 0x24: Unimplemented, DO NOT USE! (Friendly Foe in FO1) 0x25: Pickpocket 0x26: Ghost 0x27: Cult of Personality 0x28: Scrounger (FO1 only) 0x29: Explorer 0x2A: Flower Child (FO1 only) 0x2B: Pathfinder 0x2C: Animal Friend (FO1 only) 0x2D: Scout 0x2E: Mysterious Stranger 0x2F: Ranger 0x30: Quick Pockets 0x31: Smooth Talker 0x32: Swift Learner 0x33: Tag!* 0x34: Mutate!* 0x35: Nuka-Cola Addiction 0x36: Buffout Addiction 0x37: Mentats Addiction 0x38: Psycho Addiction 0x39: Radaway Addiction 0x3A: Weapon Long Range† 0x3B: Weapon Accurate† 0x3C: Weapon Penetrate† 0x3D: Weapon Knockback† 0x3E: Powered Armor† 0x3F: Combat Armor† 0x40: Weapon Scope range† 0x41: Weapon Fast reload† 0x42: Weapon Night sight† 0x43: Weapon Flameboy† 0x44: Armor Advanced I† 0x45: Armor Advanced II† 0x46: Jet Addiction 0x47: Tragic Addiction 0x48: Armor Charisma† 0x49: Gecko Skinning 0x4A: Dermal Impact Armor 0x4B: Dermal Impact Assault Enhancements(*) 0x4C: Phoenix Armor Implants 0x4D: Phoenix Assault Enhancements(*) 0x4E: Vault City Inoculations 0x4F: Adrenaline Rush 0x50: Cautious Nature 0x51: Comprehension 0x52: Demolition Expert 0x53: Gambler 0x54: Gain Strength 0x55: Gain Perception 0x56: Gain Endurance 0x57: Gain Charisma 0x58: Gain Intelligence 0x59: Gain Agility 0x5A: Gain Luck 0x5B: Harmless 0x5C: Here and Now* 0x5D: HtH Evade 0x5E: Kama Sutra Master 0x5F: Karma Beacon 0x60: Light Step 0x61: Living Anatomy 0x62: Magnetic Personality 0x63: Negotiator 0x64: Pack Rat* 0x65: Pyromaniac 0x66: Quick Recovery 0x67: Salesman 0x68: Stonewall 0x69: Thief 0x6A: Weapon Handling 0x6B: Vault City Training 0x6C: Alcohol Raised Hit Points 0x6D: Alcohol Raised Hit Points II 0x6E: Alcohol Lowered Hit Points 0x6F: Alcohol Lowered Hit Points II 0x70: Autodoc Raised Hit Points 0x71: Autodoc Raised Hit Points II 0x72: Autodoc Lowered Hit Points 0x73: Autodoc Lowered Hit Points II 0x74: Expert Excrement Expeditor 0x75: Weapon Enhanced Knockout† 0x76: Jinxed (*) - The charisma loss from the assault implants is applied when you get them, but is not part of the perk.

List of traits
0x00: Fast Metabolism 0x01: Bruiser 0x02: Small Frame 0x03: One Hander 0x04: Finesse 0x05: Kamikaze 0x06: Heavy Handed 0x07: Fast Shot 0x08: Bloody Mess 0x09: Jinxed 0x0A: Good Natured 0x0B: Chem Reliant 0x0C: Chem Resistant 0x0D: Sex Appeal (In Fallout 1 this was Night Person) 0x0E: Skilled 0x0F: Gifted -1: (none)

TeamX document
Copy of original document (in russian)