Equipment Optimizer

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

    Equipment Optimizer

    I've always wanted to write a program to help me determine what items I should be wearing in Angband. Well, I finally got around to making one! I thought I'd post it here and give back a tiny bit to the Angband community.

    It's a command-line tool. Basically, you fill in a spreadsheet that describes what equipment you have and what attributes are important, then run the tool with the spreadsheet as input. The problems I see right now are:
    1. It's a little tedious to enter in all the data for your stuff, especially if you have 30-40 items.
    2. It's difficult picking good weights for how important everything is. I have reasonable values in an example file, but please let me know if you get better ones.


    I have a pre-compiled binary for Mac OS X 10.5. Otherwise, you'll have to compile it yourself. It's just C code, but it relies on the "lpsolve" library (needed to solve integer linear programming problems). There's a README that has more detailed instructions. If you get it working on another system, I'm sure others would appreciate it if you can post a binary somewhere.

    Source + Mac Binary


    Source Only
  • fph
    Veteran
    • Apr 2009
    • 1030

    #2
    Hi;
    I have been working on the same problem, I hope we can join efforts. I'll send you a pm with my e-mail address shortly.

    1) The data-entering part can be avoided with a parser that inputs a character dump. I have some Perl code for that.
    2) I was thinking about building a problem description in GNU Mathprog (the native modelling language for the glpk IP solver, I think it's a common format); but using this or C, like you did, is only a matter of taste.
    3) My first idea was something close to your modelling, but now I think stackable items should be modelled in a slightly different way that is closer to their "real" in-game meaning:
    a) for each attribute, you have a variable that is constrained to its maximum "meaningful" value: e.g., constraints sum_i RFire[i] >=1, Speed[i]>=40.
    b) for each object i, if it provides said attributes, then it increases the variable: e.g., a ring of resist fire has RFire[i]=1, a ring of speed +10 has Speed[i]=10
    c) you have a set of "dummy objects" that provide each attribute: e.g. a DummyNoFireResist object that has RFire[DummyNoFireResist]=1, a DummySpeedAround30 that has Speed[DummySpeedAround30]=10.
    d) each "dummy object" has a "badness" value; minimize the total badness
    e) slots are modelled in the obvious way

    The dimension of the problem increases, but this is not a concern; on the other hand, you have a more meaningful modelling of things like speed: speed 40 is not twice as good as speed 20. In "real" Angband life, this is not linear.

    --federico
    Last edited by fph; September 13, 2009, 14:24.
    --
    Dive fast, die young, leave a high-CHA corpse.

    Comment

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