You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking through the code in the name of trying to get a better sense of how the thrall capturing, psychic energy generation, etc. Function, since the numbers are significantly less clear for these mechanics than a lot of other ones are.
While doing so I noticed the following code for calculating if another surface dweller should be captured:
Notable is the Math.rand(0,(catchVar * usedCap) - hunt) <= 0 portion. Since .rand is an integer random value, this does always have a chance of being true, however its a 1 in (catchVar * usedCap) - hunt chance. The standard value for catchVar is 50, and its not modified by the tier of the Ancient Nightmare achievement.
I did some simulations to see just how weird and slow the behavior of this is, and across 1,000 trials of simulating 10,000 days of catch attempts, (using the value in my current save for the hunt constant) it took on average 760 days to obtain the first 10 prisoners, 5900 days for the next 10, and 30 was only ever reached 2% of the time, averaging 9200 days for the attempts that did not fail to reach 30. No run ever made it to 40 thralls. Meanwhile I am easily able to build over 120 thrall capacity.
I suspect the intention was actually to write Math.rand(0, catchVar*usedCap) - hunt <= 0 instead? This creates a far more forgiving capture rate that can actually reach the capacity of thrall storage.
I am willing to write up the pull request for this, but I wanted to confirm this was a bug and not intended behavior before doing so.
The text was updated successfully, but these errors were encountered:
I was looking through the code in the name of trying to get a better sense of how the thrall capturing, psychic energy generation, etc. Function, since the numbers are significantly less clear for these mechanics than a lot of other ones are.
While doing so I noticed the following code for calculating if another surface dweller should be captured:
Notable is the
Math.rand(0,(catchVar * usedCap) - hunt) <= 0
portion. Since.rand
is an integer random value, this does always have a chance of being true, however its a 1 in(catchVar * usedCap) - hunt
chance. The standard value for catchVar is 50, and its not modified by the tier of the Ancient Nightmare achievement.I did some simulations to see just how weird and slow the behavior of this is, and across 1,000 trials of simulating 10,000 days of catch attempts, (using the value in my current save for the hunt constant) it took on average 760 days to obtain the first 10 prisoners, 5900 days for the next 10, and 30 was only ever reached 2% of the time, averaging 9200 days for the attempts that did not fail to reach 30. No run ever made it to 40 thralls. Meanwhile I am easily able to build over 120 thrall capacity.
I suspect the intention was actually to write
Math.rand(0, catchVar*usedCap) - hunt <= 0
instead? This creates a far more forgiving capture rate that can actually reach the capacity of thrall storage.I am willing to write up the pull request for this, but I wanted to confirm this was a bug and not intended behavior before doing so.
The text was updated successfully, but these errors were encountered: