Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits) (+4)

You have an issue with your random number generation, specifically in the rir_bm() function in the code, which essentially takes an upper and lower bound and generates a normal distribution from there, with optional mean and stddev parameters. (For those who aren't following any of this, you can open up the html file you get when you download the game into a text editor like VS Code and ctrl+f search for "rir_bm" and there are only two instances where the function appears in the code.)

The main issue is that for the only instance you use this function, in character stat generation, you supply a pre-calculated mean and stddev based on the range of expected values for a given stat, which in the end yields a random normal distribution that does not correspond to either the calculated mean or the mode. If the lower bound were 200, and the upper bound were 400, for example, then the actual mean that your function spits out is 260, not 300. Because you calculate the mean as (200+400)/2=300, then divide by 1000 => 0.3, and then rir_bm() calculates the normal dist and multiplies by the size of the range (400-200=200), and multiplying the normaldist by 200 multiplies the mean by 200, so now we're at 60. Then it adds the start value to get 260. This isn't as much of an issue at larger ranges which are more often used, but the problem gets worse for standard deviation. 

The pre-calculated value for stddev, in the example above, is done by the calculation (400-200)/2, along with a comment in the code saying "6 is a natural distribution, so we're allowing for more frequent extremes". You mean that dividing by 6 is a natural standard deviation, and you're allowing for more frequent extremes by only dividing by 2, essentially multiplying all standard deviations by 3. Why then does it feel like all the npcs are always way too similar, if we're allowing for a massive standard deviation? Well, this value of (400-200)/2=100 gets sent to the rir_bm() after getting divided by 1000 which yields 0.1, and then gets multiplied by the range size of 200, so we ultimately get a standard deviation of 20, not 100. So we're actually decreasing the number of frequent extremes, not allowing for more of them. This is why the game lacks variety; it's a big problem that's been present for a long time now. I don't know how you would go about fixing it, but I would just use the already existing random_bm() function with the means and stddev's that are already calculated in character stat generation. And then I would adjust the stddev that is trying and failing to compensate for being severely reduced in the rir_bm() function. Maybe divide by 4 instead of 2.

Sorry for the unreadability of this comment and I'm not sure where would be a better place to put this, but I'm sure this will get to anthaum somehow. This desperately needs fixing.

Tldr; the random number generator that generates stats like height, plumpness, penis size, etc. is broken and severely limits the variation in these stats, making characters way more similar than they should be, and makes it so you almost never see characters with extreme stats. And it's honestly a pretty easy fix, so I hope this gets to the devs so they can fix a pretty bad problem this game has had for at least a year if not longer.

(+5)

Anyways, great game, there is nothing else like this anywhere. It's really something special, not just as a porn game, but as a social simulation in general. Its ability to provide a dynamic context for things to actively take place, rather than just a collection of  hardcoded events or pre-written stories, is unparalleled by anything out there. I would love to see updates that deepen the social, psychological, and physical dynamics of the game, rather than purely adding content. Anyways you're doing a great job, whoever you all are who are working on this game!

(+1)

Just had some fun digging through the code (learning new thing along the way) and I think I see where the problem is. The variable names are a bit confusing. The only originally normal distributed value here is the random number from the  bm rng algorithm (standard normal distribution to be exact). "stddev", as it is in the code, is really just the the distance from the middle/mean of the range to its edge. 

The idea seems to be to create a normal distribution of stat values by multiplying "stddev" with the bm rng value. Since the mean of this distribution is at 0 you then just have to offset it by the mean value.

 This kinda happens in the random_bm function already, but "mean" and "stddev" were dived by 1000 beforehand (creating a random factor for the the rangesize i presume). This makes the calculations in rir_bm redundant. The problem is that this distribution does not fit within the specified range. A solution to this is to just divide the bm rng value by 2 (or up to 2.7) to squish the distribution and then either only accept values between -1 and 1 or just clamp the rest like before. Create a kinda normalized factor so to speak.

To summarize my solution would be: Don't divide "mean" and "stddev"  by 1000, divide the original "num" value in random_bm by 2 (up to 2.7) and create a (kinda) normalized factor to multiply "stddev" with and offset it by adding "mean". 

What do you mean by “bm rng”? Do you mean the random_bm() function or something else? When I checked how the random_bm() algorithm works by recalculating it myself, it seemed to produce results accurate to the stddev input, but I could be wrong. I could check again but I don’t see the reason for altering the algorithm in random_bm(), it’s only the use of rir_bm() that’s the problem. What’s your reasoning for how random_bm’s stddev is only the distance from the middle to the edge of the range? I didn’t get that impression. Unless I’m just confused about the term “bm rng”.

By "bm rng" I mean the Method used to calculate the random number. It's called "Box–Muller transform", I just forgot the name and shortened it.

I called stddev that is because it is the same calculation. It is halve the rangesize and thus the distance between mean and min/max of the range.

The way the final stat value is calculated is weird or I might be misunderstanding something. Both stddev and mean are divided by 1000 and thus normalized to the max range (0=0 ... 1000=1). rir_bm() calls random_bm() with stddev and mean and returns a factor which is then multiplied by the rangesize and adds that to the start value. The problem is the multiplication with the rangesize. 

If you look at the distribution of the values random_bm() returns, you get a normal distribution. The thing is that all these values are normalized to the max range of 1000. If you simply multiply them by 1000 you get a normal distribution of stat values centered correctly around mean, which I thought was what we are trying to calculate here.

The important part is that the the values random_bm() returns are absolute values(with a root of 0), but rangesize is relative. It's a bit difficult for me to explain, but basically this rangesize can be anywhere on the range. Similar to your example, if you take values on the higher end 800 to 900 for example. The mean is 850, but if you calculate it with the code you get num=0(mean of the box-muller transform)*stddev+mean=0.85;  diff=rangesize*num=100*0.85=85; value=start+diff=800+85=885. And well 850=/=885.

And since both rir_bm and random_bm are basically trying to calculate the same thing in two different ways, I thought just make it simple and use the method I described.