General Questions - Prize Weight Crash? Anonymous - Tue Jun 15, 2004 12:56 pm Post subject: Prize Weight Crash?
I think it's happened before but is it possible for a server to crash if the [PrizeWeight] values are too close together or there are a lot that are the same value?
Cyan~Fire - Tue Jun 15, 2004 1:22 pm Post subject:
No, it should never crash as long as they are not all 0.
D1st0rt - Tue Jun 15, 2004 1:31 pm Post subject:
lol that was fun Lumenesc - Tue Jun 15, 2004 1:32 pm Post subject:
If you have alot the same level, then youll just have alot with an equal chance of getting picked, no reason for it to crash.
And you couuuld have them all zero..if you didnt have any greens
Cyan~Fire - Tue Jun 15, 2004 8:12 pm Post subject:
Death Prizes. They're always generated.
Mr Ekted - Tue Jun 15, 2004 10:36 pm Post subject:
Say there were 3 prize types A, B, and C with weights set. You want to pick one randomly based on the weights. You start by generating a random number from 0 to A+B+C-1, then walking list weight array, subtracting weights from the random number until it is < the current prize's weight. Generating a random number from 0 to n-1 is usually done by
rand() % n;
If n is 0, you get divide by zero error. Bling.
Lumenesc - Wed Jun 16, 2004 1:44 pm Post subject:
Buut couldnt you make the death prizes last for like 1 millesecond? or for 0 maybe im pretty sure there was a way to not have death prizes