How is DPS calculated?

    Joined
    Mar 22, 2015
    Messages
    120
    Reaction score
    64
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 2
    Just a quick question. As I've seen multiple answers for this before.

    How is DPS (by DPS I mean damage per second not per shot) calculated for each weapon system? considering someone made a program that can do this I know SOMEONE has the answer. I mainly need a equation and an example to help me figure it out.

    Also,
    For calculating the damage a ship can do to another's shields both have rates associated with each.

    Weapons do DPS (damage per second) shields have regeneration (regain per second)
    Since both are "per second" we can assume that DPS - shield regen = total damage to shields per second.

    Say that the weapon I am using is a high power missile with a long cooldown. While damage per shot may be high in order to use it in the equation the cool down time would come in to effect since the shields would regenerate constantly while the missile can't fire constantly. I need to know how and if cooldown is calculated in DPS because if not that would change my equation to DPS - SR*cooldown = damage to shields.
    This is why I need to know.
     

    Olxinos

    French fry. Caution: very salty!
    Joined
    May 7, 2015
    Messages
    151
    Reaction score
    88
    The damage per shot of a weapon is calculated as follows (and is then divided by the weapon cooldown, and/or multiplied by the number of ticks for beams):
    [number of blocks]*[master damage]*(1+[slave modifier]*[slave ratio])*(1+[tertiary effect modifier]*[tertiary effect ratio])
    Most of the time, [master damage], [slave modifier] and [tertiary effect modifier] can be directly looked up in data/config/BlockBehaviourConfig.xml witht the notable exception of cannon slaved weapons which reduce damage per hit per block instead of increasing it; their 'style' property is set to 'nerf' rather than 'buff' and the real modifier actually is 1/[modifier]-1 (as a rule of thumb, if the modifier is supposed to decrease the value but is positive, use this formula as the real modifier, otherwise, just take it as is)

    For instance, here are the values for the cannon/X weapons:
    Code:
    <Cannon>
                    <BasicValues>
                            <Damage>10</Damage>
                            <Distance>1</Distance> <!-- 1 is equal to 100% sector radius -->
                            <Speed>10</Speed> <!-- In relation % to server max speed  1 = 100% -->
                            <ReloadMs>1000</ReloadMs>
                            <PowerConsumption>100</PowerConsumption>
                            <AdditionalPowerConsumptionPerUnitMult>0.1</AdditionalPowerConsumptionPerUnitMult> <!-- Nerf based on amount of groups connected to the same controller: powerConsumption * (1+countGroups*thisValue); 0 tu turn off nerf-->
                            <DefaultWeaponPenetrationWeight>1.5</DefaultWeaponPenetrationWeight> <!-- This weight will distribute the damage on the penetration depth path. The higher, the more damage is used in the first blocks -->
                             <DefaultWeaponPenetrationDeepnessMultiplier>1.5</DefaultWeaponPenetrationDeepnessMultiplier> <!-- how deep is the penetration potentially (depending on log10 of damage). A value of 0 defaults to the old system (full damage hits one block) -->
    
                    </BasicValues>
                    <Combination>
                            <Cannon>
                                    <Damage style="nerf" linear="true" value="10" />
                                    <Reload style="buff" inverse="true" value="10" />
                                    <Distance style="skip" />
                                    <Speed style="skip" />
                                    <Split style="skip" />
                                    <PowerConsumption style="nerf" linear="true" value="10" />
                            </Cannon>
                            <Missile>
                                    <Damage style="buff" linear="true" value="1" />
                                    <Reload style="nerf" inverse="true" value="1" />
                                    <Distance style="skip" />
                                    <Speed style="skip" />
                                    <Split style="buff" value="9" />
                                    <PowerConsumption style="nerf" inverse="true" linear="true" value="1"/>
                            </Missile>
                            <Beam>
                                    <Damage style="buff" linear="true" value="3" /><!-- 1+3 = 4x damage -->
                                    <Reload style="nerf" inverse="true" value="3" /><!-- 1+3 = 4000ms -->
                                    <Distance style="buff" value="2" />
                                    <Speed style="buff" value="1" />
                                    <Split style="skip" />
                                    <PowerConsumption linear="true" style="nerf" inverse="true" value="3"/> <!-- 1+3 = 4x power consumption -->
                            </Beam>
                            <Pulse>
                                    <Damage style="buff" value="15" linear="true" />
                                    <Reload style="nerf" inverse="true" value="15" />
                                    <Distance style="skip" />
                                    <Speed style="skip" />
                                    <Split style="skip" />
                                    <PowerConsumption style="buff" linear="true" value="15" />
                            </Pulse>
                    </Combination>
            </Cannon>
    [master damage] is Cannon/BasicValues/Damage (i.e. 10), [slave modifier] is (usually) Cannon/Combination/X/Damage where X is the slave weapon (i.e. respectively (1/10 - 1), 1, 3, and 15 for the cannon, missile, beam, and pulse slaves; in red are the values read in the file). The tertiary effect modifier is further in that file.

    For instance, a beam/pulse/ion weapon with 50/40/30 blocks would currently deal:
    (50+40+30)*10*(1+10*40/50)*(1+1*30/50) = 17,280 per hit (against shields)
    (50+40+30)*10*(1+10*40/50)*(1+(-1)*30/50) = 4320 per hit (against blocks, usually divided between multiple blocks)

    A cannon/cannon/overdrive weapon with 9/5/3 blocks would currently deal:
    (9+5+3)*10*(1+(1/10 - 1)*5/9)*(1+2*3/9) = 141.67 per hit (rounded down, usually divided between multiple blocks)

    The same formula can be applied to power consumption. If you don't multiply by the number of blocks, it also works for cooldown, burst time and other properties.

    Edit:
    keep in mind that this is the damage per hit, you need to multiply by the number of hits per activation (usually 5 for beams for instance) and divide by the cooldown to have the real DpS (damage per second)
    also keep in mind that all weapons now spread damage between several blocks, these formulas don't describe how this damage is spread (and some damage might be lost in space and/or by applying too much damage on a single block)
     
    Last edited:

    Keptick

    Building masochist
    Joined
    Sep 26, 2013
    Messages
    4,062
    Reaction score
    1,841
    • Councillor 2 Gold
    • Railman Gold
    • Thinking Positive Gold
    Total amount of blocks in a weapon system * 10 = Dps for beams and cannons

    Total amount of blocks in weapon system * 20 = DPS for missiles

    Keep in mind that damage distribution is different for missiles, so you'll never actually get 20 dps per block (closer to 10 on average). Weapon combos distribute damage in different ways and over different time periods, but in the end the total damage is always what the above formulas prescribe.