Page 1 of 1

ItemIngredientPrototype/ItemProductPrototype.quality_offset

Posted: Wed Nov 20, 2024 3:49 am
by braxbro
I propose a (hopefully) relatively simple change to the ingredient/product prototypes to allow mods to more powerfully interact with quality in recipes: the ability to specify a quality offset (relative to the recipe's quality) for ingredients and products. Along with it, recipes would gain a maximum and minimum quality.

So, in hopefully more useful/concrete terms:
Item ingredients and item products gain a quality offset property. This quality offset is a 16 bit signed integer limited between -254 and +254. (since there are only 255 possible qualities.)
When a recipe is set, this offset is applied to the ingredient/product's quality to determine the final quality used in the recipe. (may be better to be an 8-bit unsigned int and a bool to invert?)
Recipes' minimum quality and maximum quality are, by default, set to the lowest quality defined minus the largest negative offset and the highest quality defined minus the largest positive offset, to prevent undefined qualities from being used; if an ingredient or product has an offset that makes it possible for the quality to be an out of bounds index, the game errors at the end of data stage.
Recipes with only fluid inputs would, by default, have their maximum quality set to their minimum quality instead.

For example, if I added a quality_offset of -1 to the iron plate ingredient of a green circuit, and a quality_offset of +1 to the copper wire, the recipe could only be executed at uncommon, rare, and epic quality levels, (and would require quality to be unlocked to be usable) and would output products as appropriate for those recipe qualities.

...This is probably a far-fetched suggestion, but I figured I would make it nonetheless.

Re: ItemIngredientPrototype/ItemProductPrototype.quality_offset

Posted: Sat Nov 30, 2024 10:30 am
by braxbro
I can’t think of a way to refine this, but I still think it would be really cool to be able to hook quality with recipes. It would make both recipes and quality far more powerful tools for modders to experiment with.

Re: ItemIngredientPrototype/ItemProductPrototype.quality_offset

Posted: Thu Dec 05, 2024 9:18 pm
by protocol_1903
+1, this could introduce some powerful tools for mods with multiple quality tiers

Re: ItemIngredientPrototype/ItemProductPrototype.quality_offset

Posted: Mon Dec 30, 2024 6:48 pm
by braxbro
To add onto this: maybe allowing fixed quality, regardless of input quality, to be specified?

So that for example we can have recipes that have always-normal byproducts or the like without needing to use compound entities and fluids for it, or deterministic crafts for improving quality...