Ability to craft lower quality with higher quality

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Blailus
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jun 29, 2016 2:20 am
Contact:

Re: Ability to craft lower quality with higher quality

Post by Blailus »

coolkau wrote: Sat Nov 09, 2024 7:36 pm - I now took out all of the modules .. which is painful enough, as there is no remove all modules shortcut.
I wondered if this was possible with the upgrade planner, and it is. String below is for an upgrade planner that removes ANY of the 3 modules of any quality from anything that can have it in them, and replaces it with nothing. Thanks for making me wonder if this was possible!

0eNqdk8FqhDAQhl9lmbPCboyy+g699FrKkpqpBJKYTaJUxHffxLKYQovY20yYb/LPn8kMg+ks43gzkmmNFpoZHHovdOdirJgxaEP4NsOn7VU885NBaEB4VJCBZipmxvZ8aL0YhZ9yFWKJOYElA6E5fkFzXrLjHRKe/ofPi6TDdbfDfWDyD/hCjtLp8JfqIJ2wZN85ZxD5LyQ9RP5QTK7H2NSrgizvGXB0rRXGi16H4ldU/YgnJuXpZSVcaCTaXn+vlhOdZjK5ahTWB0eS29aKnKOeUmOjyg3ef8cgLSZxkOa5+/lz9zOQ7APlJneTOoZPsE5SVqSmdV1SeqZFWS3LA4zSFuY=
dragon_gawain
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sun Dec 19, 2021 11:37 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by dragon_gawain »

Another thing to consider with quality math is how it works with productivity.
I've noticed that when the productivity bar completes at the same time as the main crafting bar, the output quality will always be the same (in all the cases I've observed at least).
In an example, let's say we have an electromagnetic plant producing blue chips with 300% productivity (due to research) and some quality modules. For ease of math, let's say that there's a 10% quality roll.
The pure math would state that now you have 4 independent 10% odds, but that's not the case.
There are 3 independent trials, with the last one producing double the output of the others (first two trials produce 1 blue chip, last trial produces 2).

This of course only applies to intermediates (cause you can only prod intermediates), and considering that science is also an intermediate, well, it should be considered somewhere in the math.


I wonder how this would impact VertebreakHER's test case if it was done with something more complicated, such as yellow science, which benefits a lot from the productivity researches (steel, LDS, blue chips, plastic) and checking to see if this prod quirk makes quality intermediates sway the end result more towards using quality at every step of the way.

And speaking of these test cases, from personal experience, balancing quality intermediates is kinda a huge math nightmare once you start using buildings with inherit productivity (like the foundry, electromagnetic plant, etc) and also different number of module slots (EM plant, cryogenic plant, etc).


Anyway, just wanted to toss that prod thought out there, and throw an extra wrench or two into the mix.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3031
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by BlueTemplar »

This of course only applies to intermediates (cause you can only prod intermediates)
Not only, since
buildings with inherit productivity (like the foundry, electromagnetic plant, etc)
also work on non-"intermediates"
BobDiggity (mod-scenario-pack)
User avatar
Clair
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun Mar 24, 2019 1:50 am
Contact:

Re: Ability to craft lower quality with higher quality

Post by Clair »

TBH, I think Factorio fell into a trap with regards to quality: It's an "item stack" game, where unique items occupy a slot and stack to a certain limit... that just added vastly more unique items. Many more. Those included with the mod, then multiplied it by x5, then gave each one it's own recipe.

This is a problem many games have as they add items. Minecraft, Stardew Valley, Terraria; as the number of unique items increases with updates, the "slot and stack" inventory system is stressed and begins to buckle. The game needs to compress how many "unique items" it has to reduce how many slots are needed, and having different qualities of an item stack, along with removing quality-specific recipes, would cut that clutter by 5.

Maybe it could keep track of 5 quantities per slot, and draw either from the top or bottom or at random for inserters, and let the player scroll-wheel through the available tiers when holding an item to place? As it is now though, iunno... it's a cool concept but it needs another pass I think.
dragon_gawain
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sun Dec 19, 2021 11:37 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by dragon_gawain »

BlueTemplar wrote: Tue Nov 19, 2024 12:55 am also work on non-"intermediates"
You are completely correct! I forgot about that when I made my post earlier!
Huzzah for more wrenches in this nightmare of quality math!

