Towdium / JustEnoughCalculation

A simple minecraft mod help you calculate the cost for recipes
Other
53 stars 38 forks source link

Suggestion about amount #62

Closed Soyaro666 closed 4 years ago

Soyaro666 commented 4 years ago

Hey,

I'm currently playing FTB Ultimate Reloaded and added this mod to my client. Now I got the task to brew some potions and ran into a little problem: variable in- and outputs.

I could setup the recipes to require 1, 2 or 3 water bottles and a nether wart to create the same amount of awkward potions I added, but all three variants just are a third of the truth. I thought about adding a nether wart with a consumption of 33% or 34%, which isn't true either, because it would calculate a side output of up to 2/3 of a wart, depending on the amount of potions I want.

I thought of some possible solutions. 1.: The ability to add variable amounts. Maybe you could offer a max amount instead of a fixed amount. So I could save a recipe with "up to 3" as an output. the corresponding input (in this case the water bottles) could get a checkbox for "multiply by amount of output" so the output of awkward potions would be stored as up to three and the water bottles as 1*output-amount. 2.: The ability to define two amounts for an ingredient. Lets look at the nether wart. The brewing stand does in theory consume 33% of a wart per potion, but at least 1 per operation. Thinking about a checkbox again, if a percentage amount is added you could check "waste excess" so the calculator could handle "1 to 3 potions consume one wart in total". this of course could end up in some miscalculations because 3 times 33% isn't 100%, but for amounts below multiple stacks this would work just fine.

  1. (may already work but I didn't check yet): save multiple recipes, one for 1 in, 1 out, one for 2 in, 2 out and one for 3 in, 3 out. In this case the calculator should choose the version with the most output for calculations, falling back to smaller versions only to calculate remaining amounts that aren't dividable by three. EDIT: just checked point 3. Calculator uses the newest stored recipe for the potion, ignoring the other two at all.

Another case I just found is the Thaumcraft Cauldron. There you have to add aspects by throwing in items but most Items have more aspects than needed of even completely different aspects one can't use during the process. These excess aspects can be ignored, generating flux and causing trouble sooner or later, or the excess aspects can be cristallyzed by adding one quartz shard per excess aspect. Here I could think of a mechanic calculating an amount of quartz shards as ingredient, depending of the amount of excess aspects if there are any. One would need a completely new kind of recipe that takes a look at the outputs-view and reacting to aspects being there. Of course one could simply take a look there, adding the amounts shown there and keep that many quartz shards in range but I thought I'd mention that because it's kind of a similar problem: variable but predictable inputs and outputs for recipes.

Of course these are special cases and in 99% of the game one wouldn't care for this features but an additional checkbox here or there doesn't hurt those 99% and the remaining 1% would be glad it's there.

Towdium commented 4 years ago

Thanks for report!

To be clear, the current system always picks the latest recipe you added. Here is the aim: At the beginning of game you add the recipe - 1x wood log => 4x plank. Then at some time you made a sawmill, then you add the new recipe - 1x wood log => 6x plank. I'm assuming the lastest added recipe is the one you want to use.

For the potion recipes, why not just stick to the 3-in, 3-out recipe? Basically you just use some extra bottles, but get some potions (almost) for free. Maybe in theory variable amount of items makes sense, but I don't see practical benefit in this case. Also, variable amount in recipes not only introduces some extra work in calculation engine, but leads to some confusing concepts and user interactions. I need to further consider this idea.

For cauldron recipes, there are ways to handle it nicely, but takes some extra work. You can use placeholder labels to represent aspects. Then use these placeholder labels as input in recipes, making the recipes looks like items => aspects => items. In this case, the usage of aspects will be calculated exactly, then you can find the exact amount of extra aspects in "extra outputs" tab. Let me know if it makes sense to you.

Using the same idea, here is an almost perfect solution for potion recipes: 1 nether wart => 3x quota for awkward potion (as placeholder labels), 1x water bottle + 1x quota for awkward potion => 1x awkward potion. It just requires some extra steps to set up the placeholder labels, but I don't think editing a variable amount will be easier if it is possible. Also, you get the exact amount of how many extra awkward potions you can craft.

Soyaro666 commented 4 years ago

in Ultimate Reloaded I don't need JEC-placeholders for aspects because JEI already offers placeholder-items with the aspects icons. And as I said before I just mentioned Thaumcraft aspects because it's a similar problem: Different side outputs depending on the input.

For Brewing the awkward potion might have been a bad example. Lets say I have a label "standard potions" containing multiple different potions I'd like to keep with me for longer exploration. Lets say I have a few splash potions the calculator can't calculate the ingredients, either it would calculate way too much gunpowder or generate up to three times the potions as output.

And it's not limited to vanilla brewing since some mods (Botania for example) add similar mechanics (or at least did in older versions).

While I do understand your thaumcraft solution (actually I mentioned the same idea in my original post) I don't understand how labels could help me with potions. could you maybe provide a screenshot to explain it better?

Towdium commented 4 years ago

First recipe: nether wart => 3x placeholder

2019-11-08_11 52 49

Second recipe: water bottle + placeholder => awkward potion

2019-11-08_11 53 16

When you calculate for 1 awkward potion:

2019-11-08_11 53 45

It tells that you have 2x free awkward potions:

2019-11-08_11 53 46

When you calculate for 3x awkward potion, it still takes 1x nether wart:

2019-11-08_11 53 56

Soyaro666 commented 4 years ago

Wow. The screenshots really helped to understand your idea, The placeholder works just like the variable I asked for. If I got it right it should even work on 3 different splash potions. like "one gun powder gives 3 placeholders that can be used in every recipe that needs gunpowder". So with a little creativity your calculator already had my requested feature - maybe you should save those screenshots for a small tutorial? Feel free to close the Thread, you absolutely solfed that problem. thanks!

Towdium commented 4 years ago

Good to know it's solved!