UnReal World forums

UnReal World => Modding => Topic started by: caethan on July 11, 2017, 11:56:58 PM

Title: Quality detemination
Post by: caethan on July 11, 2017, 11:56:58 PM
I've been trying to figure out how the game decides what quality produced items are so I can better tune the %X% quality modifier in my mods.  Did a lot of testing, and here's some of my results summarized.  All of this was done with diy modded test items, so it might be different with cooking.

Both the base skill of the craftsman and the quality modifier affect the distribution of quality for items.  When a craftsman makes an item, there's a roll for how well they crafted the item, and there are four categories - two good and two bad.  The base skill of the craftsman determines what quality item is produced for each of those four categories.  They work like this, with the min base skill of 5% and max base skill of 95%:

Base SkillPoorBadGoodExcellent

This table is independent of the quality modifier in each recipe.  That means there's a couple of natural breakpoints:  craftsmen need at least 20% skill to make decent items, 40% to make fine items, and 70% to make masterwork items.

Where the quality modifier for each recipe comes in is calculating how likely each of these categories is.  Add the modifier to the character's base skill and restrict it to be between 5% and 95%, which we'll call the adjusted skill.  The adjusted skill is the likelihood of getting a good or excellent roll when you craft.  One-fifth of those good or excellent rolls are excellent (rounded down).  Same way for the bad two categories:  100% minus your adjusted skill likelihood of a poor or bad result, with one-fifth of those rolls being poor (rounded down).  Then you look up in the table to transform those categories into actual item qualities.

As an example, suppose you're crafting with carpentry skill level 77% and making an item with quality modifier 30%.  The adjusted skill is 95% (77 + 30, rounded down to 95).  So 1% of the time(100 - 95 / 5), you'll make a rough item, 4% of the time a decent item, 19% a masterwork (95 / 5) and 76% a fine item.
Title: Re: Quality detemination
Post by: caethan on July 12, 2017, 12:07:36 AM
Ingredients and tool qualities appear to put limits on how good of items you can produce.  The output item can't be any better than the average quality of its ingredients.  I haven't pinned down exactly how that average is done yet, but in most cases it's pretty straightforward.  Ingredients with [noquality] in the line aren't counted as a part of the average.  This means, for example, that in the vanilla game it's impossible to make a fine or masterwork staff, because slender trunks are always decent but don't have a [noquality] tag and so limit the output quality.

Tool limitations are a bit more complicated.  Crude tools limit output quality to decent and rough tools limit output quality to fine.  Decent or better tools have no effect.  Any item that would have been higher quality given the above skill calculations instead becomes the maximum quality (and you'll get a message saying you could have done better with better tools.) The effect of all of the tools used is averaged together.  So if you're crafting with a crude knife and a masterwork axe, they average as rough and limit the output quality to fine.  Preferred tools also have a quality limiting effect, but I haven't worked out how that works yet.  But using a stone-axe for something with {Axe} <Handaxe> will drop quality.
Title: Re: Quality detemination
Post by: Dungeon Smash on July 12, 2017, 02:10:14 AM
i believe preferred tools work on somewhat of a "sliding scale", where some tools are "tolerable", "satisfactory", "awkward" etc depending on how closely they are related to the preferred tool.  carving axe is closest to broad axe, woodsman axe is closest to splitting axe, and handaxe is somewhat close to everything.  stone axe is bad at everything.  etc.
Title: Re: Quality detemination
Post by: PALU on July 12, 2017, 06:51:04 PM
"Average" for multiple pieces of a single type of ingredient (e.g. hides) when using a bulk of one quality and any amount, regardless of how small, of the next higher quality seems to be the higher one.
For hide working it seems a broad knife can be of one quality level less than other knives while still permitting the production of masterworks hides (and I assume the relations are the same for lower quality equipment with respect to correspondingly lower max quality possible). I'd also assume a stone knife will maximize the quality at two levels lower than a same quality broad knife.

caethan is correct when saying you can't make a masterworks staff. However, it's possible to find fine and masterworks staves in villages, and those can be used as the source material for fine and masterworks javelins (skill and luck permitting and cooperating respectively, of course).
Title: Re: Quality detemination
Post by: caethan on July 13, 2017, 04:55:02 PM
"Average" for multiple pieces of a single type of ingredient (e.g. hides) when using a bulk of one quality and any amount, regardless of how small, of the next higher quality seems to be the higher one.

That's interesting!  I did notice that if you have a recipe with, say, 40 stones and 1 something of varying quality, it's averaged over each type of ingredient rather than over each item.