Gripes -- equipment optimizing program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juggle5
    Scout
    • Feb 2009
    • 30

    Gripes -- equipment optimizing program

    What equipment should I wear? This is a common question, and a while ago there was interest in making a program to help out with this.

    So, fph and I have been developing Gripes (Generic Roguelike Integer Programming Equipment Selector), and we have a first release available for download: http://sourceforge.net/projects/gripes/

    Gripes is a command-line tool that reads a chardump and reports the optimal set of equipment to wear, and it shows how its recommendation compares to your current equipment set. You can configure what "optimal" means by changing the importance of different resists/bonuses, and you can force certain items to be worn (e.g., if you have a cursed item that you can't take off). While Gripes is especially useful for novice and intermediate players with a complex set of equipment, it may also be fun for veteran players to see how well a computer program stands up to their expert choices!

    Gripes currently works with Angband 3.x and PosBand 0.9.9a, but it may work with chardumps from other variants, too. It is written in perl, so it's cross-platform (we've tested it on Mac OS X and Linux).

    Please try it out and let us know what you think! Comments, suggestions, and bug reports are welcome, and if you're an expert player and you don't agree with the recommendations of Gripes, tell us why so we can improve it.
  • pav
    Administrator
    • Apr 2007
    • 793

    #2
    This is very cool! (You might want to tell people that it needs glpk to run.)
    See the elves and everything! http://angband.oook.cz

    Comment

    • Nick
      Vanilla maintainer
      • Apr 2007
      • 9634

      #3
      Nice. I ran it on my abortive attempt at the last V comp, and it told me I'd be better without the cursed ring of Searching...

      I may have a go at adapting to FA at some point - I'm not sure if percentage resists will make it easier or harder.
      One for the Dark Lord on his dark throne
      In the Land of Mordor where the Shadows lie.

      Comment

      • jevansau
        Adept
        • Jan 2009
        • 200

        #4
        It looks neat. Unfortunately when I try to use it on Windows 7 (with either recommended perl program installed) I get the error:
        c:\gms\gripes>perl gripes.pl ..\angband-r1622\lib\user\Celoth.txt
        List form of pipe open not implemented at gripes.pl line 1416, <CHARDUMP> chunk 1.
        I did install glpk but not sure if I did so successfully.

        Regards,
        Jonathan

        Comment

        • juggle5
          Scout
          • Feb 2009
          • 30

          #5
          To pav: yes, it does require glpk (or some lp solver that can read gmpl/ampl files). Thanks for pointing this out.

          Nice. I ran it on my abortive attempt at the last V comp, and it told me I'd be better without the cursed ring of Searching...
          To Nick: It appears gripes is working for you. If you edit your character dump so that your ring of searching is inscribed as {G:Wear} then gripes will force this to be worn in its solution.

          I may have a go at adapting to FA at some point - I'm not sure if percentage resists will make it easier or harder.
          It should be possible to adapt gripes for other variants without too much work. The config files and the optimization problem are super-flexible. The hardest part is parsing character dumps for different variants correctly, especially if an attribute is treated differently between variants.

          If I have time this weekend, I might try running a FA dump through gripes to see how different it is. If you get it working with FAngband (which would be great!) let us know and we can put your changes back in the main version.

          Comment

          • juggle5
            Scout
            • Feb 2009
            • 30

            #6
            jevansau: Sorry it's not working for you yet. Neither fph or I have windows machines, so we weren't able to test it there. Thanks for being the guinea pig. To pin down where the problem is, try running gripes to just create the model, and then run the model separately through glpsol. So first:
            Code:
            perl gripes.pl -write-gmpl yourcharname.gmpl yourchardump.txt
            If this works, then do
            Code:
            glpsol -m ./problem_model.gmpl -d yourcharname.gmpl
            Let me know the results.

            If you want, you can send me your char dump (or point to where it is on the ladder, if it's there) and I can tell you what the results should look like, and see if it's a windows-specific problem or a general gripes problem.

            Comment

            • fph
              Veteran
              • Apr 2009
              • 1030

              #7
              Originally posted by jevansau
              It looks neat. Unfortunately when I try to use it on Windows 7 (with either recommended perl program installed) I get the error:
              c:\gms\gripes>perl gripes.pl ..\angband-r1622\lib\user\Celoth.txt
              List form of pipe open not implemented at gripes.pl line 1416, <CHARDUMP> chunk 1.
              If I interpret the error message correctly, that's because of a missing feature in the Windows Perl implementation.
              Try replacing line 1416
              Code:
                  open GLPSOL, "-|", $glpsol_path, '-m', $model, '-d', $tmpfile or die "Could not execute command: $glpsol_path -m $model -d $tmpfile\nDo you have glpsol installed (and the right PATH set)?"; #this should be the safest "pipe open" variant
              with this one
              Code:
                  open GLPSOL, "| $glpsol_path -m $model -d $tmpfile" or die "Could not execute command: $glpsol_path -m $model -d $tmpfile\nDo you have glpsol installed (and the right PATH set)?"; #this should be the safest "pipe open" variant
              If this works, I'll change it in the upstream version
              --
              Dive fast, die young, leave a high-CHA corpse.

              Comment

              • fph
                Veteran
                • Apr 2009
                • 1030

                #8
                Originally posted by pav
                (You might want to tell people that it needs glpk to run.)
                Yep, that's true. But glpk is free software and should install painlessly on any platform (on my ubuntu it's just a matter of "aptitude install glpk-utils").
                --
                Dive fast, die young, leave a high-CHA corpse.

                Comment

                • Nick
                  Vanilla maintainer
                  • Apr 2007
                  • 9634

                  #9
                  Originally posted by juggle5
                  To Nick: It appears gripes is working for you. If you edit your character dump so that your ring of searching is inscribed as {G:Wear} then gripes will force this to be worn in its solution.
                  Cool.

                  If I have time this weekend, I might try running a FA dump through gripes to see how different it is. If you get it working with FAngband (which would be great!) let us know and we can put your changes back in the main version.
                  I'm unlikely to do it any time soon - I'll probably give you about a 3 month head start...
                  One for the Dark Lord on his dark throne
                  In the Land of Mordor where the Shadows lie.

                  Comment

                  • andrewdoull
                    Unangband maintainer
                    • Apr 2007
                    • 872

                    #10
                    Originally posted by juggle5
                    To pav: yes, it does require glpk (or some lp solver that can read gmpl/ampl files). Thanks for pointing this out.

                    It should be possible to adapt gripes for other variants without too much work. The config files and the optimization problem are super-flexible. The hardest part is parsing character dumps for different variants correctly, especially if an attribute is treated differently between variants.
                    Is it possible to have an online version available? I'm thinking of a web-based form where you could upload character dumps to, and it makes recommendations to your equipment layout? You could then also display the dumps, and create some kind of community for Angband players, with forums and everything?

                    Andrew
                    The Roflwtfzomgbbq Quylthulg summons L33t Paladins -more-
                    In UnAngband, the level dives you.
                    ASCII Dreams: http://roguelikedeveloper.blogspot.com
                    Unangband: http://unangband.blogspot.com

                    Comment

                    • pav
                      Administrator
                      • Apr 2007
                      • 793

                      #11
                      Originally posted by andrewdoull
                      Is it possible to have an online version available? I'm thinking of a web-based form where you could upload character dumps to, and it makes recommendations to your equipment layout? You could then also display the dumps, and create some kind of community for Angband players, with forums and everything?
                      Pav likes this idea.
                      See the elves and everything! http://angband.oook.cz

                      Comment

                      • Zikke
                        Veteran
                        • Jun 2008
                        • 1069

                        #12
                        Originally posted by pav
                        Pav likes this idea.
                        This is sort of like this site, which is for WoW character optimization. This site may be more involved, but WoW is more involved. Just a conceptual example.




                        If you don't play WoW, you can put in my Shaman (which is halfway geared) to see how it rates a character that needs improvement:

                        Character: Zikat
                        Server: Chromaggus
                        A(3.1.0b) CWS "Fyren_V" NEW L:50 DL:127 A++ R+++ Sp+ w:The Great Axe of Eonwe
                        A/FA W H- D c-- !f PV+++ s? d P++ M+
                        C- S+ I- !So B ac++ GHB? SQ? !RQ V F:

                        Comment

                        • jevansau
                          Adept
                          • Jan 2009
                          • 200

                          #13
                          Hi, thanks for the help.

                          fph: after making that change, I get the error:
                          c:\gms\gripes>perl gripes.pl Celoth.txt
                          Use of uninitialized value $output in pattern match (m//) at gripes.pl line 1212
                          .
                          The solver returned an error! use -dont_reformat to see its output
                          Reading model section from problem_model.gmpl...
                          238 lines were read
                          Reading data section from C:\Users\jevans\AppData\Local\Temp\vAmVApiouy.gmpl ...
                          (unknown):0: unable to open C:\Users\jevans\AppData\Local\Temp\vAmVApiouy.gmpl -
                          No such file or directory
                          Context:
                          MathProg model processing error

                          juggle5: doing it in 2 stages works ( I didn't test this before changing the gripes.pl)

                          The analysis itself is fascinating.

                          Regards,
                          Jonathan

                          Comment

                          • juggle5
                            Scout
                            • Feb 2009
                            • 30

                            #14
                            Is it possible to have an online version available? I'm thinking of a web-based form where you could upload character dumps to, and it makes recommendations to your equipment layout? You could then also display the dumps, and create some kind of community for Angband players, with forums and everything?
                            Brilliant idea, Andrew! This would avoid the painful install of perl/glpk for those on windows (and non-developers on macs). Coming up with a good interface would take some work, but would pay off in the end.

                            This site appears to be driven by php and javascript. I'm pretty sure it's possible to call external programs--namely perl and glpsol--from php, so it seems theoretically possible to set up a web interface.

                            Pav: I'll send you a PM to find out logistics for this, since it sounds like you're interested in adding this to oook.

                            Comment

                            • juggle5
                              Scout
                              • Feb 2009
                              • 30

                              #15
                              jevansau: I think fph's diagnosis is exactly right, we just have to find the right fix. I get the same error as you if I make the suggested change. I'm a better mathematician than perl hacker, so fph will probably get a solution before I do.

                              Running in two stages works because it avoids that section of the code completely so it works as an interim solution. The only thing you're missing is some of the formatting to make the output nicer.

                              Comment

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