Author |
Message |
Vibe Guest
Offline
|
Posted: 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? |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Jun 15, 2004 1:22 pm Post subject: |
 |
|
|
|
No, it should never crash as long as they are not all 0. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Tue Jun 15, 2004 1:31 pm Post subject: |
 |
|
|
|
lol that was fun  _________________
 |
|
Back to top |
|
 |
Lumenesc Novice

Age:37 Gender: Joined: Jun 19 2003 Posts: 58 Location: Texas Offline
|
Posted: 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 _________________ Are you sure this questoin involved an answer? |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue Jun 15, 2004 8:12 pm Post subject: |
 |
|
|
|
Death Prizes. They're always generated. |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: 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. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Lumenesc Novice

Age:37 Gender: Joined: Jun 19 2003 Posts: 58 Location: Texas Offline
|
Posted: 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 |
|
Back to top |
|
 |
|