*

Account

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 22, 2024, 02:41:01 pm

Login with username, password and session length

Resources

Recent posts

[November 01, 2024, 12:46:37 pm]

[October 05, 2024, 07:29:20 am]

[September 05, 2024, 01:54:13 pm]

[July 16, 2024, 11:30:34 pm]

[June 22, 2024, 06:49:40 am]

[March 08, 2024, 12:13:38 am]

[March 08, 2024, 12:12:54 am]

[March 08, 2024, 12:09:37 am]

[December 30, 2023, 08:00:58 pm]

[February 04, 2023, 11:46:41 am]
Pages: [1]   Go Down
  Print  
Author Topic: [How To] Calculate weapon DPS  (Read 15896 times)
0 Members and 1 Guest are viewing this topic.
LeoPhone Offline
Honoured Member
*
Posts: 0


« on: May 11, 2011, 07:02:29 am »

This guide will teach you how to calculate the Damage Per Second of any weapon.
Some DPS values can be found at http://dow2.info/coh/Zaxis/rifles/ & http://dow2.info/coh/Zaxis/mgs/ but this is largely incomplete.

Step 1
Get familiar with Corsix Mod Studio. You can do so with this guide:
http://forums.europeinruins.com/index.php?topic=14995

Step 2
Go to the bottom of this post and copy the code. next, open the folder called "weapon" in "attrib/attrib", go some folder levels deeper and right click the folder you want to know the weapon DPS of.
Now click on "Run macro over RGDs in this folder". Delete all the text in the window that shows up and paste the macro in it. Click on "Run Macro" to see the results!

Step 3
The macros dont take the target tables into account so this you will have to do manually.
open the rgd of the weapon you are calculating and go to Gamedata/weapon_bag/target_table
find the armor type you are interested in and take into account the modifiers that apply.


ZAxis's Rifle & Machine Gun DPS Formula
Code:
function each_file(rgd)
    if rgd.GameData.weapon_bag then
        local weapon = rgd.GameData.weapon_bag
        
        local damage = (weapon.damage.min+weapon.damage.max)/2
        local reloadFrequency = (weapon.reload.frequency.max+weapon.reload.frequency.min)/2
        local reloadDuration = (weapon.reload.duration.max+weapon.reload.duration.min)/2+weapon.fire.wind_up+weapon.fire.wind_down
        local cooldownShort = (weapon.cooldown.duration.max+weapon.cooldown.duration.min)/2*weapon.cooldown.duration_multiplier.short
        local cooldownMedium = (weapon.cooldown.duration.max+weapon.cooldown.duration.min)/2*weapon.cooldown.duration_multiplier.medium
        local cooldownLong = (weapon.cooldown.duration.max+weapon.cooldown.duration.min)/2*weapon.cooldown.duration_multiplier.long
        local fireAimTimeShort = (weapon.aim.fire_aim_time.max+weapon.aim.fire_aim_time.min)/2*weapon.aim.fire_aim_time_multiplier.short
        local fireAimTimeMedium = (weapon.aim.fire_aim_time.max+weapon.aim.fire_aim_time.min)/2*weapon.aim.fire_aim_time_multiplier.medium
        local fireAimTimeLong = (weapon.aim.fire_aim_time.max+weapon.aim.fire_aim_time.min)/2*weapon.aim.fire_aim_time_multiplier.long
        local readyAimTime = (weapon.aim.ready_aim_time.max+weapon.aim.ready_aim_time.min)/2
        local WindUpWindDown = weapon.fire.wind_up+weapon.fire.wind_down
        local ZaxisDPSShort
        local ZaxisDPSMedium
        local ZaxisDPSLong

        if weapon.burst.can_burst == true then
            local burstDuration = (weapon.burst.duration.max+weapon.burst.duration.min)/2
            local rateOfFire = (weapon.burst.rate_of_fire.max+weapon.burst.rate_of_fire.min)/2

            ZaxisDPSShort = (rateOfFire * burstDuration * (reloadFrequency + 1) * weapon.accuracy.short * damage) / (readyAimTime + (fireAimTimeShort + cooldownShort + WindUpWindDown) * reloadFrequency + reloadDuration + burstDuration * (reloadFrequency + 1))
            ZaxisDPSMedium = (rateOfFire * burstDuration * (reloadFrequency + 1) * weapon.accuracy.medium * damage) / (readyAimTime + (fireAimTimeMedium + cooldownMedium + WindUpWindDown) * reloadFrequency + reloadDuration + burstDuration * (reloadFrequency + 1))
            ZaxisDPSLong = (rateOfFire * burstDuration * (reloadFrequency + 1) * weapon.accuracy.long * damage) / (readyAimTime + (fireAimTimeLong + cooldownLong + WindUpWindDown) * reloadFrequency + reloadDuration + burstDuration * (reloadFrequency + 1))
        else
            ZaxisDPSShort = ((reloadFrequency + 1) * weapon.accuracy.short * damage) / (readyAimTime + (fireAimTimeShort + cooldownShort + WindUpWindDown) * reloadFrequency + reloadDuration)
            ZaxisDPSMedium = ((reloadFrequency + 1) * weapon.accuracy.medium * damage) / (readyAimTime + (fireAimTimeMedium + cooldownMedium + WindUpWindDown) * reloadFrequency + reloadDuration)
            ZaxisDPSLong = ((reloadFrequency + 1) * weapon.accuracy.long * damage) / (readyAimTime + (fireAimTimeLong + cooldownLong + WindUpWindDown) * reloadFrequency + reloadDuration)
        end

        print("# "..rgd.name.."")
        print("  | Zaxis S DPS = "..(math.floor(ZaxisDPSShort*100+0.005)/100))
        print("  | Zaxis M DPS = "..(math.floor(ZaxisDPSMedium*100+0.005)/100))
        print("  | Zaxis L DPS = "..(math.floor(ZaxisDPSLong*100+0.005)/100))
        print("")
    end
