The current algorithm for predicting the chance of the Grinch visiting the user seems to result in a very high visit rate (only tested at a lower number of gifts). See the current implementation here
My current implementation for the Grinch Visit algorithm is:
def calc_steal_chance() -> bool:
# Generate a number between 0 and the # of presents the User currently owns
rand_int = random.randint(0, current_present_count)
# Take the cube root of the User's present count
threshold = int(present_count ** (1 / 3))
# If the user said 'Please', give them a 5% better chance at not failing the check
threshold = threshold * 1.05 if please else threshold
# If rand_int > threshold, steal presents
return rand_int > threshold
The logic behind this was to use cube root falloff so as a user's present count gets higher, the threshold determined via cube root levels off (see graph).
However, this dropoff is way too fast. Gotta rewrite the algo.
Steps to Reproduce the Bug
n/a
The Bug Affects
[x] The Discord Bot
[ ] The Database or API
[ ] Other program functionality (.env, scripts, etc.)
Description of the Bug
The current algorithm for predicting the chance of the Grinch visiting the user seems to result in a very high visit rate (only tested at a lower number of gifts). See the current implementation here
My current implementation for the Grinch Visit algorithm is:
The logic behind this was to use cube root falloff so as a user's present count gets higher, the threshold determined via cube root levels off (see graph).
However, this dropoff is way too fast. Gotta rewrite the algo.
Steps to Reproduce the Bug
n/a
The Bug Affects
.env
, scripts, etc.)