![]() |
#7
|
|||
|
![]() According to the code that I was looking at, fizzle rate is restricted between 1 and 95 just before the random number is pulled and tested. Code I am looking at (comment seems to be in line with code) looks like:
// always at least 1% chance to fail or 5% to succeed fizzlechance = fizzlechance < 1 ? 1 : (fizzlechance > 95 ? 95 : fizzlechance); if(IsBardSong(spell_id)) { ... } float fizzle_roll = MakeRandomFloat(0,100); ... if(fizzle_roll > fizzlechance) return(true); return false; If you expect a minimum 5% fizzle rate, the code I am looking at is not doing it. Am I looking at the wrong code? ./zone/spells.cpp Also, I had some free time today, and put together a simple test program, imported the random number generator directly from the google archive (from a couple months ago), ./common/MiscFunctions.cpp, and ran some tests of my own. In sample sizes of 100,000 random numbers, I am consistently getting strings of 3 *equal* results at a rate of roughly 10 instances per run. The probability of 3 hits of the same number (out of a space of 100) in a row is roughly one in a million, but I get roughly one in ten thousand from this RNG. Duplicates are coming in at a rate of about 1,000 per run of 100,000, and I calculate probability of consecutive duplicates at one in 10,000. Probably won't get a chance to nail down whether this is inherent in the algorithm for a while ... have a happy 4th if you are a US type :-). Thanks and regards - Anathuril | ||
|
|