• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

a question on critical strike

Status
Not open for further replies.
Level 3
Joined
Feb 6, 2009
Messages
50
I got to wondering. See I made it where all units on my map have the critical strike ability.
For this map all units have a 1% chance to deal 2x damage, and a 3% chance to dodge. (because critical strike gives both of those.)
this ability can level up, but I also have items that give a chance for critical.
I was just wondering how does the game calculated multiple critical chances?
I mean say there are 3 items with varying critical chances.
I have 3 of one item that gives a 2% chance, one item that gives a 25% chance and an item that gives say 15% chance, along with the ability above.
would it calculate based on the best of the 4? Would it calculate on which one was first in the object/ability list in the editor? Would it run it through each chance individually? or how would it calculate? because there are a billion ways it could potentially calculate it.

Thank you greatly in advance.
 
Level 3
Joined
Feb 6, 2009
Messages
50
Cool, I hope your right because that is exactly how I want it to work XD
AHHH you gave me a DOTA Link! SHun! SHUUN!
jk. I have absolutely nothing against Dota, I actually enjoy it every so often (Except for its massive cult following that makes it hard to find or play other games XD haha)
it is an interesting read. Thank you jrhetf4xb!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I think each critical is counted as a separate instance. If two or more proc on one hit, the one with the greater damage is applied.

EDIT: This is a good read -- http://www.playdota.com/forums/showthread.php?t=7993

Actually criticals are independent from eachother.
If you have multiple criticals, then they can happen at the same time, but usually they won't(chance).
If you want criticals to stack in chance, then you need a custom system that only uses 1 ability.
I usually use something with 101 levels, with the first giving 0% chance and every next giving 1% more.
 
Level 3
Joined
Feb 6, 2009
Messages
50
Maker: really? so basically less than 3 doesn't do anything? so I should just make all chance abilities multiples of five?
Blizzard did some weird things... I mean if you mess with the stat system (ow much mana is given by intelligence, how much armor is given, all that stuff) There are certain points where it incorrectly takes effect... and I really can't understand why they made the chance systems so strangly...it seems so illogical...

Xonok: that is so not cool...I don't like there being any chance for a stacked critical XD
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
As I said;
Well, I could believe that <5% chance is rounded to 0

But;
I don't believe the chance is rounded to multiples of 5.
Since this is too vague for you to run a test on it.

You can't differentiate between 6% and 5% chance with that inaccurate test.

I just don't believe in this;
It is rounded to multiples of 5.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I'm busy running an evasion test, it's approaching 7% effective dodge as set in ability editor.

attachment.php


EDIT: I've confirmed Maker's findings on Critical Strike.
 

Attachments

  • evasiontest.png
    evasiontest.png
    906.1 KB · Views: 2,622
  • evasion test.w3x
    19.4 KB · Views: 127
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can't differentiate between 6% and 5% chance with that inaccurate test.

It is accurate enough, and yes you can.

Set it to 5, it will go to ~5 eventually. Set it to 6, it will go to ~5 eventually.

You not believing in it doesn't it make any less true.

You can post some evidence if you think this method is flawed.

@ruler, interesting. I guess I never did try Evasion test back in the day after all.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Yes with 7 13 and 17
After around 100 000 hits
For 7 it goes with average 4.8
For 13 - 15.3
For 17 - 14.8


Note: I had to raise max hp and regen of the dummies for 17 and 13 :D


Edit// Now tried with 4 and 8
For 4 - 4.8
For 8 - 10.0

So x8 to y2 = y0 and x3 to x7 = x5
y=x+1
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Critical strikes do stack in that their rolls will be taken in some order on every attack. Only 1 critical strike move can proc per attack.

This means that having 2 abilities giving 15% chance for double damage will cause you to land more double damage hits than one alone but you will never land any 4 times damage hits.

Evasion does not stack. Evasion always uses the source with the highest roll to determine if an attack misses. If you have an item that gives 10% evasion but an innate ability that gives 15% then the item is doing nothing.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
This means that having 2 abilities giving 15% chance for double damage will cause you to land more double damage hits than one alone but you will never land any 4 times damage hits.

I think you haven't tried. I've seen multiple criticals at the same time for numerous occasions.

However, criticals themselves do not multiply eachother, so that when the normal hit is 5 and critical multiplier is 3, then:
1x crit = 15 damage
2x crit = 15 + 15 damage(instead of 15*3)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
I need to re-test this stuff as it seems to contradict my results.

Ok just tested and evasion does not round.

1% evasion will cause on average 1 attack in 100 to miss. If rounding did occur as above suggested then all attacks would always hit.
99% evasion causes most attacks to miss but on average 1 in 100 will hit. If rounding did occur then all attack would always miss.
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I think you haven't tried. I've seen multiple criticals at the same time for numerous occasions.

However, criticals themselves do not multiply eachother, so that when the normal hit is 5 and critical multiplier is 3, then:
1x crit = 15 damage
2x crit = 15 + 15 damage(instead of 15*3)

No, if you detect the actual damage you will find that the critical strike floating texts lie.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Ciritcal stike has unusal chance behaviour. It is not rounding but doing something else

98-100% -> 100%
97% -> 80%?
0-2% -> 0%

It obviously rounds to the nearest 5% however the chance is very far off at 95%, yielding about 80% critical hit rate.

This leads me to believe that there is some biasing to prevent chains of critical hits. The typical "make it more random by less random" approach. I am guessing that you are not allowed to critical more than 4 times in a row before you must not critcal. This causes the acutal chance to drift from the listed chance as the listed chance is raised toward 100% since at 95% chance you would often get chains of well over 5 critical hits in a row. At 100% this biasing behaviour is broken (probably some special case) causing it to always critical as expected.

Critical strike rolls seem to be performed in the order newest source to oldest source. If the newest source succeeds then all other roll results are ignored. This means that if you have a 5% chance to deal 100 times your damage and a 100% chance to deal 2 times your damage then if the 100% source is applied after then 5% source the 5% source will never proc.

This behaviour is very important when using many critical sources as it means that high chance weak critical sources could actually lower your average damage if you have a low chance high damage critical source already.
 
Level 3
Joined
Feb 6, 2009
Messages
50
Wow...
I think I love you guys...
hahaha.
Pros, all of you are pros.
'nuff said about that.
Also ap0calypse I will read the thread.
thanks for the info guys...
Kinda kills how I would like it to work... I guess I will just have to deal with it because I soo do not want to work with a custom critical strike script or anything like that...haha.


(I had no idea this topic was still even being tlaked on...looking through it seems I must have forgotten to hit reply the last time I tried to post here...or something like that...oh well doesn't matter)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Btw, if you really want a critical strike with for example 17% (between the 5% steps), you can easily achieve this with two critical strike abilities that you switch around.

I did this once on a map, you can use this script to calculate the required cirticals and how often you have to switch them:

JASS:
library CalcCriticalStrike initializer Init

    globals
        private real MAX_COUNT = 50
    endglobals

    private function Abs takes real r returns real
        if r < 0 then
            return -r
        endif
        return r
    endfunction
    
    private function Mod takes real r1, real r2 returns real
        local real r = r1 - I2R(R2I(r1 / r2)) * r2
        
        if (r < 0) then
            set r = r + r2
        endif
        return r
    endfunction

    private function RoundOnFive takes real P, integer rFlag returns real
        loop
            if Mod(P, 5) == 0 then
                return P
            endif
            set P = P + rFlag
        endloop
        return -1.0
    endfunction

    private function Calc_Actions takes nothing returns nothing
        local real error = 100000
        local real actualError
        local real P = S2R(GetEventPlayerChatString())
        local real P_actual
        local real P_temp
        local real P1 = RoundOnFive(P, -1)
        local real P2 = RoundOnFive(P, 1)
        local real n_temp
        local real m_temp
        local real i = 1
        local real j = 1
        
        loop
            exitwhen (i > MAX_COUNT)
            
            set P_actual = (i*P1 + j*P2)/(i + j)
            set actualError = Abs(P_actual - P)
            
            if actualError < error then
                set error = actualError
                set P_temp = P_actual
                set n_temp = i
                set m_temp = j
            endif
                
            set j = j + 1
            if Mod(j, MAX_COUNT + 1) == 0.0 then
                set i = i + 1
                set j = 1
            endif
        endloop

        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "For a "+R2S(P_temp)+"% Crit Chance, you need: ")
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "---------------------------------------------------------------")
        if P1 != P2 then
            call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "A "+R2S(P1)+"% Crit in "+I2S(R2I(n_temp))+" hits out of "+I2S(R2I(n_temp + m_temp))+" hits and ")
            call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "a "+R2S(P2)+"% Crit in "+I2S(R2I(m_temp))+" hits out of "+I2S(R2I(n_temp + m_temp))+" hits.")
        else
            call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "A "+R2S(P)+"% Crit every hit.")
        endif
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.0, 0.0, 60.0, "---------------------------------------------------------------")
    endfunction

    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer index = 0
        
        loop
            exitwhen (index > 100)
            call TriggerRegisterPlayerChatEvent(t, GetLocalPlayer(), I2S(index), true)
            set index = index + 1
        endloop
        
        call TriggerAddAction(t, function Calc_Actions)
        set t = null
    endfunction
endlibrary

Just type into the chat the desired percentage (e.g. 17%) and the script will display the result.

Greetings,
lfh
 

Attachments

  • CalcCriticalStrike.w3x
    17.9 KB · Views: 75
Status
Not open for further replies.
Top