Add ability to loss quality level when crafting.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
angal
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jul 31, 2015 7:27 am
Contact:

Add ability to loss quality level when crafting.

Post by angal »

What?

Add modifier quality_loss to Effect type:
https://lua-api.factorio.com/latest/types/Effect.html

Add reference previous to QualityPrototype:
https://lua-api.factorio.com/latest/pro ... .html#next

It will work similar to quality effect, but in opposite way:
- If machine have total quality_loss 0 or below, than nothing happens (vanilla way, can be optimized out somehow after prototype stage if non entity provides quality_loss)
- If machine have total quality_loss above 0, than “quality loss roll” performs
- When it called, if current QualityPrototype has previous property, if quality loss roll succeed, quality of crafting result decreased

Optional suggestions (I think it will be good, but I will be happy with any variant of implementation):
- “Quality loss roll” performs after regular quality roll
- Add previous_probability similar to next_probability at QualityPrototype. Which allows to loose multiple quality level at once
https://lua-api.factorio.com/latest/pro ... robability
- “Quality loss roll” can be inserted into 1 randomize call via math


Why?

Quality loss will allow to make more dynamic balance between up-cycling raw resources vs finished product.
For example: When you get legendary iron plates, but it quality drops to rare when you gen processors from it, and you need up-cycle/recycle them again.
Another example: You should select to use quality modules when doing legendary staff from legendary to decrease quality loss versus productivity modules.

Independent previous field on QualityPrototype (instead of use next) will allow 2 things:
- Currently we can have multiple levels have the same next. If some mod done this – it will be its responsibility to provide correct previous.
- It allow making independent loss levels between original levels
Example: Add “broken” variant to each normal level. So upcycling will go Normal → Uncommon → Rare → ... and down-cycling Rare→Broken Rare → Uncommon → Broken Uncommon → …

Another interesting use case: Add 100% quality loss to recycler, which seems logical (when you break something you lose quality) and make up-cycling mechanics much different.


Vanilla:
I think even vanilla van benefit from this:
Adding quality loss for some inaccurate machines (recyclers, crushers, low tier assemblers) will seems logical.
Quality modules can fix this by having big quality_loss positive modifier.
Speed modules can have some bigger quality_loss modifier then they quality modifier, making usage of speed module more practical in low quality setups and less practical in high quality setups.

But all vanilla thing is just an ideas why this can be usefull, not part of this request.
Wizatek
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Nov 06, 2024 1:40 pm
Contact:

Re: Add ability to loss quality level when crafting.

Post by Wizatek »

I like that your suggestion would allow for some interesting twists with the quality mechanic. Earlier I was just thinking of an early game modded building with quality loss to "downcycle" excess quality components. Somewhat like an inverse of a recycler with quality modules.

With your method, you could then have simultaneous chances to get a better or worse quality, right?

Alternatively, I suggest a simpler way, where we only use the overall quality modifier. Allow us to remove the 0% quality modifier floor for machines or recipes via modding, so that a negative quality modifier is actually applied and gives chances at producing lower quality parts. On the other hand, that means no simultaneous chance at a higher quality.
When legendary parts are crafted with a quality bonus nothing happens. So when a common part is crafted with negative modifier, nothing would happen either. Alternatively, the recipe would produce no output for the common-downgrade craft (part is scrap).
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 505
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Add ability to loss quality level when crafting.

Post by BraveCaperCat »

I feel like this could be implemented in a better way. Instead of a quality_loss property, we'd add a can_reduce_quality property of type bool.
If a machine has at least one Effect with can_reduce_quality set to true, then if the total quality effect applied on the machine would be negative, then that negative quality would be applied like positive quality, but in the opposite direction. But if none of the Effects has can_reduce_quality set to true, then the total quality would get capped at 0% like it does now.

This would allow you to make modules that reduce quality, either obeying the cap or not.
You can even have a module that adds quality but removes the cap for other modules.
If you want to see the mods I've made, press one. If you need me to update a mod to 2.0, press two. If you're looking for QA, press three. If you've been waiting over 1 and a half years for Digital Age, bad luck.
Wizatek
Manual Inserter
Manual Inserter
Posts: 4
Joined: Wed Nov 06, 2024 1:40 pm
Contact:

Re: Add ability to loss quality level when crafting.

Post by Wizatek »

BraveCaperCat wrote: Sun Jun 07, 2026 3:25 pm I feel like this could be implemented in a better way. Instead of a quality_loss property, we'd add a can_reduce_quality property of type bool.
Yes, that's exactly what I meant with the second part of my post.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 505
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Add ability to loss quality level when crafting.

Post by BraveCaperCat »

Wizatek wrote: Sun Jun 07, 2026 7:00 pm
BraveCaperCat wrote: Sun Jun 07, 2026 3:25 pm I feel like this could be implemented in a better way. Instead of a quality_loss property, we'd add a can_reduce_quality property of type bool.
Yes, that's exactly what I meant with the second part of my post.
Yeah, although my property would apply to all effects on a machine if it were true on any of the effects on a machine.
If you want to see the mods I've made, press one. If you need me to update a mod to 2.0, press two. If you're looking for QA, press three. If you've been waiting over 1 and a half years for Digital Age, bad luck.
Post Reply

Return to “Modding interface requests”