KaneTW / FFXIVBisSolver

FFXIV Materia-aware BiS solver
MIT License
13 stars 5 forks source link

Relic stats do not take into account the limits on bonus stats due to item level increases #11

Closed Kobata closed 7 years ago

Kobata commented 7 years ago

An example from a test MCH run

Relic stats:
(Main Hand, Skill Speed, 6)
(Main Hand, Determination, 136)
(Main Hand, Critical Hit Rate, 142)

This isn't possible as is, the closest you can get is 5 skill speed instead of 6, due to the way bonus stats from increased item level work.

KaneTW commented 7 years ago

I'm aware. It's rather complicated to solve that, but it's on my to-do list. Thanks.

KaneTW commented 7 years ago

Idea:

The stat mapping from 240 to >240 relics is necessarily non-surjective. The currently used step function gives us a piece-wise linear function s(s_b) = s_b + \sum_i c_i H(t_i - s_b) where H is the Heaviside step function.

This structure allows us to create the following model:

For each relic stat s create a SOS2 set with continuous (!) variables mu_1, ..., mu_n where n is the amount of segments.

Add a constraint \sum_i mu_i = 1

Force x-axis choice between two segments using x_s = \sum_i mu_i t_i and y-axis using y_s = \sum_i mu_i f(t_I) with both x_s and y_s nonnegative integers

This should give you 240 allocations in x and 275 stats for solving in y. Some details are probably off, I'm typing this on my phone.

KaneTW commented 7 years ago

This should also be helpful for #13, although that's a tad more complicated

KaneTW commented 7 years ago

This is solved, but I have issues with the GLPK integration. It works fine with Gurobi:

Gear:
Deathlocke Lux
Alexandrian Circlet of Aiming
Augmented Shire Conservator's Coat
Alexandrian Gloves of Aiming
Augmented Shire Conservator's Hose
Alexandrian Thighboots of Aiming
Alexandrian Belt of Aiming
Alexandrian Earrings of Aiming
Alexandrian Neckband of Aiming
Augmented Shire Conservator's Bracelet
Augmented Shire Conservator's Ring
Alexandrian Ring of Aiming
Proto Ultima Ring of Aiming
Materia:
(Head, Alexandrian Circlet of Aiming, Savage Might Materia V, 2)
(Body, Augmented Shire Conservator's Coat, Savage Might Materia V, 2)
(Hands, Alexandrian Gloves of Aiming, Savage Aim Materia V, 2)
(Legs, Augmented Shire Conservator's Hose, Savage Aim Materia V, 2)
(Feet, Alexandrian Thighboots of Aiming, Savage Aim Materia V, 2)
(Waist, Alexandrian Belt of Aiming, Savage Might Materia V, 1)
(Ears, Alexandrian Earrings of Aiming, Savage Aim Materia V, 1)
(Neck, Alexandrian Neckband of Aiming, Savage Might Materia V, 1)
(Wrists, Augmented Shire Conservator's Bracelet, Savage Aim Materia V, 1)
(Right Ring, Alexandrian Ring of Aiming, Heavens' Eye Materia V, 0)
(Right Ring, Proto Ultima Ring of Aiming, Savage Aim Materia V, 1)
(Left Ring, Augmented Shire Conservator's Ring, Savage Might Materia V, 1)
Relic stats:
(Main Hand, Skill Speed, 5)
(Main Hand, Determination, 136)
(Main Hand, Critical Hit Rate, 142)
(Main Hand, Accuracy, 1)
Food:
Priestly Omelette
Allocated stats:
[Dexterity, 35]
Result stats with food:
[Physical Damage, 77]
[Dexterity, 1605]
[Skill Speed, 418]
[Determination, 965]
[Critical Hit Rate, 1168]
[Accuracy, 700]
Result stat weight: 3098.841
KaneTW commented 7 years ago

Fixed another bug where I was limiting by the wrong stat cap (in the end, the 240 stat cap matters, after all)

Gear:
Deathlocke Lux
Alexandrian Circlet of Aiming
Augmented Shire Conservator's Coat
Alexandrian Gloves of Aiming
Augmented Shire Conservator's Hose
Alexandrian Thighboots of Aiming
Alexandrian Belt of Aiming
Alexandrian Earrings of Aiming
Alexandrian Neckband of Aiming
Augmented Shire Conservator's Bracelet
Augmented Shire Conservator's Ring
Proto Ultima Ring of Aiming
Materia:
(Head, Alexandrian Circlet of Aiming, Savage Might Materia V, 2)
(Body, Augmented Shire Conservator's Coat, Savage Might Materia V, 2)
(Hands, Alexandrian Gloves of Aiming, Savage Aim Materia V, 2)
(Legs, Augmented Shire Conservator's Hose, Savage Aim Materia V, 2)
(Feet, Alexandrian Thighboots of Aiming, Savage Aim Materia V, 2)
(Waist, Alexandrian Belt of Aiming, Savage Might Materia V, 1)
(Ears, Alexandrian Earrings of Aiming, Savage Aim Materia V, 1)
(Neck, Alexandrian Neckband of Aiming, Savage Might Materia V, 1)
(Wrists, Augmented Shire Conservator's Bracelet, Savage Aim Materia V, 1)
(Right Ring, Augmented Shire Conservator's Ring, Savage Might Materia V, 1)
(Left Ring, Proto Ultima Ring of Aiming, Savage Aim Materia V, 1)
Relic distribution:
(Main Hand, Skill Speed, 5)
(Main Hand, Determination, 115)
(Main Hand, Critical Hit Rate, 120)
Relic stats:
(Main Hand, Skill Speed, 5)
(Main Hand, Determination, 136)
(Main Hand, Critical Hit Rate, 142)
Food:
Priestly Omelette
Allocated stats:
[Dexterity, 35]
Result stats with food:
[Physical Damage, 77]
[Dexterity, 1605]
[Skill Speed, 418]
[Determination, 965]
[Critical Hit Rate, 1168]
[Accuracy, 699]
Result stat weight: 3098.841