PDA

View Full Version : Game Mechanics: Spell fizzle rate calculation incorrect?


Anathuril
07-02-2011, 11:21 AM
Hi. I have been playing on project 1999 a few months now. I tend to like casters. Although some people tell me that their fizzle rates have been as they remember back in the day, I disagree. Once I had a real example, I was told that others have noticed.

So, I have a L22 cleric with Wis of 123 that has his alteration at cap for his level. While fighting a mob in LOIO, I attempt to cast a root spell, which is a level 14 spell (eight levels below the current!). I get FIVE FIZZLES IN A ROW. If you want to tell me that you remember that from the old EQ, I will tell you you're lying. I played many casters prior to 2002 on EQ - NEVER had more than three fizzles in a row (in fact, I only remember one of those), and multiple fizzles hardly ever happened on spells that were BELOW my level.

I am including a screen shot of the exchange for you. I am now certain that the fizzle rate is incorrectly calculated. Also, within the last few days, another exchange resulted in four fizzles out of eight casts for the expulse undead spell (again a L14 spell casted with my cleric at L21!). I have a shot of that exchange as well, if you want it.

Any help in fixing the fizzle rate would be hot!

BTW, another issue I have is that the random number generator streaks like mad - this is a good case in point! If I get a chance, I think I will try to dig out the code for the durn thing and do my own testing of its randomness ...

Wow - another BTW - you really make it tough to send a screen of what happened with the restrictions you have on attachments :-) ...

All in all, despite the glitches, I think you all are doing a marvelous job - thanks for the efforts!!

Thanks and regards -
Anathuril

Uthgaard
07-02-2011, 01:07 PM
BTW, another issue I have is that the random number generator streaks like mad

Working as intended

Odeseus
07-02-2011, 08:28 PM
EQ's RNG has always been streaky as hell. On live there were days where I was untouchable. I'd dodge like crazy, never fizzle, never get a spell interrupted and get a crit every other cast. Then there would be days where nothing went right. A moss snake would interrupt me, mobs would hit for max no matter what and crits basically disappeared. All part of EQs particularly fun RNG!:D

Brinkman
07-02-2011, 11:47 PM
Assuming this persons skill was maxxed, there should be a 5% chance on a fizzle on root. What are the mathematical odds of getting 5 fizzles in a row, each having a 5% chance.

Need a math nerd!

Anathuril
07-03-2011, 12:58 PM
The statistics are what led me to write my initial mail. I was hoping it was the fizzle code ... but ...

I looked at the code. Had a bit of a runaround due to the way some of the structs work, etc., but I think I have a good idea of what is going on with the fizzle code at this point. And, lo and behold, the fizzle coding looks to be correct as far as I can make out.

Calculations for my cleric's casting of a root indicated:
par_skill = 32 ... (root lev for cleric is 7) : ((7 * 5) - 10) + 7)
act_skill = 137 ... (level 22 cleric with max skill on alteration) : (115 + 22)
specialize = 0
basediff = 25 ... base difficulty for root
diff = neg 79.9 ... (cleric wis 123) : (32 + 25 - 137) - (123 -125)/20
fizzlechance = neg 5.98 adjusted to 1 ... (basefizzle is 10) : (10 - 0 - 15.98)
chance of 1 against a roll of 1 to 100 ...

To put things in perspective -

Coin toss - 5 out of 5 at 50% per trial (heads meaning success) - probability => .03125
(i.e. 1 in 32 sets of 5 tosses)

My root fizzles - 5 out of 5 at 1% per trial - probability => .0000000001
(i.e. 1 in 10 billion)

My expulse fizzles - 4 out of 9 at assumed 1% per trial - probability => .00000121
(i.e. 1 in 826446)

I can get my head around the expulse fizzles - sure *could* happen even with reasonably random numbers. However, the root fizzles are another story. Sure the root fizzles *could* happen, and I am the unluckiest guy around, but combined with the expulse fizzles in a matter of a couple of days causes me to be VERY suspicious of the random number generator, especially since I don't see problems in the fizzle code itself.

So, until I have a chance to look at the thing, I guess I'll just have to live with it :-0.

Thanks and regards -
Anathuril

Uthgaard
07-03-2011, 03:38 PM
Fizzle rate should be capped at a maximum of 95% failure and a minimum of 5% failure. Specialize and the higher of bard dex/cha are the only things that come after the calculation to reduce the rate below 5% failure.

Anathuril
07-03-2011, 08:18 PM
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

Uthgaard
07-03-2011, 10:25 PM
We split off from PEQ's code base over a year and a half ago.

Anathuril
07-03-2011, 11:50 PM
Interesting - that probably explains why I can't find a reason for the excessive fizzle rate. I see streaking in the RNG, but the overall distribution of values looks roughly reasonable, and the RNG output is therefore apparently not the source of the high fizzle rate. The fizzle rate has to be a result of a calculation in the fizzle code then, but I don't know precisely what code to look at, so I will leave you to it as you wish.

The probability of a streak of five fizzles, even if the fizzle rate is .05, is .0000003125, or one in 3.2 million. four fizzles out of nine casts comes to about one in .0006426 or one in 1556. Still doesn't make sense. If the real fizzle rate is significantly higher, as I have empirically observed, that could explain the streak of five in a row on the low level spell.

