[1.1] Crafting Quality Rebalanced 1.4.9

Started by Phomor, February 11, 2018, 10:56:58 AM

Previous topic - Next topic

Madman666

#15
^ I second that. It was perfectly fine to have a 3% chance on a lvl 20 pawn to get a legendary done, without inspirations, i d really welcome such an option to exist and be percentage based.

And legendary items no longer have insane market prices actually. So.

Syrchalis

A possible implementation could look like this:

Lowest skill for Masterwork
Lowest skill for Legendary

These define which skill a pawn must have at least to have a chance at a Masterwork/Legendary item.

Chance for Masterwork at 20
Chance for Legendary at 20

These define the chance to get said quality at skill 20. Now you just need to make a curve from the lowest level to 20 (linear, quadratic, what you think works well). Say the user inputs 5% for legendary @20 and 10% masterwork @20, then a skill 20 crafter would have a 5% chance for legendary, 10% for masterwork and the remaining 85% get split among the remaining qualities (in this case it would just be excellent).

At a lower level it might look like this: 1% legendary, 3% masterwork, 96% split among excellent and good (40% good 60% excellent => 38,4% good and 57,6% excellent.

Not sure how exactly the code works for this, but this is just an idea of how one could do it.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Madman666

Yeah, that'd be truly cool implementation.

KnewOne


lwki


Phomor

Nice ideas, the earliest I can look at it though is in about 2 and a half weeks cause I'm not home till then.

Madman666

No rush, just considering it is enough ;) Thanks for your time. It ll be really nice to have that miniscule legendary chance returned to us once more.

lwki

#22
Added sliders for masterwork and legendary. Sadly legendary doesn't work due to stack overflow and i can't fix it 'cause i'm dumb.

JobDriver threw exception in initAction for pawn Moehre driver=JobDriver_DoBill (toilIndex=13) driver.job=(DoBill (Job_6033324) A=Thing_ElectricTailoringBench493527 B=Thing_UnfinishedApparel687498 C=(361, 0, 231)) lastJobGiver=Verse.AI.ThinkNode_QueuedJob
System.StackOverflowException: The requested operation caused a stack overflow.
at CraftingQualityRebalanced.HarmonyPatches.Postfix (int&,bool&,RimWorld.QualityCategory&) <IL 0x0001b, 0x00058>
at (wrapper dynamic-method) RimWorld.QualityUtility.GenerateQualityCreatedByPawn_Patch1 (int,bool) <IL 0x001f7, 0x004eb>


Edit:
Forgot to disable legendary by default, set it to 21 or items will disappear.

[attachment deleted due to age]

Phomor

The thing that I think is happening is that the probability is too low and cause of that it cancels rolling for it after some tries (I don't actually know how much) and then the item disappears. Also happens if you have set the masterwork skill to 4 and let a skill 4 pawn make something. Item will disappear, Log will show the error most of the time, sometimes it works. You gotta set the skill requirement higher.
Legendary doesn't work cause of the same thing, it tries to roll until it gets legendary quality but that isn't possible without an inspiration anymore. So you'll get the error again.

Phomor

Just added settings for Masterwork and Legendary, still guaranteed though, I'll look at chances in two weeks.
Minimum skill for Masterwork is 7, anything below that and you'll get the error that lwki discovered.

KnewOne

Could you add ModSync support ? It's easier to update mods that way

Phomor


Phomor

#27
Just a quick update, really high skill builders still have a chance to build masterwork stuff in vanilla from what I've gathered from testing and code, so I won't add another chance for masterwork, just for legendary. Modsync support is added.

Update is out.

Syrchalis

#28
Quote from: Phomor on August 15, 2018, 04:40:05 AM
Just a quick update, really high skill builders still have a chance to build masterwork stuff in vanilla from what I've gathered from testing and code

Yes that's true. The vanilla quality generation works like this:

  • Depending on skill level you get a number 0.7 (at 0 skill) up to 4.2 (at 20 skill)
  • Then an asymmetric Gaussian function is applied - this means a function that makes the value a bit higher/lower, with extremes being more and more rare
  • The result is clamped at 0 and 5 - this means anything below 0 is turned into 0, anything above 5 is turned into 5
  • If the result is 5, then another asymmetric Gaussian function is applied after which it's clamped again. This means there is an extra "kick in the balls" roll to make the item not "masterwork" after all
  • +2 if the pawn is inspired in creativity
  • At the end the number is translated into a quality, with 0 = awful, 1 = poor etc. up to 6 being legendary

I've made my own version of a quality mod that simply extends the range of values in a way that mimics B18 (excluding the removed qualities) - so you can get legendary sometimes at high skill levels.

My version works like this (changes in green):

  • Depending on skill level you get a number 0.8 (at 0 skill) up to 5.15 (at 20 skill)
  • Then an asymmetric Gaussian function is applied
  • The result is clamped at 0 and 6 - this means anything below 0 is turned into 0, anything above 6 is turned into 6
  • +2 if the pawn is inspired in creativity
Result is that you can naturally get legendary at high skill levels. I'm not posting it here because it would be a competitor for Phomor's mod and I haven't tested it enough to ensure it's balanced.
For mod support visit the steam pages of my mods, Github or if necessary, write me a PM on Discord. Usually you will find the best help in #troubleshooting in the RimWorld discord.

Phomor

I mean if it's a better mod you're free to post it, the community will benefit from that.
If I may ask though, are you using the transpiler function of harmony? Cause I just use a simple postfix which is obviously limited and can't directly change the numbers.