RimWorld

RimWorld

Characteristic
42 Comments
not really a fox 7 Aug, 2021 @ 9:17am 
One of my favorite mods. I'd love to see an update for 1.3
noenear  [author] 20 Mar, 2021 @ 1:20pm 
@Kopp
I contacted the VE team, they will take a look
Kopp 18 Mar, 2021 @ 2:53pm 
No answer from the Vanilla Expanded team so far.
Maybe you want to add a note to the description mentioning that colonists may disappear while loading if they have that "submissive" trait and have been forced to do work while saving.
Greetings!
Kopp 10 Mar, 2021 @ 9:55am 
@noenear
wow, thanks for your effort :)
I will ask the Vanilla Expanded guys if they are willing to change their code.
Will give a report.
noenear  [author] 10 Mar, 2021 @ 8:43am 
@Kopp
So the problem come from the fact my mod don't save the trait but readd them from the pawn characteristic when the game is loaded.
But when a trait is added VTE have a patch that will check all trait of the pawn and if a pawn have some trait it try to create an hediff.
But creating an hediff when you load the game make it bug.
So the pawn load fail, and don't spawn.

From my observation the easiest way to solve the problem would be to change the VTE patch to check if the trait added if from their mod first.

You can ask them if there willing to change their patch to something like this :

'''
public static class GainTrait_Patch
{
private static void Postfix(Pawn ___pawn, Trait trait)
{
if(trait.def.defName.Contains("VTE")) SpawnSetup_Patch.AddPawn(___pawn);
}
}
'''
noenear  [author] 10 Mar, 2021 @ 6:46am 
@Kopp I will take a look. It sound very odd, maybe a patch issue.
Kopp 9 Mar, 2021 @ 1:32pm 
Hey noenear,
found a rare but kind of gamebreaking incompatibility with "Vanilla Traits Expanded".
If a pawn with the trait "submissive" is forced to do some work and the game is saved/loaded the pawn disappears.
But only if the relevant pawn suffers from something like "old gunshot" or "scar".
Not sure which health problems exactly cause the issue (pain?). But healthy pawns did not disappear in my testings.
My latest test with 5 colonists: 2x 9% pain disappeard. Old gunshot scar no pain disappeared. 8% pain still here. Healthy guy still here.
Would be nice to know if you can/want to fix this, if I should report it to the Vanilla Expanded guys or if I have to live with that problem :)
Greetings!

https://gist.github.com/0c2e8eaca654874e0a1c87555c3e24a8
Jdalt40 29 Aug, 2020 @ 3:03pm 
Fair, thank you for the response!
noenear  [author] 29 Aug, 2020 @ 8:58am 
No idea if it work but maybe you can try to generate the characteristic with the dev tool give birth, since I think it generate a relative pawn, it should try to generate the characteristic for the pawn.
noenear  [author] 29 Aug, 2020 @ 8:48am 
@Jdalt40
Normally the only way characteristic aren't generated is if you add the mod to a save, and if I remember well the only way they are generated then is if a relative pawn is generated.
So I guess CSL prevent my transpiler to run.

The stats in these screenshoot seem to not be sorted, maybe since it don't find the charac there an error that break the execution.

For the error line 2635, it problaly happen cause the pawn don't have characteristic.

I will add a characteristic check to prevent the last error to show, it will maybe prevent the weird sorting issue.
But I'm a bit less active in modding rimworld, I don't really feel to search a workaround to fix the transpiler to generate characteristic with CSL.
I Don't know if you feel to take a look, but here the source. [github.com]
Jdalt40 29 Aug, 2020 @ 2:13am 
https://gist.github.com/HugsLibRecordKeeper/76735b4a003969cfcd8dee901ed33198
(Line 2635, Syr Traits is just having a fit over the tip text being screwed over, nothing else)
Jdalt40 29 Aug, 2020 @ 2:07am 
Hey noenear, do Characteristics happen to be regenerated if they weren't generated in the first place? Looks like Children, School, and Learning did something funky and stopped the generation of Characteristics on born colonists along with a few other issues (you'll see with the Stat category names)?
http://prntscr.com/u7xbfs
http://prntscr.com/u7xbpz
http://prntscr.com/u7xby2
Jdalt40 10 Aug, 2020 @ 7:23pm 
Thank you! Other than that a pretty swell mod! I'll let you know if any other funny tidbits appears
noenear  [author] 10 Aug, 2020 @ 6:52am 
@Joko
I updated the description too, the first one was a bit ligth and wobbly.
Problably more poeple would picked up the mod if I release it with a better image and description

@Jdalt40
Just retested and you are rigth, fixed it.
Jdalt40 10 Aug, 2020 @ 6:32am 
Hey noenear, are you absolutely sure Robustness is actually affecting stats right? Since it's apparently affecting Movement negatively (which is alright), but increasing the incoming damage factor (which should be decreasing if you're more robust?)
http://prntscr.com/tx65mg
http://prntscr.com/tx66ck
Joko 9 Aug, 2020 @ 6:10pm 
i see, i been using it for a while but never actually saw the full potential until i came back today and read the description again.
noenear  [author] 9 Aug, 2020 @ 1:47pm 
@Joko
Characteristics are fixed at pawn generation, you can see them like trait but instead of a yes/no scenario, they have some granularity.
Every pawn have and inherit characteristic, animal are also pawn,and they reproduce.
It also work for human generated with parent relationship, they will inherit characteristic from the relative.
For human reproduction, you effectively need another mod.
Joko 9 Aug, 2020 @ 12:03pm 
so, does Characteristic level up over time? (like people get better at them?) and how can it be inherit if the person doesn't have any mod that make pawns reproduce/have a child?

Jdalt40 24 Jul, 2020 @ 2:21am 
Aaah fair, all good! Just was concerned if my understanding of our code was a bit messed up heh.
You have a good day! :)
noenear  [author] 23 Jul, 2020 @ 7:34am 
@Jdalt40
It seem I checked your mod source too fast, I should not be so expeditious, sorry.

So the only thing who won't work well is the characteristique is mean to be the base stats, but it won't be used for the levelup value.
Jdalt40 23 Jul, 2020 @ 2:28am 
Well that didn't work, thanks Steam formatting, but you get what I mean
Jdalt40 23 Jul, 2020 @ 2:28am 
Hey noenear, I'm not sure what you mean by this mod not working well with Level This, we both add/multiply onto the result in our patches from what I've seen

[quote=Level This Code]
if (settings.HealthScalingType == "Compounding Health")
{
__result *= (1 * Mathf.Pow(LevelUpRate, Level));
return;
}
if (settings.HealthScalingType == "Simple Health")
{
__result *= (1 + (RoundedRate * Level));
return;
}
[/quote]
[quote=Characteristic Code]
__result += __instance.ageTracker.CurLifeStage.healthScaleFactor * __instance.Characteristic().GetStatOffset(BCStatsDefOf.HealthScaleOffset);
[/quote]

Let me know if I've missed something, but I think both mods should work fine (as Level This has worked for a while with mods also changing HealthScale)
brucethemoose 17 Jul, 2020 @ 12:34pm 
Yeah, I think more dummy indicator traits would be a great idea.

noenear  [author] 16 Jul, 2020 @ 5:01pm 
@brucethemoose I agree that the characteristics lack some visibility and it can be a bit long to check since you also need to familiarise with what does each charac, but i'm not sure adding the charac in the number mod would help that much, what you want to know is how much they change a revelant stat not really the characteristic.

I was thinking about adding more trait that just serve as indicator basically like how I changed jogger or hard worker trait.
brucethemoose 16 Jul, 2020 @ 4:57pm 
Oh, so some of the Characteristic stats (like moving factor, health scale, etc) are automatically added by Numbers, and thats all you really need.
brucethemoose 16 Jul, 2020 @ 4:41pm 
So I love the idea of this mod, but one issue (for me) is the difficulty of looking at pawns, and determining what they are and aren't good at. Whats normally a quick glance at the work tab or skills menu can now require digging into the stats window and remembering numbers.

The numbers mod really helps, as you can lay out everyone's work proficiencies in one big, sorted table: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1414302321

Ideally, the numbers tab would show characteristics as well. I guess that would have to be patched into the numbers mod?


noenear  [author] 13 Jul, 2020 @ 5:35pm 
@(KAY) very low in general, a bit more when pawn is generated and when pawn info tab is open.
Grac Misiu 13 Jul, 2020 @ 3:57pm 
How much does this affect performance if at all? looks pretty fun, thanks!
Luisomar_85 10 Jul, 2020 @ 5:32pm 
I will give it a try tomorrow to see how these 3 mods works together. :D
noenear  [author] 10 Jul, 2020 @ 5:18pm 
@Luisomar_85 I didn't tested with those mod.
From what do "RPG lvl style" it should work without problem.
I wasn't sure for "Level this" so I checked the source and it won't work well with it since this mod don't use the pawn healthscale getter. I'm pretty confident it should use it, I won't be surprised if this mod have odd behaviour with child pawn.
Luisomar_85 10 Jul, 2020 @ 4:10pm 
does it works with "Level this" mod and "RPG lvl style" mod?
noenear  [author] 10 Jul, 2020 @ 6:33am 
@Matstar Just did some test and checked with dubs analyser, usually there not that much call of health scale, but when you open pawn information tab or pawn health tab the check number explode.

I tried different method to optimize it, I'm a bit dubtfull about the analyser value, I got odd value in some case, so I just change it to not use the normal stats check but to directly find my stat.
I did the same for bodysize.


@brucethemoose It's just stats check it should only happen when the game need the stats so it's not every tick, except when you open the information tab, but it auto pause the game anyway.
Matstar 10 Jul, 2020 @ 4:01am 
I think the health scale harmony patch is lowering the TPS tremendously.
134ms came out when I was watching
brucethemoose 9 Jul, 2020 @ 8:17am 
Thats great! Pawn generation is fine, I'm just wary of things that happen every tick or few ticks.
༺. cherub .༻ 8 Jul, 2020 @ 6:12pm 
Subscribing to this mod thread to see how this works - I'll consider adding to a new save when it's more stable.
Karmapowered 7 Jul, 2020 @ 10:34pm 
@noenear Thank you for your quick reply. Upvoted your mod, since I believe it deserves more public awareness.
noenear  [author] 7 Jul, 2020 @ 10:31pm 
@Karmapowered It don't touch trait added from other mod, trait related to characteristic are listed in xml, but if a mod add another effect to one of these trait it will still work.
I keep these trait as indicator and to not distrub other mod that would use them.
I just remove the stats offset and stats factor of these trait.
For some trait like abrasive and kind I did patch the trait check to change it with a stat check.
Psychopath is a good example, it don't change any stat but it have some effect for a pawn who have it. (actually I would like to change that, so it use the empathy characteristic and instead of a can have mood scenario, the mood would be factored by this characteristic )

@brucethemoose The main calculation is at pawn generation, performance wise for stat check it should be less expensive then an individual heddif. The mod does add some "new" stats but it shouldn't be an issue.
So except for a very late game tribal raid it should be fine.
brucethemoose 7 Jul, 2020 @ 9:44pm 
Will this affect performance much?

I ask because this seemingly adds quite a few modifiers to many stats, but I don't know how often these stats are updated.
Karmapowered 7 Jul, 2020 @ 8:47pm 
> Trait related to characteristic don't change the stats anymore, but a pawn with these trait show that the pawn characteristic change these stats to a degree similaire to the trait.
> The side effects of these traits are still functional.

Does this mod account for other mods adding custom traits (with custom side-effects) ?

This mod looks very intriguing, thank you very much for sharing it with us.
Oniwabanshu 7 Jul, 2020 @ 1:43pm 
Amazing work, it could go exceedingly well with mods such as rimworld of magic. It could even change the game to be more RPG style.
noenear  [author] 7 Jul, 2020 @ 1:07pm 
The first is the actual change.
The second is an indicator, it's the value for a deviation egal to 1.

Offset is a simple addition.
Factor first add together then factor the stats.
5katz 7 Jul, 2020 @ 12:18pm 
is the first or the second number the one that applies, and how does it work if two characteristics change the same stat?