Trying to optimize for resource use and quality at the same time results in pretty imbalanced intermediates, which results in resource loss. A LOT of resource loss. And doing the math to balance it intentionally is very hellish, and even if your math is perfect, the odds can say "haha, you got super lucky in one intermediate but not the other for a while and now your belt based solution is fully clogged" is still possible - no matter how large your buffer to prevent this is.

Which is a nice loop back to the thread's original topic: we need a way to deal with multiple levels of quality that is not extremely resource lossy.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3031
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by BlueTemplar »

Wouldn't using a higher quality item as a lower quality item also count as «extremely resource lossy» ?
(Whether by being able to directly use it in a lower quality recipe or by converting it into lower quality.)
the odds can say "haha, you got super lucky in one intermediate but not the other for a while and now your belt based solution is fully clogged" is still possible - no matter how large your buffer to prevent this is.
Well, with a big enough buffer, the odds of that happening should become microscopic ?
(Testing in progress : viewtopic.php?f=23&t=120584)
BobDiggity (mod-scenario-pack)
dragon_gawain
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sun Dec 19, 2021 11:37 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by dragon_gawain »

Hmm, mayhaps?
I haven’t done the math on recycling vs downbinning in terms of effective resource loss, but it’s certainly possible that downbinning is more costly than recycling…

I might try to crunch those numbers a bit to see what it comes out to.

And yes, of course with a large enough buffer the odds of being screwed by the odds becomes very small.

Edit: after reading through that testing thread, allow me to amend: a large enough buffer would lead to microscopic odds (i.e. balanced distribution of crafts are balanced) assuming that the odds are true, and that the random doesn’t have a bias. As they mention in the other thread though, those odds are being done to the limit of as time approaches infinity.

I’ll be curious to watch further results of that thread.
coolkau
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Nov 08, 2024 7:08 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by coolkau »

One place where I need downgrade:
My "more than normal quality" circuit production works very nice apart from the one issue: Sulfuric Acid. I dont need high quality sulfur anywhere, and at my station I only have high quality iron... now I need to cart in low q iron just to create the acid :/ Cant just grab any plate from the line?!?! It'll be dissolved in acid anyway :D (kinda)

In terms of mixing I I found one place where it would still be good despite I generally think mixing wouldnt work: Plastic. I keep my lines mixed until I have iron or copper plates... the same would be nice for plastic as it just takes one coal.
bluegreen1024
Inserter
Inserter
Posts: 29
Joined: Wed Aug 24, 2022 9:56 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by bluegreen1024 »

In what sense does down-binning incur a resource loss other than the opportunity cost of using the quality modules in the first place? Down-binning would be 1 to 1 but reduces quality. Recycling is on average 4 to 1, so it does incur a massive resource loss, but it potentially gives another chance to increase quality. Aren't these simply different processes with different use cases, or am I misunderstanding something?
bolok
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Feb 21, 2015 5:13 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by bolok »

+1 for Add check box for production machines to accept ingredients of any quality above selected recipe. Its downgrade so it is not cheating.
Drundia
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Nov 15, 2024 5:48 pm
Contact:

Re: Add option for mixed Quality in Assemblers

Post by Drundia »

Rykuta wrote: Sun Nov 17, 2024 8:18 pm
Drundia wrote: Fri Nov 15, 2024 11:55 pm
Rykuta wrote: Wed Nov 13, 2024 9:07 pmSo why did I choose the quantity of the parts rather than any sort of complexity weighting? To me it just seemed like the simplest thing to implement and the simplest thing for users to understand at a glance. It also seemed the most in-line with the current implementation as far as how many parts of each quality it would output. (But also my probability math is definitely rusty, so I could be wrong on that point).
Let's pick red science as an example. You need 1 gear assembler for 10 red science assemblers, but it would contribute the massive 50% to the output quality. Picking highest ROI ingredient for quality will be cheap. On the other hand bumping up quality in recycler is expensive. That's why ignoring quality of ingredients may be a good solution. After all you still need to do fine work to get fine results, fine ingredients are not enough.
I'll try to explain what I mean when I say that it seems most in-line with the current implementation.

In the current implementation, in order to get a 100% guaranteed uncommon with a 10% chance to roll into a rare (for our science example); you have to successfully roll two 10% chances (the plate and the gear). Alternatively, you just have to roll a 10% on the end science product. Note that rolling two 10% in a row is actually harder than just rolling the end product. But this is totally worth it right? Because now with the guaranteed uncommon you have a 10% chance to roll a rare. Well, the odds of sequentially rolling two 10% rolls successfully is 1% right? Which as it turns out is the same as the odds of rolling that blue without any of the other modules being uncommon.

