DAT Format (Witchaven savegame)

From ModdingWiki
Jump to navigation Jump to search

The SVGN*.DAT files produced by Witchaven when saving a game are always 8,269 bytes long and store the saved game name, player structure and a few other points of data that aren't kept in the accompanying SVGM*.MAP file (which is a version 6 BUILD MAP.)

File format

! Verify signedness of potion counts, health, armor, exp

Offset Data type Description Note
0x0000 char[20] Saved game name (NULL-terminated, always stores 20 bytes)
0x0014 INT32LE ! Player X position (ignored?)
0x0018 INT32LE ! Player Y position (ignored?)
0x001C INT32LE ! Player Z position (ignored?)
0x0020 ... ! ...Not filled in yet, various player data
0x0091 INT32LE Scare spell charges Must have corresponding flag set to cast
0x0095 INT32LE Night Vision spell charges
0x0099 INT32LE Freeze spell charges
0x009D INT32LE Magic Arrow spell charges
0x00A1 INT32LE Open Doors spell charges
0x00A5 INT32LE Fly spell charges
0x00A9 INT32LE Fireball spell charges
0x00AD INT32LE Nuke spell charges
... ... ! not filled in yet ...
0x0119 INT32LE Scare scroll flag 1 = has this spell
0x011D INT32LE Night Vision scroll flag
0x0121 INT32LE Freeze scroll flag
0x0125 INT32LE Magic Arrow scroll flag
0x0129 INT32LE Open Doors scroll flag
0x012D INT32LE Fly scroll flag
0x0131 INT32LE Fireball scroll flag
0x0135 INT32LE Nuke scroll flag
0x0139 INT32LE Count of Health potions in inventory
0x013D INT32LE Count of Strength potions in inventory
0x0141 INT32LE Count of Cure Poison potions in inventory
0x0145 INT32LE Count of Resist Fire potions in inventory
0x0149 INT32LE Count of Invisibility potions in inventory
0x014D INT32LE Experience level
0x0151 INT32LE Experience points
0x0155 INT32LE Current health
0x0159 INT32LE Maximum health
0x015D INT32LE Armor points
0x0161 INT32LE Armor type 1 = leather, 2 = chainmail, 3 = plate
0x0165 UINT8 Standing on something flag ! should always be 1?
0x0166 INT32LE fallz ! should always be 0?
... ... ... ! ...not filled in yet (mostly data for non-player elements?)
0x2044 UINT8 ! Automapping? Unsure of the purpose as hex-editing it didn't cause a visible result.
0x2045 UINT16LE Durability points of player's shield
0x2047 UINT16LE How many game cycles of ornate horn (vampire time) powerup remain
0x2049 UINT16LE Poison flag 1 = player is poisoned
0x204B UINT16LE How many game cycles to wait for next poison damage

Notes

  • Player position is probably stored via a dummy sprite in the SVGM*.MAP file, and ignored here. ! Verify.
  • There is a bug in the game which sometimes causes the vampire time powerup to be given in a saved game when it should not be. The exact cause of this is not yet known but may be a result of improperly forcing a 32-bit value into a 16-bit one. ! Verify.

Source

The Witchaven source code and WHED program from L&S Publishing were referenced.