Results 1 to 9 of 9

Thread: Ability to give a flat bonus to the scores of certain items in the maximizer

  1. #1
    Senior Member soolar's Avatar
    Join Date
    May 2015
    Posts
    122

    Default Ability to give a flat bonus to the scores of certain items in the maximizer

    I would love to be able to give certain items that are useful for things other than just their numeric modifiers a bonus score to account for their useful abilities without outright forcing their equipment, so that they can become naturally equipped if I don't have anything particularly well suited to my current task.

    For example, the mafia thumb ring (or whichever one it is that gives adventures), and screege's spectacles for the bonus meat stuff. There are other items I've thought I'd like to do this with, but those are the ones that I know I would right off the top of my head.

    I've toyed around with ideas for how to implement this via ASH, and the only way I can see to do it is to give these items a flat score, instead of a bonus score (in case they're already naturally suited to my current statement), unless I want to effectively implement my own maximizer from scratch in ASH.

    One way I can see to do this that seems reasonable to me is to have the +equip (and maybe -equip too) accept a numeric argument, something like "+100equip mafia thumb ring" to give the thumb ring 100 bonus points, but not necessarily outright force its equipment. Or it could just be a new keyword, like "+100bonus mafia thumb ring" or something, if +/-equip already accepts a numeric argument for some other reason that I've missed. Could likewise accept negatives to subtract from the score, although I don't have an actual use-case for negatives in mind yet.

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,793

    Default

    I think I understand what you want although I don't understand the maximizer enough to assess how feasible the request is.

    That said, I dealt with a similar problem by defining an outfit that had all of those things I would be glad to wear for some secondary reason. I would wear it, maximize against something and then tweak the maximizer string until I got the result I thought I wanted. Forcing it to only change equipment if there was something better was obviously key.

    I can imagine automating this is awkward - you would have to handle the possibility that the secondary items were not available before getting naked and equipping them and you would have to do some experimentation until you embedded a maximizer string in code.

  3. #3
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,831

    Default

    Heh, this functionally overlaps with my similar request here.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Woss | Om****est (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  4. #4
    Senior Member soolar's Avatar
    Join Date
    May 2015
    Posts
    122

    Default

    I've written a patch which I have tested for the last couple days and it definitely seems to work. I went with using bonus as a new keyword. Patch is attached. Java is not my strongest language, so please do let me know if there are any issues with it and I'll try to fix them.
    Attached Files

  5. #5

    Default

    The help text in data/maximizer-help.html also needs updating.

    I'm also curious how this affects performance, but I'm probably not the person to evaluate that.

  6. #6
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,583

    Default

    Hmm. I would actually use this. I have aftercore scripts that use the maximize and have trouble, because my stats might not be high enough yet to equip a specific item. I do worry about performance. The maximizer code is very touchy.

  7. #7
    Senior Member soolar's Avatar
    Join Date
    May 2015
    Posts
    122

    Default

    I'll try out profiling the maximizer with and without my patch and see if there is a noteworthy performance hit, but especially with a minor optimization I've made since the posted patch I don't think there will be... Can't say for sure until I've tried it though.

  8. #8
    Senior Member soolar's Avatar
    Join Date
    May 2015
    Posts
    122

    Default

    Alright, I've done some performance testing. There seems to be a minor hit, but I really do mean minor. It adds up to less than a second in a large aftercore inventory with no combination limit. Here are the maximizer strings and the durations they took to run, in a situation where I built mafia, launch it, immediately ran the three maximizer requests, then quit, so no other factors should be impacting it.

    WITH change:
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp
    140400 combinations checked, best score 9,894.47 (29.758 Seconds)
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp, food drop
    140400 combinations checked, best score 9,960.47 (26.713 Seconds)
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp, food drop, candy drop
    140400 combinations checked, best score 9,960.47 (26.825 Seconds)

    WITHOUT change:
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp
    140400 combinations checked, best score 9,894.47 (29.611 Seconds)
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp, food drop
    140400 combinations checked, best score 9,960.47 (26.616 Seconds)
    5 exp, item, 0.2 meat, mp regen, 0.2 mainstat, 0.1 moxie, 0.5 hp regen, mp, hp, food drop, candy drop
    140400 combinations checked, best score 9,960.47 (26.528 Seconds)

    If you can think of a better way to test the performance or any other situations I should expand my testing to, I'll be happy to investigate further.

    I've attached a new patch with a minor optimization I made and with maximizer-help.html updated.
    Attached Files

  9. #9
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    13,531

    Default

    Bumping to remind somebody to look at your patch.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •