RimWorld

RimWorld

RandomPlus
DEETS 2 Apr, 2021 @ 2:49pm
[Resolved] Logic Error in Trait Pool Filter
Edit: Moved this to a discussion instead, since there's a few things to say and it'll get lost in the comments.

Hey LameBot, thanks for the mod! A small critique though -- while the logic behind the rolling is correct, some of the trait filter logic is wrong. Just an example: I have the "Kind" trait in my pool along with a bunch of other traits. Because of this, the mod doesn't allow me to filter "Abrasive" to my exclusion list, presumably since abrasive and kind are mutually exclusive. Because of this, I can still get the "Abrasive" trait when re-rolling characters with the mod, despite wanting to exclude it and it not causing an actual logical conflict with Kind in this circumstance.

There's a few other cases like that which need fixing (mostly with spectrum traits), I might take a look at the Github and try to fix it myself, but figured I'd give a heads up about it. All-in-all it's a great mod and this is just a minor nitpick of mine. Thanks for releasing this!

Somewhat related, here's a temporary fix for those facing the same issue:

Go to your AppData/LocalLow/Ludeon Studios/RimWorld by Ludeon Studios/Config, and you can manually edit RandomPlus.xml to make changes to the filters that you otherwise couldn't in-game. In the case of kind being in the pool and abrasive being excluded, this was the edit I did to fix it:

<li>
<traitDef>Kind</traitDef>
<filterType>Optional</filterType>
</li>
<li>
<traitDef>Abrasive</traitDef>
<filterType>Excluded</filterType>
</li>
Last edited by DEETS; 6 Apr, 2021 @ 2:13pm
< >
Showing 1-3 of 3 comments
DEETS 2 Apr, 2021 @ 3:15pm 
I've also started compiling a list of the traits that have this issue. Sometimes this issue goes one way ("too smart" in the pool will block you from adding "steadfast", but not the other way around), and others both ways. Only in some rare edge cases will some of the current exclusions be valid (EX: 2 conflicting traits in the pool while requiring 2 traits from the pool). I've also just realized that if I were to add something like "Too Smart" to the exclude list, I can't add the 5 traits it's mutually exclusive with to the pool or required lists, so the logic problem goes a bit deeper than I initially expected. It also doesn't apply to every mutually exclusive trait.

If the reasoning isn't clear as to why this is a logical error, I can try to find another way to explain it or set up an example filter to show it. Just let me know!

Below is a comprehensive list of the conflicting traits*:

*when the trait is added to the Pool or Exclude lists, the "conflicting trait" cannot also be added to the Pool nor Exclude lists currently. Also, if the trait is added to the exclude list, the "conflicting traits" cannot be added to the required nor pool lists currently.

Careful Shooter prevents...
- Brawler

Trigger Happy prevents...
- Brawler

Too Smart prevents...
- Steadfast
- Iron-Willed
- Volatile
- Nervous
- Slow Learner

Trigger Happy prevents...
- Brawler

Kind prevents...
- Abrasive
- Psychopath

Ascetic prevents...
- Gourmand
- Greedy
- Jealous

Body Purist prevents...
- Transhumanist

Brawler prevents...
- Careful Shooter
- Trigger Happy
- Wimp

Gourmand prevents...
- Ascetic

Greedy prevents...
- Ascetic
- Jealous

Transhumanist prevents...
- Body Purist

Jealous prevents...
- Ascetic
- Greedy

Wimp prevents...
- Brawler

Slow Learner prevents...
- Too Smart
Last edited by DEETS; 2 Apr, 2021 @ 3:17pm
LameBot v2.0  [developer] 5 Apr, 2021 @ 9:13am 
I understand the problem you've outlined. The problem is from the code I forked from EdBPrepareCarefully mod that makes up UI elements for the trait section. Prepare Carefully can force both opposite traits to occur on a single pawn however Its probably undesirable for this mod. I will try to update this mod by the end of today.
DEETS 6 Apr, 2021 @ 2:11pm 
Hey, not a big deal, and thanks again for even making the mod! It's a privilege to use it, and one I've really enjoyed. I just wanted to point it out (and a workaround) in case anyone else noticed it.

Thanks for the swift response and fix!
< >
Showing 1-3 of 3 comments
Per page: 1530 50