end

References:
http://forums.relicnews.com/showthread.php?259362-Tool-Macro-Weapon-Damage-Per-Second
http://dow2.info/coh/Zaxis/
« Last Edit: April 13, 2012, 06:26:44 pm by LeoPhone » Logged
TheIcelandicManiac Offline
Resident forum troll. Fucked unkn0wns mom
*
Posts: 6294


« Reply #1 on: May 11, 2011, 09:46:47 am »

Sweet thanks for this.

PS: stiky this thread
Logged

Quote from: Grundwaffe
Soon™
gj icelandic i am proud of u  Smiley
Sometimes its like PQ doesnt carrot all.

Work Harder
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #2 on: May 11, 2011, 09:57:10 am »

hmm, looked a bit into what the macro is actually doing now and it kind of differs from http://dow2.info/coh/Zaxis/

I took the formula here http://dow2.info/coh/Zaxis/dps.html and put it in the macro.
It calculates the m1 garand and m1 carbine correctly but the axis rifles dps are different.

Code:
function each_file(rgd)
    if rgd.GameData.weapon_bag then
        local weapon = rgd.GameData.weapon_bag
       
        local damage = (weapon.damage.min+weapon.damage.max)/2
        local reloadFrequency = (weapon.reload.frequency.max+weapon.reload.frequency.min)/2
        local reloadDuration = (weapon.reload.duration.max+weapon.reload.duration.min)/2
        local cooldownmedium = (weapon.cooldown.duration.max+weapon.cooldown.duration.min)/2*weapon.cooldown.duration_multiplier.medium
        local fireaimtimemedium = (weapon.aim.fire_aim_time.max+weapon.aim.fire_aim_time.min)/2*weapon.aim.fire_aim_time_multiplier.medium
        local readyaimtime = (weapon.aim.ready_aim_time.max+weapon.aim.ready_aim_time.min)/2

        local shotsFired
        if weapon.burst.can_burst == true then
            local burstDuration = (weapon.burst.duration.max+weapon.burst.duration.min)/2
            local rateOfFire = (weapon.burst.rate_of_fire.max+weapon.burst.rate_of_fire.min)/2
           
            local burstsFired = 1/(burstDuration*reloadFrequency+reloadDuration)
            shotsFired = rateOfFire*burstsFired
        else
            shotsFired = 1/(reloadFrequency+reloadDuration)
        end
        local dps = shotsFired*damage
local Zaxisdps = ((reloadFrequency + 1) * weapon.accuracy.medium * damage) / (readyaimtime + (fireaimtimemedium + cooldownmedium) * reloadFrequency + reloadDuration)
       
        print("# "..rgd.name..": DPS="..(math.floor((dps+0.005)*100)/100).." Per Hit="..damage)
        print("  | distant="..(math.floor(weapon.accuracy.distant*dps*100+0.005)/100))
        print("  | long="..(math.floor(weapon.accuracy.long*dps*100+0.005)/100))
        print("  | medium="..(math.floor(weapon.accuracy.medium*dps*100+0.005)/100))
        print("  | short="..(math.floor(weapon.accuracy.short*dps*100+0.005)/100))
        print("  | ZaxisDPS="..(math.floor(Zaxisdps*100+0.005)/100))
        print("")
    end
