How Crits are calculated, damage, percent, caps, and how stats affect crits

Discussion on running your own board and editing MajorMUD.
Post Reply
Ravyn
Posts: 38
Joined: Wed Mar 30, 2016 4:40 pm

How Crits are calculated, damage, percent, caps, and how stats affect crits

Post by Ravyn »

by Ravyn of Codered BBS

((note at the bottom of the document talking about proposals of how it should be and formulas to use were
correspondence talking about a remake we were working on!! Those are not from the game..))

RE: Stock mud critical hit formula (chance and dmg)

crit dmg is a random floating point # from 2.00 to 4.00 * MAX DAMAGE,
it does not use minimum damage at all. THEN DR IS REMOVED. ie ((rnd(2.00 to 4.00)*(wepmaxdmg))-mondr)


Another series of tests for the combat engine, as usual i used my level 58 combat-3 testing char,
in the special practice room i have designed for my tests, the test char is blank, naked, with only
a weapon that hits for a specific damage per hit. This time i also gave the char +9999 accuracy, so
with 0 miss the results would stabilize much faster and I wouldnt have to worry about miss. I made a
special race that all stats started at 50 and went to 150, I ran the series of tests using 50, 100,
and 150 until a pattern emerged which was quite clear, that i used to create the formula. I was most
surprised that (not counting getting eqd due to weapon speed) intellect had a MUCH HIGHER affect on
crit% than agility did. I tested each run for four hours and then changed one variable and ran again
for another four hours, etc, until i had tested each variable independently.

During the whole test my char was eqd the entire time with 20% crit bonus. I kept all other variables
not dealing with crits set to 50, str, willpower, health, etc.


level effect results-----------------------------------------
You will notice below that my base crit % was 25 even though my char only had a fixed +20% due to my
eqd bonus of being light. I ran ALL the below tests FIRST, having in the back of my mind to figure out
where the extra 5% came from, knowing my char i tested with was level 58, I my first thought was to test
it out with a lower level and findout the results. I did this afterwards and sure enough, at level 38
my base crit was 23%! Thus proving that you gain +1 crits per 10 char levels! That is why at level 58
i had +5 with no gear or other variables to effect it, and when i re-ran it at level 38 I had +3.

intellect effect results-------------------------------------
50 int, 50 agil - 25% crit rate
100 int, 50 agil - 30% crit rate
150 int, 50 agil - 35% crit rate (proving you gain +1 crit for every 10 intel over 50)

agility effect results---------------------------------------
50 int, 50 agil - 25% crit rate
50 int, 100 agil - 27% crit rate
50 int, 150 agil - 29% crit rate (proving you gain +1 crit for every 25 agility over 50)

note from above----------------------------------------------
I went back and doubled-checked by running it with 100 int and 100 agil (which should be 32% by
my above results) and it was exact. 32%.

charm effect results-----------------------------------------
retested the above with 150 charm instead of 50, no difference, proving charm does not effect crits

str effect results-------------------------------------------
retested the above with 150 str instead of 50, no difference, proving str does not effect crits

will effect results------------------------------------------
retested the above with 150 will instead of 50, no difference, proving will does not effect crits

encumberance effect results----------------------------------
I tested all of the above with 1% enc, 15% enc, 32% enc, absolutely no difference, proving
that encumberance's only role is in determining the (up to) +20% eqd bonus @ 32%, and the (up to)
+10% eqd bonus @ 65%

diminishing returns results----------------------------------
we all know the cap is 40% crits, i tested the diminishing returns theory for what happens when
you effectively have a total of over 40%, I went back and tested with an exact +45% crits and still
did 40% on the dot. This part of the test i ran into some problems of it not seeming to be
linear or calculate the way i thought it should, the rumors about diminishing returns is they
calculate at a 3:1 to 5:1 ratio above 40, but it did not seem to perform as expected.

I retested with +50% crits and did 41%. I retested with +55% crits and
logged 45%. I did a final one with +60% crits and it still tested at 45%.
So i propose for the remake we do a more flat linear formula that is fair (and is what common rumor
proposes it to be!) with a ratio of 4:1 over 40%. ie 48% equals 42%. 56% equals 44%.
I tested again later with +9999 crits and sure enough, critted 99%. My final formula for
crits below utilizes my proposal. I think this will match exactly to what the players expect it
to do.

bonus eqd if medium or light results-------------------------
I did not test this as the formula is already in mmex explorer calculations on how it works,
as we all know it uses the factors of weapon speed, combat level, character level, agility,
and encumberance %. str is only a factor because it modifies encumberance. of course it is
also further modified by the speed ability (mage speed/slow spell) but this modifies the weapon
speed, speed +90 on a 2500 speed weapon effectively makes it 2250 speed weapon, speed +110 on
a 2500 speed weapon makes it 2750, since it is a % modifier.

-------------------------------------------------------------

so, given all that, your critical hit chance % formula should look something like this --

{
c = b+ts+te+ab+(lvl/10)+((agil-50)/25)+((int-50)/10); // calculates total # (% to crit)
if (c > 40)
c = 40+((c-40)/4)); // limits to 40%, factors in diminishing returns of 4:1
return c;
}

whereas,

c = critical hit chance
b = eqd crit bonus of 1-10 if 65% enc or less, eqd bonus of 1-20 if 32% or less enc, 0 if heavy
ab = ability bonus on char (stock mud +10 for mystic or ninja, +1 from ard quest on anyone)
ts = total + or - crits from any spells cast on the player
te = total + or - crits from any equipment the player is wearing

note the total of ab+ts+te could simply be expressed as total +/- crits on the char abilities
present, whether cast on player by spells, equipment worn, race/class abilities, quests, etc.. it would
make more sense to code it that way and you probably already have that in place.

Perhaps in (c > 40) the 40 could be changed to a constant as in MAXCRIT and have MAXCRIT defined in the header with other
constants, for those who wish to raise the crit cap from 40 to 45 or 50 as many do.



Ravyn ravyn.codered AT gmail.com


zlarb
Posts: 11
Joined: Fri Jul 07, 2017 11:09 pm

Re: How Crits are calculated, damage, percent, caps, and how stats affect crits

Post by zlarb »

thanks this is good stuff


Post Reply