how do i random?

In the world of online and roleplay games a quite common phenomena , random chances to win an item. From 100% to ridiculous 0,01% or even lower everything is being represented and while the bigger numbers tend to be ignored , people get obsessed with smaller numbers. With that there come theory’s of randomness and of course false concepts such as the following:

"the item has 1% so i have to attempt to obtain it 100 times to finally get it"

That however is not correct since every new attempt has the same random chance as the previous. With a quite low chance for example 1% the player may see the item appear after the first attempt or maybe after the 200th attempt or never see the item at all , no matter how many attempts. Too many attempts are frustrating , to keep players happy you need to guarantee them the item. But how can item appearance be kept rare and yet guaranteed? By increasing the chance with every continuous attempt.

The following example provides 2 methods , the first is the common known random every single attempt. The second however increases the chance after every failed attempt. The output shows the number of attempts required for each method and compares them to each other. This whole step will be repeated 10 times or more to get a more genuine overview.

			echo " > ";
		// --- method 2 needed more rolls then method 1
		else if ($att[1] < $att[2])
			echo " < ";
		// --- both method requires equal amount
			echo " = ";
		// --- number of rolls for method 2
		echo $att[2]."
"; } // --- final count results echo "
1: ".$y."
"; echo "2: ".$x."
"; echo "-: ".($attempt-$x-$y)."
"; ?>

The above output shows that the first method can require a quite huge amount way above the expected false logic (1% equals max 100 attempts) where as the second method is always within the expected false logic range.

But why bother with all this randomness or not , what does it matter if the item appears after 100 or 100000 attempts? The player does decide if your game is successful and percentages will always become public on fansites or user filled databases. Low numbers can turn the player away but that’s a rare occasion , whats more frustrating though is if the low number comes on top of a streak of bad luck rolls.

, ,

Leave a Reply

Your email address will not be published. Required fields are marked *