end

I summon a Mysthalin!
Logged
Mysthalin Offline
Tired King of Stats
*
Posts: 9028


« Reply #3 on: May 11, 2011, 10:02:24 am »

Why the fuck are they dividing everything by 2 in that code?
Logged

LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #4 on: May 11, 2011, 10:08:17 am »

its x.max + x.min / 2 to get average
Logged
Mysthalin Offline
Tired King of Stats
*
Posts: 9028


« Reply #5 on: May 11, 2011, 11:16:00 am »

Ah right.

*takes off vodka goggles*

Right, the reason why we get different results on the axis rifles (shouldn't be too different from the ones calculated in zaxis, really) is because we have switched their wind-down time into cooldown (applying appropriate cooldowns to ensure their DPS remains largely unchanged).
So there might be a slight change in the actual DPS of axis rifles - but it shouldn't be anything beyond a 5% deviation, afaik.
Logged
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #6 on: May 11, 2011, 11:27:28 am »

It calculates using the Zaxis forumla.

garands and carbines give correct result (1.79 and 1.71, medium range)
but stormtrooper k98 gives 5.2 and volks k98 2.93
in http://dow2.info/coh/Zaxis/rifles/ the results are 3.88 and 2.19
Logged
Mysthalin Offline
Tired King of Stats
*
Posts: 9028


« Reply #7 on: May 16, 2011, 03:15:43 pm »

Sigh... I'll look through it once i'm done with my essays, end of the week maybe.
Logged
3rdCondor Offline
Donator
*
Posts: 1536


« Reply #8 on: May 16, 2011, 08:39:07 pm »

Why would you take off your vodka goggles?
Logged

No tits, but i will bake a cake then eat it in honour of Sir Condor The 3rd
fuck the pgren rifle, fucking dogshit weapon
My beautiful black pussy won
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #9 on: May 16, 2011, 11:45:42 pm »

Help us Mythalin Kenobi, you are our only hope.  Roll Eyes
Logged
tank130 Offline
Sugar Daddy
*
Posts: 8889


« Reply #10 on: May 17, 2011, 07:22:22 am »

Help us Mythalin Kenobi, you are our only hope.  Roll Eyes



LOL - good one Leo
Logged

Quote
Geez, while Wind was banned I forgot that he is, in fact, totally insufferable
I'm not going to lie Tig, 9/10 times you open your mouth, I'm overwhelmed with the urge to put my foot in it.
Mysthalin Offline
Tired King of Stats
*
Posts: 9028


« Reply #11 on: May 17, 2011, 08:09:05 am »

Yeah, I know what's up. You're not accounting for the 0.5 second wind-down after each shot that you should be in your formula.

Yeah, it exists. Go check it yourself.
Logged
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #12 on: May 17, 2011, 08:49:48 am »

Ok. getting more accurate readings now.
will post macros soon.

kar98(V)
cohstats: 2.19
corsix macro (EIR): 2.31
corsix macro (VCoH): 2.19

Kar98(G/S)
cohstats - 3.88
corsix macro (EIR) - 4.11
corsix macro (VCoH) - 3.88

g43
cohstats - 4.88
corsix macro (EIR) - 4.44
corsix macro (VCoH) - 4.17

Kar98(P)
cohstats - 2.63
corsix macro (EIR) - 2.77
corsix macro (VCoH) - 2.63

Lee enfield
cohstats - 1.92
corsix macro (EIR) 1.89
corsix macro (VCoH) 1.84


I guess we can live with it but what I don't get is why the EIR values differ from the vcoh values. and the g43 is way off.
Logged
Mysthalin Offline
Tired King of Stats
*
Posts: 9028


« Reply #13 on: May 17, 2011, 08:57:32 am »

EiR values on the K98s may differ due to gamesguy being a twat in when he was calculating the cooldown multipliers when transitioning the K98s from being wind-down based to being cooldown based.

The G43s massive difference is due to us buffing the lower and upper cooldown limits.
Logged
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #14 on: May 17, 2011, 09:48:04 am »

updated macros.

first macro now calculates Zaxis DPS at short, medium and long range.
works for both rifles and machine guns.
Logged
Firesparks Offline
Honoured Member
*
Posts: 1209



« Reply #15 on: July 11, 2011, 09:31:54 pm »

does your dps calculator take into account wind down?
Logged


With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
LeoPhone Offline
Honoured Member
*
Posts: 0


« Reply #16 on: July 12, 2011, 09:57:04 am »

you can read the formula yourself?

yes.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!
Page created in 0.079 seconds with 35 queries.