Home Feedback Feedback and Suggestions
Due to an issue with Hit Validation affecting interactions with Oni players, we are temporarily disabling the feature until the next hotfix.

How to Random

KaelumKaelum Member Posts: 975
edited July 14 in Feedback and Suggestions

Since there seems to be a significant problem with the game performing random operations in the game, I thought I give you some help. When you want to guarantee that tries is between a min and a max number, which is significantly more fair than a random percentage, here is some pseudo code:

int min = 1;

int max = 5;

float threshold = 1.0 / (max - min + 1);

int count = 0;

bool Try() {

if (++count < min) { return false; }

float rand = Random(); // 0.0 to 1.0

return (rand <= threshold || count >= max);

}

When Try() is true, the operation is complete. Instead of traps taking only 1, or well over 13 attempts to get out, try this instead and maybe set max to 6? For the 4% hook, set max to 25, simple as that.

Post edited by Kaelum on
Sign In or Register to comment.