Fetchr

Fetchr

556 Downloads

Card gen does not re-calculate weight after removing an item with multiple categories

NeunEinser opened this issue ยท 0 comments

commented

Essentially, every category should have the same base weight always.

With the new system, card generation works on the entire item pool at once though. So each item has a "global" weight that is calculated once.
For items in multiple categories, this means a "global" weight per category is calculated and then the average is taken from that.

When calculating the "weight" per category, you simply take the sum of all items in that category, including those with multiple categories. Because those items only took the average, some categories might be offset, but when you take all categories of the item together, you will get the expected weight for that number of categories.

Essentially, an item of multiple categories is in all of them at once, and when you pick it it counts as picking all the categories.

The problem now arises when an item that shares a category with an item in multiple categories is picked. Now an item of multiple categories is removed from the pool, so the weight of items within that category now need to be recalculated, so that the weight of the category after removing the item is still as high as it should be.