Clothing economy is still broken

Started by Shurp, September 15, 2018, 10:03:29 AM

Previous topic - Next topic

zizard

Your crafters won't be able to process the cotton once they have to start making components. Crafting is impractical to train pre-components.

Thirteen Fish

#16
tl;dr: The highest level crafters add about $35 over raw textiles.

Quote from: Thirteen Fish on September 15, 2018, 06:30:51 PM
A higher level crafter producing apparel averaging closer to excellent quality can consistently add ~25% in value to the raw materials even accounting for the trade penalty.

It turns out that while this is technically true it is misleading as it only applies to cotton and a level 19 or 20 crafter producing armchairs or dusters. The statement had been based on a chart floating around (that I can't now locate) relating average quality to crafting level. Reviewing the game code[1] the actual expected quality at each level is a bit lower than what the chart indicates, summarized in the following table[2]:



Expected or 'average' quality is indicated by assigning the qualities a number 0 (Awful) through 5 (Masterwork). So for example a level 6 crafter will average Normal quality, a level 9 crafter will average between Normal and Good, and a level 19 crafter will average between Good and Excellent, slightly favoring Excellent.

Each quality level multiplies the value of the finished product by an amount[3]:



This allows the calculation of a "value multiplier" for each crafting level. That is, over the long term a crafter at a particular level will on average increase the value of what they produce by the "value multiplier" as a result of the quality of items they produce. When selling, furniture and apparel get additionally multiplied by 70% and weapons by 20%:



One way to interpret this table is that for apparel and furniture the increase in value from quality is canceled by the trade penalty except at literally level 20 where quality nets on average 4%. That's a pretty low reward but it doesn't (yet) rule out textile crafting for income because crafting also adds work and work has value.

Value for most things is calculated as ((cost of materials) + (cost of work)) * quality[4] where each unit of work adds about $0.22. If the cost of materials is high or the amount of work is low then the final product value will be mostly just raw materials (and quality but from above we can ignore it, at least for now). For example a Normal quality plainleather animal bed which takes 40 ingredients and 7 work, the total value is $85.54 with only $1.54 or ~2% of the total value being extra labor. It's pretty clear here that animal beds are a poor candidate for export, only a level 19 or 20 construction pawn would be able to make a (small) profit over selling the raw textiles.

If the goal is to maximize profit then crafting high work-to-ingredient ratio items will add the most value.



Armchairs and dusters turn out to be the most worthwhile items to craft, which is satisfying because one trains construction and the other trains crafting. Following the example above, in a normal plainleather duster work adds ~18% of the total value.

It also turns out the value of ingredients and quality heavily affect the fraction that work contributes to the total value. The table below assumes a duster being crafted:



Cloth armchairs and dusters gain the most increase in value over raw materials. Crafting cloth starts to add value after level 8, but with a very high level crafter you can squeeze extra value out of any textile.

How does that translate to actual gained sliver though? Thrumbofur is in absolute terms worth more so a percent gain nets more value than a percent gain in cloth. Does it even out? (levels omitted for brevity):



Really only at level 19 and 20. At level 18 you can expect to gain about 34 silver per duster over the raw ingredients no matter the material. Low level crafters can quickly lose a colony a lot of value when working with textiles.

Finally, an interesting way to look at the total state of crafting is to for each material and each product determine the crafting level for which value added through quality and work transitions from a loss to a gain (i.e. what level crafter starts to make a profit):



[1] For those following along at home I'm making the assumption GenerateQualityCreatedByPawn() is what gets used. It certainly looks like it should. The function associates craft level with a mean quality, and then does a piecewise Gaussian distribution that slightly favors the higher side around that mean, but then takes the floor and has a chance to re-roll if the first pass returned masterwork.
[2] As far as I can tell a good chunk of the expected quality is lost when casting the result of the first Gaussian to an int, which serves as a floor function. I'd appreciate if someone verified the work.
[3] There's also a maximum value gain for each quality level but nothing produced from textiles hits it so it is ignored here.
[4] Above 200 value will also be rounded to the nearest 5, but it's small enough that it can be ignored without much effect

zizard

#17
In development mode, there is a table called "Quality generation data" in the second gear menu at the top. This shows the chance of each quality level for each crafter (ur values are a little off). The table can be copied and pasted if enough columns on the right are compressed by right clicking on them. This can be multiplied by the market value multiplier per quality found in 'Stats_Basics_General.xml', to get the average market value multiplier per crafting level.

Since work value contributes separately from material value, we can exclude it from the comparison. If some furniture breaks even including work value, then it lost value on the materials. There might be a work multiplier per material, but it doesn't matter as long as your crafter is always busy. i.e. to sell crafter labour, grow cotton; to apply a high level crafting quality multiplier to material, craft low work / quality ratio items. ofc there's some benefits to producing something with the perfect balance, but the point is that we should think of selling pawn's work as separate to applying their quality multiplier.

BLACK_FR

#18
With current wealth system you can "hide" clothing wealth and make raids less strong, you can't do the same with raw materials. That's big point in favor of making cloth.
It's only way to train crafting in early game for tribals. That's another big point.

And if you want to produce and sell raw materials (which I won't recommend because of point 1) then you are better of selling corn (it's also more useful to have excess of food than excess of cloth).
Guide to mastery of the game - https://ludeon.com/forums/index.php?topic=46290
If you have idea how make merciless naked brutality run more challenging and fun - tell me

Thirteen Fish

Quote from: zizard on September 19, 2018, 03:32:00 AM
In development mode, there is a table called "Quality generation data" in the second gear menu at the top. This shows the chance of each quality level for each crafter (ur values are a little off).
I did not know about this table, thanks! It turns out though that the numbers in that table are calculated by generating 10,000 qualities and seeing what comes out so they're not exact. It does a new simulation each time the table is opened so if you open and close it a few times and record the numbers (probability of Good at level 0 and 1 are good examples) you'll get slightly different values each time.

The table I posted above calculates the values exactly. It's nice confirmation though that both tables are pretty close.

Quote from: zizard on September 19, 2018, 03:32:00 AM
Since work value contributes separately from material value, we can exclude it from the comparison. If some furniture breaks even including work value, then it lost value on the materials. There might be a work multiplier per material, but it doesn't matter as long as your crafter is always busy. i.e. to sell crafter labour, grow cotton; to apply a high level crafting quality multiplier to material, craft low work / quality ratio items. ofc there's some benefits to producing something with the perfect balance, but the point is that we should think of selling pawn's work as separate to applying their quality multiplier.

I'm not quite sure I understand what you're saying but I think I disagree slightly. If we consider material cost as fixed (since we can always just sell the materials) then crafting adds additional (possibly negative) value to the materials. The added value from crafting comes from a combination of work and quality but we don't care which because it's the value that gets sold, not the work or the quality.

I think what you're getting at is that, assuming unlimited material, to maximize wealth gain from crafting we'd want to do crafts which have a high added crafting value per unit work. Which is true when the colony has a labor shortage. If there's a labor surplus then we'd want to do crafts which have a high added crafting value per ingredient.

Shurp

Well Thirteen Fish, you beat that to death solidly.  Nicely done :)

Anyway, I'm fond of my solution.  Remove the 30% penalty and any halfway competent tailor can make clothing which is worth modestly more than the material it is being made from.  No need for fantastic skill to produce piddling returns.
If you give an annoying colonist a parka before banishing him to the ice sheet you'll only get a -3 penalty instead of -5.

And don't forget that the pirates chasing a refugee are often better recruits than the refugee is.

Nynzal

That was an amazing breakdown of numbers!
Removing the price penalty and increasing work amount would shift the production in favor of more value for materials and more work to represent the production aspect, which I think is desirable. This migth require a learning penalty though.
Far more importantly, I would love to see a supply and demand system in Rimworld. Basics already exist in form of  the trade request from both the own colony and other factions.
Trade prices will change depending on how much was bought or sold the last few times. Also if the value of produced goods increases it might be necessary to limit the amount an orbital trader buys of one type, because I think the production of a small colony would not influence the demand and supply of the galaxy.
Winter is coming