Describe the bug
The quest score computation delivers unexpected results. It seems the score given for subdrops is very low. See screenshot for an example.
To Reproduce
Add the items as seen in the screenshot. But any quest with subdrops should work.
Expected behavior
Score, at least for the 3 main items, seems to be computed as sum of drop chances for each item divided by the quest's stamina cost. One would expect the same to hold for subdrops, maybe weighted by some lower multiplier if one wants to be fancy. But as we can see in the example below, the subdrop does not add about 20/10 = 2 to the score as would be expected, but only 0.05. This is by a factor of 40 lower, which seems a bit much, even if we assume subdrops were multiplied with some smaller weighting coefficient.
Screenshots
![image](https://user-images.githubusercontent.com/51118500/132364522-e17612a3-ea5d-40a2-a955-5fd812174b83.png)
Desktop:
Browser: Firefox
Additional context
After looking at the code for a bit, it seems that the wrong parameters are passed. The relevant code sections are the following:
Score values:
|
const score_values = Object.freeze({ |
|
TOP_TWO: 1.0, |
|
THIRD: 0.75, |
|
SUBDROP: 0.5, |
|
PRIORITY_MULTIPLIER: 2.0 |
|
}); |
get_quest_score
function:
|
function get_quest_score(item_name, base_score) { |
|
if (typeof(item_name) === "object") { |
|
item_name = item_name[quest_data.tags.ITEM_NAME]; |
|
} |
|
if (merged_recipes.hasOwnProperty(item_name) && item_name !== undefined) { |
|
return base_score * (projects.data().items.includes(item_name) ? score_values.PRIORITY_MULTIPLIER : 1); |
Score computation for the 3 main drops:
|
let quest_score = 0; |
|
// CHECK MAIN ITEMS |
|
quest_score += get_quest_score(quest_info[quest_data.tags.ITEM + 1], quest_info[quest_data.tags.ITEM + 1][quest_data.tags.DROP_PERCENT]); |
|
quest_score += get_quest_score(quest_info[quest_data.tags.ITEM + 2], quest_info[quest_data.tags.ITEM + 2][quest_data.tags.DROP_PERCENT]); |
|
quest_score += get_quest_score(quest_info[quest_data.tags.ITEM + 3], quest_info[quest_data.tags.ITEM + 3][quest_data.tags.DROP_PERCENT]); |
And score computation for subdrops:
|
// CHECK SUBDROPS |
|
const quest_subdrops = quest_info[quest_data.tags.SUBDROPS]; |
|
for (let i = 0, j = quest_subdrops.length ; i < j ; i++) { |
|
const subdrops_percent = quest_info[quest_data.tags.SUBDROPS_PERCENT]; |
|
if (subdrops_percent === undefined) { |
|
// ASSUME ALL SUBDROPS ARE 20% DROP RATE |
|
quest_score += get_quest_score(quest_subdrops[i], score_values.SUBDROP); |
|
} |
As we can see, with no priority items the quest score as given by get_quest_score
is just its 2nd parameter.
For the computation of the 3 main drops, we see that their drop chance is passed as 2nd parameter, which usually has a value of 36 or 24 (percent). For subdrops however, score_values.SUBDROP
is used instead, which has a value of 0.5. That also explains the discrepancy by a factor of 40 compared to 20% drop chance. I guess this was intended as some sort of weighting factor? But it is definitely the wrong argument here, as it doesn't involve the drop chance of 20% for those items, even though the comment above the call to get_quest_score
refers to that. So this would have to pass 20 instead.
Aditionally, score_values
defines score multipliers different from 1 not just for subdrops but also for the 3rd drop. Either this should be removed so that quest score depends solely on item drop chance, but not on whether they are main, 3rd or subdrop. Or otherwise these weights should actually be used, by using that multiplier in get_quest_score
. score_values
is not used anywhere else.