Thanks and regards -
Anathuril

Brinkman
07-04-2011, 12:49 AM
Interesting - that probably explains why I can't find a reason for the excessive fizzle rate. I see streaking in the RNG, but the overall distribution of values looks roughly reasonable, and the RNG output is therefore apparently not the source of the high fizzle rate. The fizzle rate has to be a result of a calculation in the fizzle code then, but I don't know precisely what code to look at, so I will leave you to it as you wish.

The probability of a streak of five fizzles, even if the fizzle rate is .05, is .0000003125, or one in 3.2 million. four fizzles out of nine casts comes to about one in .0006426 or one in 1556. Still doesn't make sense. If the real fizzle rate is significantly higher, as I have empirically observed, that could explain the streak of five in a row on the low level spell.

Thanks and regards -
Anathuril

What he said!

Seriously though, I have had a large amount of double fizzles on spells 10+ levels below with all skills maxxed. I know that the 5% minimum would be in place at that point. I felt that it was pretty strange seeing double and triple fizzles so often on trvial spells. It has been so bad that I normally spam click every spell I cast and look at the casting bar and stop when it keeps going.

The ongoing joke about fizzles in EQ is true, but only for newly gained spells ( 15 skill points, basically 3 lvls, above that new spell should drop it to 5% failure rate ) and for people who do not max out their skills.

Im going to start taking some screen shots of my own. RNG being streaky or not, we should all play the lotto if this continues... either that or something strange is going on with the 5% min fail rate.

baalzy
07-05-2011, 01:20 PM
It has always seemed to me that if you fizzle, you're more likely to fizzle twice in a row then you are to just fizzle the once.

dali_lb
07-16-2011, 08:38 AM
Can confir m the same thing, and it strangely happened to escalate after the "root/snare/sow stacking" classical patch.

Ok .. I admit I was iffed too just by the DoT nerfs, but let that rest, since i know it was classic :p

But the fizzle rate is totally nuts.

I play a 47 Druid with maxed out specialize in conjuration, and I am not kidding, that I do get 3-4 fizzles in a row on my DoT spells quite some times during a couple hours killing. I tried using a lower lvl DoT .. 34 or 24 just to test, and the fizzle rate is just about the same.

more off .. (I don't know the exact formula for mana save on a successfull spec. role, and what % rate spec. is supposed to go off ). but i can't really see that specialize have an impact on mana usage. I have tried 4-5 times just using my mana on casting eg. my biggest DoT as the mana saved should be more noticeable here, and taken into count client update bugs on manabar every single Drifting death uses 196-215 mana .... it's supposed to use 200. So I'm beginning to have my doubt that specialize is working at all

Messianic
07-16-2011, 11:10 AM
If you want to tell me that you remember that from the old EQ, I will tell you you're lying.

Tell me that i'm lying all you want, but I do remember it.

http://www.thedruidsgrove.org/archive/eq/t-3871.html
http://www.thedruidsgrove.org/archive/eq/t-2954.html
http://eqclerics.org/forums//showthread.php?p=24084


The difficulty is unless we know how fizzling was really calculated in classic, saying "this absolutely never happened 10-12 years ago because my memory is awesome" doesn't really work - even if we try to point out the raw probability of 5 fizzles in a row.

I don't dispute fizzles might be higher than classic, but not by much if so. I don't see a lot of 50+ complaining about the rate.

mwatt
07-19-2011, 06:48 PM
My own "gut feel" is that fizzles occur more often than they did on live, although they did occur a lot on Live too. But "gut feel" is notoriously untrustworthy.

Also, although it is friggin annoying (especially when low mana) the current fizzle rate is livable. Taking into considertaion that there are some bugs out there that are high priority issues, it would be better to work on those than look into fizzle rate.

The aforementioned reasons have kept me from posting about fizzle rate on the forum until now.

Uthgaard
07-22-2011, 03:08 PM
There was an additional, unnecessary level of difficulty that was subjectively added to the checks, and it was based around hard-coded skill caps that were inaccurate for timeline. This created a higher fizzle rate in the mid-level range, that disappeared as the per-level skill caps approached the hard-coded value. This is fixed, pending update.

Anathuril
07-30-2011, 08:17 AM
Uthgaard - I wanted to thank you profusely for taking a look into this - I guess I will return to the realm :-) . I had quit playing and just happened to check this to see what happened with this issue.

Messianic - usually I don't respond to people like you, but I am getting very tired of such people denegrating a commenter by completely ignoring the context of the discussion, and disputing a statement taken out of context. Read a thread before being a jerk toward the poster. If you read my original post, you would find I was talking about a L22 caster casting a L14 spell in a skill capped school. First off, I was not basing my reaction on memory - I was looking at statistics of my casts and analyzing them. Secondly, no - fizzle rates of 20% or so *UNDER THOSE CONDITIONS* did NOT happen in live. I notice that every example you quote is about a L50 or above and/or in an expansion not yet supported and/or a condition caused by a bug. I played some 10 characters in live through L22 to L45, and never had a 20% fizzle rate on a spell more than five levels below me - I would have complained and maybe quit playing, just as I did here. So, while you may not be a liar per se, you are certainly a troll.

mwatt - That character is a healer, and I have lost several party members and myself more than once due to multiple fizzles on high cost spells. My reaction was as I indicated above :-) .