pepijndevos / LolItemSets

Optimize LoL builds for specific parameters
http://pepijndevos.nl/LolItemSets/
Eclipse Public License 1.0
0 stars 1 forks source link

Refactor and improve algorithm #7

Closed pepijndevos closed 9 years ago

pepijndevos commented 9 years ago

I'm going to make things a bit cleaner and provide a mechanism to "overlay" custom data.

There is some repetition in defining all the properties. Most of them are the same.

Adding mana regen data should not be so much work.

We could add abilities and passives as we like them. I played Singed the other day, so I want to make a build that accounts for his mana=life passive and his Q mana drain.

pepijndevos commented 9 years ago

I've reported the bug about the maps key missing. I've also reported that the PercentMPRegenMod stat isn't being applied on items.

I hope they fix it soon.

pepijndevos commented 9 years ago

What do you think about repeated items? Most of the time it's not what you'd really build due to the unique passives.

I've never seen anyone actually build 3 Infinity Edge. Though my brother told me you can build 5 Rod of Ages on Ryze.

Generating builds with unique items would make it easy to overlay info about unique passives, and thus allow Bloodthirster to show up in Life steal builds.

aengelberg commented 9 years ago

I'm not exactly sure we even need Simulated Annealing for this. We could probably write a custom linear-time algorithm that guarantees the best build.

(let [item-values (vec (for [i items] ...)) ; calculate the value each item provides based on the attributes given
      item-values-subsequent (vec (for [i items])) ; the value AFTER the same item has been included (i.e. ignore unique passives)]
  (loop [values item-values
         build []]
    (if (= (count build) 6)
      build
      (let [i (apply max-key values (range (count items)))]
        (recur (assoc values i (item-values-subsequent i))
               (conj build (items i)))))))

something to think about.

pepijndevos commented 9 years ago

The reason is that you can get stuck in a local maxima. You are essentially taking the best single item, and continue to add items such that (+ build item) is maximised.

Consider effective health. Searching for the first item will yield an item that has both health and armour, and continue adding items that provide health and armour. Items such as Ohmwrecker and Sunfire Cape (750 HP, 95 armour), while in the grand scheme of things, it might be better to build Warmog's Armor and Thornmail(800HP, 100 armour). Not a great example, but I hope you get the point.

Though in practice it might return acceptable results. It might even be desirable to optimise the linear way, as doing so might give you a stronger early game, traded off for a few percent in late game.

pepijndevos commented 9 years ago

How often do you go back in midlane? I think it makes sense to factor this into the mana calculation. Like, (+ mana (* regen lane-time))

pepijndevos commented 9 years ago

Did the overlay for items and champs.