Ultimately the goal is to just make it so that putting quality modules on intermediates is worth doing and more accessible than it currently is.
Aha, I see what you talk about. However, you are focusing a lot on chances of single output in a mass production game. If you roll an uncommon gear, but not copper plate, it's not like uncommon gear is lost. In the long run you'll get an average of 10% successful rolls on both and it doesn't matter that they don't happen at the same time.

Let's keep red science example and stick some 2.5% Quality modules everywhere.

For a baseline 100 units:

Code: Select all

                  common  uncomm  rare
Miner (+7.5%)      92.50    6.94  0.56
Furnace (+5%)      87.88   10.98  1.14
Assembler (+7.5%)  79.09   17.79  3.12
So, copper ends on Furnace and gear end on Assembler. With your suggestion we'll average 83.48 common science, 14.39 uncommon, 2.13 rare. A total of 118.65 science points for 300 raw resources or 0.3955 science points per 1 resource.

Let's also use recycler to bump quality of copper plates to the level of gears. Did some short calculations for a rough estimate. In my setup I need to mine extra 56.86 copper (for a total of 156.86) and send 75.81 copper plates into recycler, which loses 56.86 units and 18.95 units are remaining to be processed in recycler with 10% quality upgrade chance.

Now the original table needs to be scaled for new amount of raw copper:

Code: Select all

                  common  uncomm  rare
Miner (+7.5%)     145.10   10.88  0.88
Furnace (+5%)     137.84   17.23  1.79
Recycler loss     -56.86
Recycler gain     +17.06   +1.71 +0.19
Final              79.09   18.94  1.98
I did fast matching on number of commons, we would still need to recycle some more to convert several uncommons to rares, but let's pretend that out copper plates are as good as gears. So we'll get 79.09 common science, 17.79 uncommon, 3.12 rare. A total of 124.03 science points, but for 356.86 raw resources, which is 0.3476 science points per 1 resource. Your suggestion brings overall better result and eliminates usage of recycler on intermediates because it's simply cheaper to not.

The biggest problem is also illustrated in the calculations above: balancing more than 2 qualities. Currently besides storing items until better times the only option is a Recycler. However it's deeper in the tech tree and requires some complex factory design (5 subfactories for each quality and logistics to handle upgrades). I'd call for 3 options with their pros and cons.

1. The basic option. Basically the name of the topic. Higher quality items can go to lower quality recipe. Extra quality is wasted.
Pros: very simple factory (can use quality when necessary and ignore it completely where not needed)
Cons: higher quality is wasted.

