Skip to content

Andrew-Colman/random-loot-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

random-loot-generator

Loot-Generator: this case study shows that giving players a random loot guaranted rate makes satisfation grows

But how to make a normal random item generator ?

if(Math.Random(0,100) < 60 ){giveLoot(normal);} //this gives a 60% chance of the item (normal) C# example
else if(Math.Random(0,100) < 85 && > 60 ){giveLoot(rare)} //this gives a 25% chance of the item (rare)
else if(Math.Random(0,100) < 95 && > 85 ){giveLoot(epic)} //this gives a 10% chance of the item (epic)
elseif(Math.Random(0,100) > 95 ){giveLoot(legendary)} //this gives a 5% chance of the item (legendary)

The problem:

how math.random works: Pseudorandom numbers are selected with probability equal to a set of finite numbers. The numbers chosen are not completely random because a mathematical algorithm is used to select the items, but are randomly selected for practical purposes. The current implementation of the Random class is based on a modified version of the Donald E. Knuth subtracted random number algorithm.

Solution:

(to be writen)

Releases

No releases published

Packages

No packages published