aritchie05 / EcoCraftingTool

Crafting calculator for Eco.
https://eco-calc.com
MIT License
24 stars 12 forks source link

AU3 is more expensive than AU2? #38

Closed Assimilater closed 2 years ago

Assimilater commented 2 years ago

Granted, I'm using resource modifier = 0.5 but that should not mean you need half an au2 to make an au3 image

rannmann commented 2 years ago

Issue validated.

Without modifier: image

With Modifier at 0.5: image

I'm not exactly sure how the resource modifier works in Eco. Does it only apply to dynamic-value items, or also to static items? If it's static items as well, then the cost to make 2x should be 1x AU2, in which case it would be unwise to only craft 1 in this case.

aritchie05 commented 2 years ago

@rannmann this is definitely incorrect, recipes have both static and dynamic inputs. This can be seen by looking at the reducible property on a recipe ingredient. If reducible is false, then it always costs that much regardless of what upgrade is in the table. AU3 costs 1 AU2 (non-reducible) as well as some Iron Bars and Nails so this price is impossible.

EDIT: I actually didn't see that it is using a resource modifier. That functionality was not tested very much, it's very possible that it is not considering the reducible property correctly

aritchie05 commented 2 years ago

Looking at crafting-parent.component.ts L526-534. It looks like the resourceCostMultiplier just needs to be removed from the else block.

        if (ingredient.reducible) {
          ...
        } else {
          price += (ingredient.price * ingredient.quantity * this.resourceCostMultiplier);
        }
rannmann commented 2 years ago

So you're sure that the resource cost modifier doesn't affect static ingredients? I haven't checked a server with that setting, but I asked around and nobody had an answer for me.

aritchie05 commented 2 years ago

Just checked with a local server that is on 0.5 resource modifier.

image