2. Some king of upgrading machine, available earlier than recycler. Similar to recycler: loses 75% or so of the input and the output can be upgraded using modules.
Pros: relatively simple factory (mostly without loops, you only need to loop output of upgrader into itself if item wasn't upgrader)
Cons: fewer modules than Recycle+Recraft chain, can't benefit from innate prod bonuses of Electromagnetic plant or similar.

3. Recycle+Recraft chain.
Pros: best chanced to upgrade items thanks to two sets of modules past and possible innate prod bonuses.
Cons: very complex factory (need pretty much a factory for each quality and each product in the chain, especially in the long run, also need to set up logistics)
dragon_gawain wrote: Tue Nov 19, 2024 1:26 am Hmm, mayhaps?
I haven’t done the math on recycling vs downbinning in terms of effective resource loss, but it’s certainly possible that downbinning is more costly than recycling…

I might try to crunch those numbers a bit to see what it comes out to.

And yes, of course with a large enough buffer the odds of being screwed by the odds becomes very small.

Edit: after reading through that testing thread, allow me to amend: a large enough buffer would lead to microscopic odds (i.e. balanced distribution of crafts are balanced) assuming that the odds are true, and that the random doesn’t have a bias. As they mention in the other thread though, those odds are being done to the limit of as time approaches infinity.

I’ll be curious to watch further results of that thread.
What is more costly depends on the final goal. For example in the above example with red science in this post, downbinning is more cost efficient than recycling. The number is 113.27 science points or 0.3776 science points per 1 resource.

However, if your ultimate goal is producing higher quality final product you either recycle the underdog (75.81 copper plates) or recycle the final product (75.81 red sciences). Obviously recycling final product is more costly.

Anyway, quality isn't free. You lose some machine speed and the opportunity to use other modules.

Probability theory says that for multinomial distribution (which is what happens with quality rolls) variance goes up as the number of trials goes up. Sometimes the outputs balance themselves over time, sometimes they instead grow apart, randomly.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3031
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by BlueTemplar »

In terms of mixing I I found one place where it would still be good despite I generally think mixing wouldnt work: Plastic. I keep my lines mixed until I have iron or copper plates... the same would be nice for plastic as it just takes one coal.
Mixed lines is kind of dangerous... but one thing that you can do is to have normal and uncommon on separate lanes, since a belt has 2 lanes.

(One downside : distinguishing them visually, I just had module production clogged because one quality ended up on the wrong side after the recycler.)

(With rare+ quality stored in chests and later dealt with by logibots.)

EDIT : ninjaed
bluegreen1024 wrote: Wed Nov 20, 2024 7:24 am In what sense does down-binning incur a resource loss other than the opportunity cost of using the quality modules in the first place? Down-binning would be 1 to 1 but reduces quality. Recycling is on average 4 to 1, so it does incur a massive resource loss, but it potentially gives another chance to increase quality. Aren't these simply different processes with different use cases, or am I misunderstanding something?
In the sense that you will eventually want to make quality products. And when you do, you'll have to use or waste the low quality ones somehow. And 'use' will likely be insufficient. (Upcycling counting as 'waste' here.)

EDIT :
Currently besides storing items until better times the only option is a Recycler. However it's deeper in the tech tree and requires some complex factory design (5 subfactories for each quality and logistics to handle upgrades).
Well, you'll also probably get recyclers long before you have to deal with 4 qualities, and especially 5.
BobDiggity (mod-scenario-pack)
Syriusz
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Thu May 07, 2015 12:34 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by Syriusz »

IMHO the whole choosing recipe quality should be scrapped. You should always choose regular recipe, but what result is should be dictated by what has been put in and by bonuses from modules. To avoid weird quality shenanigans, the items quality should be weighted by their ore value*. Maybe give higher base ore value for uranium and give personalised ore value for liquids. It would be SO MUCH EASIER. Choosing quality is not only very limiting, it is also a chore. If someone wants to ensure that he gets certain quality, he should set the filters on inserters. With current setup, there is no way to make mixed quality factory. And switching anything requires many changes and purging the belts... Also, default filters etc. should be "any quality". It would be nice to have "any quality" quality signal in circuit conditions, but I understand it could be difficulty to implement since game would need to basically sum 5 signals for every item every frame in every network. The worst thing is that this change probably is not even possible to do with mods unless with some very weird setup, or if devs just already put some work for it in game. So:

-Remove recipe quality
-Allow any quality in every recipe
-Expected quality of item would be weighted (by ore value) average of quality of items modified by bonuses from modules
-Default to "Any quality" filters (or allow choosing default)
-So much easier, so much more user friendly, so much more useful

*for example, one copper cable requires 0.5 copper ore, iron plate requires 1 ore, so for green circuit the copper cables would have weight of 3 (number of cables) * 0.5 (ore value) and plate 1 * 1, so the cables would have weight of 1.5 and plate 1, so 3 to 2. So if you have uncommon cables and regular plate the expected quality is (3*2+2)/5 = 8/5 = 1.6 so 60% for heaving uncommon cable. Why weighted by ore value? So for example you couldn't make substation with quality cables and regular red circuits and steel and have high chance of getting quality substation. The issue may be that it requires calculating the weights for every craft cycle, but since one machine usually will get same ingredients most of the time I bet there are some clever ways devs can make it work :D
The another issue is that the machines would jam if you locked quality for each item, like in green circuit recipe, pick up 2 rare copper cables, but rest are common, but I doubt it would be bigger issue than regular jamming, especially if we could send signal "eject ingredients" to machine (although we probably can do it already with recipe switching). And if someone has issue with it, just set up inserters to pick up only one quality of ingredient.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3031
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by BlueTemplar »

How do you weigh cycles, alternate recipes, productivity changing base resources for different chains differently, separate chains for the same result ?
BobDiggity (mod-scenario-pack)
Syriusz
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Thu May 07, 2015 12:34 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by Syriusz »

BlueTemplar wrote: Wed Nov 20, 2024 11:20 am How do you weigh cycles, alternate recipes, productivity changing base resources for different chains differently, separate chains for the same result ?
If that question is for me about weighting influence of quality items in ingredients- game would use the base value, the "total raw" value it shows you when handcrafting. All the productivity is just a bonus, and I don't see a reason to weigh that in. Sure, you probably could cheese it by focusing on quality of one ingredient over other, but it wouldn't be a game breaking as we get to that point, those small efficiency gains are meaningless, because you can have so much resources anyway. Plus to get them to quality, you would need to sacrifice production bonus anyway. And if someone finds fun in optimising for this, good for them. And the alternative recipes is just same issue as with the recycling, there are not many of alternative recipes, and if there are where it would be an issue, just devs would just set it manually for what it makes sense. Like carbon would be equivalent of 3 ore, since basic recipe takes 2 coal and 20 acid. Or maybe ignore fluids at all, since they have no quality, so just 2 ore.
Tinyboss
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by Tinyboss »

Y'all have to know that any total overhaul of quality that takes several page-long posts to describe, even before the guaranteed problems are discovered by playtesting, is never going to happen, right? The only suggestions that will be implemented at this point will be small, self-contained changes that make a clear and limited improvement to the system as it is.

Can you imagine the patch notes? "Quality has been completely overhauled. It is strongly recommended to tear down everything you've built that involves quality in any way, to avoid inadvertently wasting your quality items."
dragon_gawain
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sun Dec 19, 2021 11:37 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by dragon_gawain »

Tinyboss wrote: Wed Nov 20, 2024 2:16 pm Can you imagine the patch notes? "Quality has been completely overhauled. It is strongly recommended to tear down everything you've built that involves quality in any way, to avoid inadvertently wasting your quality items."
As if that hasn't happened before..

As an example, the change in fluid mechanics is worthy enough by itself t cause people to tear down old bases and redesign from scratch.
The rationale of "it's too different from what's already in the game so it won't happen" is bad. It's limiting the possibility space. Also, saying that the devs won't implement anything that's not a small change is looking down on the devs. Let them dare to make a large change in a patch! Give the the benefit of courage and proclaim that in the next update, everything will change! Pentapods are invading Nauvis! Run for the hills! AHHHHH! That might happen next update for all we know.. :lol:
Tinyboss
Filter Inserter
Filter Inserter
Posts: 461
Joined: Sun Nov 16, 2014 12:11 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by Tinyboss »

dragon_gawain wrote: Wed Nov 20, 2024 3:02 pmAs an example, the change in fluid mechanics
Yeah, that's actually my point. Stuff like that happens once in a major version release.
Syriusz
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Thu May 07, 2015 12:34 pm
Contact:

Re: Ability to craft lower quality with higher quality

Post by Syriusz »

Tinyboss wrote: Wed Nov 20, 2024 2:16 pm Y'all have to know that any total overhaul of quality that takes several page-long posts to describe, even before the guaranteed problems are discovered by playtesting, is never going to happen, right? The only suggestions that will be implemented at this point will be small, self-contained changes that make a clear and limited improvement to the system as it is.

Can you imagine the patch notes? "Quality has been completely overhauled. It is strongly recommended to tear down everything you've built that involves quality in any way, to avoid inadvertently wasting your quality items."
Well, not really. It would be easy to migrate, during migration make all inserters that insert into machines have filtered for quality of their recipe. Little annoying, but nothing would break.
Rykuta
Inserter
Inserter
Posts: 22
Joined: Fri Dec 25, 2020 7:37 am
Contact:

Re: Ability to craft lower quality with higher quality

Post by Rykuta »

Tinyboss wrote: Wed Nov 20, 2024 2:16 pm Y'all have to know that any total overhaul of quality that takes several page-long posts to describe, even before the guaranteed problems are discovered by playtesting, is never going to happen, right? The only suggestions that will be implemented at this point will be small, self-contained changes that make a clear and limited improvement to the system as it is.
I feel like it is kinda reductive to tell people that their suggestions (in particular on an ideas and suggestion board) are not worth having because it seems like they aren't going to happen.

There is plenty of value in suggestions that may never get implemented. I for one enjoy learning things and seeing different viewpoints on the same features/concepts; and I imagine modders likewise may find inspiration in suggestions that developers might pass over.

And likewise just because a feature is delivered and changing it might shake up a lot of foundations, doesn't mean there isn't some great unrealized potential to be squeezed out of said suggestions. A massive suggestion for an overhaul might accidentally illuminate some obvious path to greatness that someone else might have simply glossed over; or reveal some sort of hidden issue that slipped under the floorboards.

I think we should generally be encouraging people to voice their genuine ideas more instead of scaring off folk who lack the confidence because they are afraid of confrontation or afraid of their ideas being shot down; but maybe that's just me :P
Post Reply

Return to “Ideas and Suggestions”