There seems to be some weird arithmetic issue(s) in this game. What first caught my attention was that the scene "spanking_companion_cms" would occasionally trigger with companions that I knew were way more dominant than I was. I looked at the requirements for triggering this scene, and it contains this check:
If martial - masochist + Actor:masochist - Actor:martial > Random(50, 200)
The rounded stats of me and the NPC are:
martial: 10
masochist: -2
Actor:masochist: -85
Actor:martial: 9
So the resulting expression should be: 10 - -2 + -85 - 9, with an expected answer of -82. -82 will obviously never be > Random(50, 200), so that scene should never be triggering when I'm with that NPC.
I wrote a script to test the math operations being done, and instead of getting -82, I was getting 88 as the result, which explains why the scene occasionally triggered, since 88 can be > Random(50, 200). I ended up writing a bunch of math unit tests to try and discern what the exact problem was, but I was unable to find a discernible pattern to which tests would pass and which ones would fail. One thing that did stick out to me however is that I included 10 - -2 + -85 - 9 as a final unit test, expecting it to fail based on my earlier observations, but to my surprise it was giving -82 as the result instead of the earlier observed 88. I looked into this further by writing an additional test where each individual number was first stored in a variable, and then doing the operations using the variables instead, so 10 - -2 + -85 - 9 became: mar - mas + amas - amar, and the result of that was the previously observed 88. Not really sure what to make of that.
This issue for me is causing at least one scene to trigger incorrectly, but who knows how many other scenes are affected.
I've attached the unit tests I wrote in case anybody else wants to run them, and/or pass them along to Vin. I don't use Discord, and who knows if he'll ever read this.