Save File Debugger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sirridan
    Knight
    • May 2009
    • 560

    Save File Debugger

    Buzzkill's earlier run in with vista murdering his savefile and my subsequent fixing of said file, had me thinking that it may be a good idea to write a utility to take care of this.

    In addition, it could be used to look at save files when in development to see what is going on (or to cheat... naughty people) but if someone really wanted to cheat so badly they could, it's not like it's that hard to savescum or learn a little C.

    Anyway, I'm going to develop a little program that loads a savefile and displays essentially every bit of info in it, and would allow one to really look into a savefile, fix one, or generate one based off a character dump (and generate character dumps from DEAD characters)

    Anyway screenshot posted of very basic UI, and a description of what will be on each tab:

    File Info - File info (duh), size, blocks, version, etc
    Player Info - Stats, messages, adventure log, race, class, spells known, etc.
    Equipment - Gear equipped
    Inventory & Home - What items are had at home and in inventory
    Monsters - Monster knowledge, uniques alive/dead
    Dungeon - Dungeon map, items, monsters, and such
    Artifacts - Artifacts known, unknown, lost
    Randarts - Same as above but for randarts, and other randarty info.
    Item Knowledge - Item flavors and their corresponding items
    Attached Files
  • Pete Mack
    Prophet
    • Apr 2007
    • 6883

    #2
    Originally posted by Sirridan
    ... I'm going to develop a little program that loads a savefile and displays essentially every bit of info in it, and would allow one to really look into a savefile, fix one
    Sounds cool
    Generate one based off a character dump
    Sounds like a mega-cheat--way too tempting for abuse.
    Generate character dumps from DEAD characters
    This used to be a standard feature of Angband, and I often bring it back when I build a new version. I don't understand why it went away in the first place.

    Comment

    • Sirridan
      Knight
      • May 2009
      • 560

      #3
      Originally posted by Pete Mack
      Sounds like a mega-cheat--way too tempting for abuse.
      True... maybe have that but have the character made as wizardmode... If not I just won't implement this, because you're right, way easy to cheat with it.

      Comment

      • Bill Peterson
        Adept
        • Jul 2007
        • 190

        #4
        If you display equipment worn, carried, and in the home in a way that shows the damage, resists, etc. it will be a great help in selecting what to wear.

        Depending on how spoily you want to make it, players could see how many uniques, artifacts they haven't seen.

        If you can make it to read old save files you could use it to import characters from earlier games.

        All sorts of good things possible with your idea, I'd hate to see you abandon or cripple it just because some might use it to cheat.

        BTW, what are you using to develop it?

        Comment

        • Sirridan
          Knight
          • May 2009
          • 560

          #5
          Originally posted by Bill Peterson
          If you display equipment worn, carried, and in the home in a way that shows the damage, resists, etc. it will be a great help in selecting what to wear.

          Depending on how spoily you want to make it, players could see how many uniques, artifacts they haven't seen.

          If you can make it to read old save files you could use it to import characters from earlier games.

          All sorts of good things possible with your idea, I'd hate to see you abandon or cripple it just because some might use it to cheat.

          BTW, what are you using to develop it?
          I plan to try to enable old savefile porting, full spoilers (but they can be hidden).

          Using C# to build it

          I'll add an equipment optimizer too once I have the basics done.

          Comment

          • Magnate
            Angband Devteam member
            • May 2007
            • 5110

            #6
            Originally posted by Sirridan
            Using C# to build it
            Oh dear. That means a dependency on mono at least, coupled with a fairly high chance of it being Windows-only. If you're developing it on Windows, do you have any way to test it on other platforms? I'm happy to test it on Linux (as I suspect are many others) - but I don't know C# so if it doesn't work we're a bit stuck.
            "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

            Comment

            • fph
              Veteran
              • Apr 2009
              • 1030

              #7
              This seems related to an old idea I had.
              Given all the data about the equipment in your house, and a "rating" of importance of all resistances and flag, finding "the best kit to wear" is just a mathematical problem (integer programming), for which specific tools exist (glpk, for example, for a free/libre solver library).
              This means that you could hack together an utility that munges your character dump (or your savefile), looks into your house(s), and tells you which is the best equipment to wear.
              I once wrote such an utility for Zangband; it worked, and it regularly found a better kit than the one I was wearing (more resistances/flags/AC/bonuses, maybe put together in unexpected ways -- e.g. all the base resists covered from different artifacts like a jigsaw puzzle).
              The impact could be limited on Vanilla (where you have a single house, and thus a limited number of stashed items, and fixed artifacts), but definitely more interesting for variants with randarts and multiple houses -- I used to play Z, I don't know about the more "modern" variants.

              Would anyone be interested if I rewrote and published such a tool? Or do you think 'it only takes away the fun from the player', since Angband is (also) an inventory-management game?
              --
              Dive fast, die young, leave a high-CHA corpse.

              Comment

              • Rizwan
                Swordsman
                • Jun 2007
                • 292

                #8
                Originally posted by fph
                This seems related to an old idea I had.
                Given all the data about the equipment in your house, and a "rating" of importance of all resistances and flag, finding "the best kit to wear" is just a mathematical problem (integer programming), for which specific tools exist (glpk, for example, for a free/libre solver library).
                This means that you could hack together an utility that munges your character dump (or your savefile), looks into your house(s), and tells you which is the best equipment to wear.
                I once wrote such an utility for Zangband; it worked, and it regularly found a better kit than the one I was wearing (more resistances/flags/AC/bonuses, maybe put together in unexpected ways -- e.g. all the base resists covered from different artifacts like a jigsaw puzzle).
                The impact could be limited on Vanilla (where you have a single house, and thus a limited number of stashed items, and fixed artifacts), but definitely more interesting for variants with randarts and multiple houses -- I used to play Z, I don't know about the more "modern" variants.

                Would anyone be interested if I rewrote and published such a tool? Or do you think 'it only takes away the fun from the player', since Angband is (also) an inventory-management game?
                Please. I think it would be a big help specially for people new to the game and for those times when its three in the morning and you cant decide whether to wear a leather armor or dragon scale mail

                Comment

                • juggle5
                  Scout
                  • Feb 2009
                  • 30

                  #9
                  An equipment optimizer would be great. I've toyed with the idea of writing one, but if you have one that could be resurrected, that's a lot easier. I often play Angband with randarts on, so it's always a challenge to find the right set of equipment.

                  I'll even offer advice for setting up the integer programming problem, as that's the most interesting part for me. As a first pass you could optimize the number of resists you have, but it seems worthwhile to include some appropriate weighting for the resists and bonuses. For example, it would be more important to cover the base resists than others, or there could be a combination of armor that covers fewer resists total but has better bonuses to your stats and speed..

                  Comment

                  • Sirridan
                    Knight
                    • May 2009
                    • 560

                    #10
                    Originally posted by Magnate
                    Oh dear. That means a dependency on mono at least, coupled with a fairly high chance of it being Windows-only. If you're developing it on Windows, do you have any way to test it on other platforms? I'm happy to test it on Linux (as I suspect are many others) - but I don't know C# so if it doesn't work we're a bit stuck.
                    Meh I'll do it in C and I'll make it text based so one could use it from command line in windows/linux/macosx

                    Anyway I have a good spot of time today, so I'll have something useable tonight hopefully.

                    Comment

                    • Magnate
                      Angband Devteam member
                      • May 2007
                      • 5110

                      #11
                      Originally posted by Sirridan
                      Meh I'll do it in C and I'll make it text based so one could use it from command line in windows/linux/macosx
                      That would be very helpful - thanks.
                      "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                      Comment

                      • Sirridan
                        Knight
                        • May 2009
                        • 560

                        #12
                        Progress is happening, due to schedule at school/work and what have you, things are going a bit slower than I would like, but they are going!

                        Code:
                        a) a Broad Sword (2d5) (+9,+9) (+0) {cursed}
                             Permanently cursed.
                             Slays animals, evil creatures, undead, demons, orcs, trolls, 
                             giants, dragons.
                             *Slays* dragons, demons, undead.
                             Branded with acid, lightning, flames, frost, venom.
                             Provides immunity to acid, lightning, fire, cold.
                             Provides resistance to acid, lightning, fire, cold, poison, fear, 
                             light, dark, blindness, confusion, sound, shards, nexus, nether, 
                             chaos, disenchantment.
                             Makes you vulnerable to acid, electricity, fire, cold.
                             Cannot be harmed by acid, electricity, fire, cold.
                             Sustains strength, intelligence, wisdom, dexterity, constitution, 
                             charisma.
                             Blessed by the gods.  Slows your metabolism.  Impairs hitpoint
                             recovery.  Impairs mana recovery.  Makes you afraid of melee, and
                             worse at shooting and casting spells.  Feather Falling.  Speeds
                             regeneration.  Prevents paralysis.  Stops experience drain.  
                             Grants telepathy.  Grants the ability to see invisible things.  
                             Aggravates creatures nearby.  Drains experience.  Induces random
                             teleportation.  
                             
                             Combat info:
                             2 blows/round.
                             Average damage/hit: 24.4 vs. animals, 24.4 vs. evil creatures, 
                             30.5 vs. undead, 30.5 vs. demons, 30.5 vs. orcs, 30.5 vs. trolls, 
                             30.5 vs. giants, 30.5 vs. dragons, 30.5 vs. creatures not
                             resistant to acid, 30.5 vs. creatures not resistant to
                             electricity, 30.5 vs. creatures not resistant to fire, 30.5 vs.
                             creatures not resistant to cold, 30.5 vs. creatures not resistant
                             to poison, 42.8 vs. dragons, 42.8 vs. demons, 42.8 vs. undead, and 
                             18.3 vs. others.
                             Sometimes creates earthquakes on impact.
                             
                             Radius 1 light.  No fuel required.
                        I'm leaning more about save file formats right now... check out the weapon I was messing with... (Yeah so what I set all the flag values to FFFF?)

                        Comment

                        • Andros
                          Rookie
                          • Aug 2011
                          • 3

                          #13
                          Any chance there's been progress on this? I've now lost 2 awesome characters to corrupt files, and for the second I was backing up the save file manually AND via Carbonite. Even restoring a version from ~15 levels and a day earlier didn't help. I'm convinced at this point that the game is somehow corrupting my saves as i load them after powering down for a while. I don't really want to cheat, but I also want to actually play the game without being forced to never close it and hope nothing crashes.

                          Comment

                          • nppangband
                            NPPAngband Maintainer
                            • Dec 2008
                            • 926

                            #14
                            I was thinking about adding a couple hundred checks (after practically every iteration or function in the save/load process) so it is easy to see exactly where broken savefiles go bad. The game can load an awful lot of garbage data before it realizes something is wrong.
                            NPPAngband current home page: http://nppangband.bitshepherd.net/
                            Source code repository:
                            https://github.com/nppangband/NPPAngband_QT
                            Downloads:
                            https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57

                            Comment

                            Working...
                            😀
                            😂
                            🥰
                            😘
                            🤢
                            😎
                            😞
                            😡
                            👍
                            👎