aritchie05 / EcoCraftingTool

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

Fix price calculation for non-reducible ingredients with modified res… #50

Closed aritchie05 closed 2 years ago

aritchie05 commented 2 years ago

…ourceCostMultiplier

Resolves #38

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
eco-crafting-tool ✅ Ready (Inspect) Visit Preview Jun 15, 2022 at 5:27PM (UTC)
rannmann commented 2 years ago

Is the modifier supposed to affect the work input? I noticed the price goes slightly down with the modifier set to 0.5 now, and it seems to be calorie-cost-related.

aritchie05 commented 2 years ago

Is the modifier supposed to affect the work input? I noticed the price goes slightly down with the modifier set to 0.5 now, and it seems to be calorie-cost-related.

I am not exactly following. A quick test seems to show craft resource modifier having no effect on calorie cost (which is correct).

100x modifier: image

0.1x modifier: image

rannmann commented 2 years ago

Default modifier (1): image

Modifier = 0.5: image

rannmann commented 2 years ago

It's easier to see if price per 1000 calories is a high value.

aritchie05 commented 2 years ago

Hmm that is strange. It only seems to apply when the ingredient cost is non-zero. If you set all the ingredient costs to zero, and just leave the calorie cost, changing the craft resource modifier has no effect. Need to investigate more.

aritchie05 commented 2 years ago

@rannmann are you testing on currently deployed environment or with the Preview for this PR?

rannmann commented 2 years ago

@rannmann are you testing on currently deployed environment or with the Preview for this PR?

I was using the preview for this PR.

aritchie05 commented 2 years ago

@rannmann are you testing on currently deployed environment or with the Preview for this PR?

I was using the preview for this PR.

I looked at this quite a bit until I came to a realization. Changing the craft resource modifier SHOULD actually increase the price of an AU3 somewhat, given that the ingredients (iron bar, nail) are in the outputs section. This is because those outputs have a nonzero price (e.g. 0.01). When craft resource modifier is increased, the number of that ingredient (e.g. Iron Bar) required for the AU3 recipe goes up. So the price should go up slightly.

This only applies to outputs that have ingredients that are also in the outputs section.

rannmann commented 2 years ago

Ah right, that makes sense.