Need Help with Damage System (Mathwork)

Trithilon-V2

New Member
Reaction score
20
As the title suggests.....
I want to have a damage system in my map to be wow-like.
I already have a system that detects Physical and Magical Damage.
Lemme explain :-

There are spell criticals and physical criticals.
There will be skills and abilities that increase/decrease these things.
The following will be the Stats out of 5:-
JASS:
                  Physical-Chance/Magical-Chance/Physical-Multiplier/Magical-Multiplier
Strength Hero   :-         3/2/5/2
Agility Hero       :-         5/3/3/1       
Intelligence Hero:-         1/5/1/5

Here are the factors that i need the formula to use :-

Physical Damage :-

Multiplier will be Based on Strength.
Chance will be based on Agility.
Should have adjustments for Adding Bonus chance or Multiplier without making it imbalanced (Item that gives 10% chance for hit or increases multiplier by 25%)
Should have diminishing returns. (For balancing purposes)
Strength Heroes will get bonus Multiplier as compared to Agi and Int heroes.
Agi heroes will get Bonus chance compared to Str and Int heroes.

Magical Damage :-
Both Multiplier and Chance based on Int
Should be adjustable to Bonus increments from items via triggers
Should have diminishing returns
Int heroes get Bonus Chance as well as Bonus Multiplier compared to Str and Agi Heroes.

So, Now i need a formula for calculating this, so that even if a unit is level 100 and has like 500 attribute points, he wont be impossible to kill and wont have a 500X critical with a 500% chance to hit.
 

Flare

Stops copies me!
Reaction score
662
May not be exactly what you're looking for, but I had a critical hit system idea (and worked well in practise) - the general idea/setup is posted here and here (it's not exactly like WoW's way of dealing with criticals, but it bears some similarities - it was originally based on Titan Quest's critical hit system)

EDIT: I've thrown together an idea, but I'm not sure how strong/weak it would be (the increment per stat point diminishes fairly rapidly)

Basically, the increment (where 0 is 0%, and 100 is 100%) is:
(((Current stat + 1)^2) - ((Current stat)^2))/((Current stat)^2)

But that accumulates (you need to calculate it from 1 (STAT), rather than the current value of the stat)

Calculations
Code:
Return = (B-A)/A

A=(Stat)^2
B=(Stat+1)^2

1^2 = 1
2^2 = 4
3/1 = +3

2^2 = 4
3^3 = 9
5/4 = +1.25

3^3 = 9
4^4 = 16
7/9 = +.777

4^4 = 16
5^5 = 25
9/16 = +.5625

With 4 stat points, you will have +5.5895% to your critical strike rating, but the % increase for 19 of the attribute would be ~0.10%
Code:
19^2 = 361
20^2 = 400
39/361 = +.10

EDIT AGAIN: Was playing around with the above stuff, and
JASS:
globals
    constant real MAX = 75.
endglobals

function Trig_Test_Actions takes nothing returns nothing
    local integer i = 1
    local real inc = 0
    local real v1 = 0
    local real v2 = 0
    local real add = 0
    call BJDebugMsg ("Loop initiated")
    loop
    exitwhen inc >= MAX
        set v1 = i*i
        set v2 = (i+1)*(i+1)
        set add = ((v2-v1)/v1)
        set inc = inc + (add*(i/2))
        set i = i + 1
        call BJDebugMsg ("Current value of inc: " + R2S (inc) + ", current value of i: " + I2S (i))
        call TriggerSleepAction (0.)
    endloop
    call BJDebugMsg ("Value of i: " + I2S (i))
endfunction

//===========================================================================
function InitTrig_Test takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent (t, Player (0), "test", true)
    call TriggerAddAction( t, function Trig_Test_Actions )
endfunction

I needed 77 (STAT) before the value of 75 was reached for inc (which would be the total % chance), but that's if I'm multiplying ((B-A)/A) by ((STAT)/2)
 

Trithilon-V2

New Member
Reaction score
20
Thats neat...lemme try it out....
(Sry for delay in checkin...my net got hung up.)

EDIT :-
Dude...so how is the new formula relative to the opponents stats?
Also in my map at level 100 (which is pretty inconcievable)
Heroes have around 350-400 base primary Stats and almost half for other stats.
Now as you said, with 77 stat points you were able to get near around 75% chance.
So is there any way to reduce the increment per point?:confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top