Units Database

Re: Units Database

Postby JoonasTo » 13 Jun 2018, 17:38

Yeah, in my tests the sera destro DPS is 95 as well. No idea why it does what it does though, maybe it's just that there's a wait tick somewhere so it takes time to check?

Oh yeah, Janus is one of those one off units that have two damage values.

216,666...206,666 DPS for cybran mobile AA actually. All of the racks fire both barrels once per firing cycle which lasts about 6 seconds. So 2x6x100=1200/6ish~around 200~ DPS.
User avatar
Posts: 498
Joined: 08 Feb 2015, 01:11
Has liked: 18 times
Been liked: 82 times
FAF User Name: JoonasTo

Re: Units Database

Postby Louvegarde » 22 Jul 2018, 16:52

Sorry for the bump, I didn't see this post before.
I'm the one maintaining the current official Unit DB.
As I've stated before, there is no calculation available for DPS. The methods that currently exist don't are not unanimously accepted. There is still debate on this.
Recently, Apofenas came to me with calculations. I told him to validate them with Icedreamer : and Apofenas later came back telling me Icedreamer "neither refused nor approved those calculations".

I'm making sure that everything displayed on the Unit database is 100% accurate in representing the game stats and values. I won't implement a DPS or a Damage calculation for the moment as none really exist. But let it be known that the day someone comes to me with a perfect calculation and a seal of approval from Icedreamer himself, I will be glad to implement it in the unit db.

As exotic pointed out, Spooky's database offers good approximations for most of the units for now regarding DPS, so you can use that for the moment.
Cryogenic slumber party!
User avatar
Posts: 213
Joined: 25 Mar 2018, 14:09
Has liked: 66 times
Been liked: 57 times
FAF User Name: Louvegarde

Re: Units Database

Postby Anihilnine » 22 Jul 2018, 23:15

approximation is better than nothing

just fix bugs as they are raised

how can icedreamer realistically know the answer?

this is too careful
Posts: 2209
Joined: 16 Apr 2013, 10:10
Has liked: 258 times
Been liked: 381 times
FAF User Name: Anihilnine

Re: Units Database

Postby Uveso » 22 Jul 2018, 23:24

Well there is a calculation of the DPS ingame.

Here is a function for all weapons and how to calculate the DPS:
(With debug function)
Code: Select all
function GetWeaponDPS(bp,weapon)
    local DPS = {}
    DPS.Damage = 0
    DPS.RateOfFire = 0
    DPS.DPS = 0

    -- enable debug text
    local bugtext = false

    local WeaponEco = __blueprints[weapon.ProjectileId].Economy or nil
    if WeaponEco and bp.Economy.BuildRate > 1 and WeaponEco.BuildTime > 1 and (WeaponEco.BuildCostEnergy > 1 or WeaponEco.BuildCostMass > 1) then
        if bugtext == true then
            LOG(' BuildTime')
        local MuzzleSalvoSize = weapon.MuzzleSalvoSize or 1
        DPS.RateOfFire = 1 / (__blueprints[weapon.ProjectileId].Economy.BuildTime / bp.Economy.BuildRate)
        if weapon.NukeInnerRingDamage > 0 then
            DPS.Damage = weapon.NukeInnerRingDamage + weapon.NukeOuterRingDamage
            DPS.Damage = weapon.Damage * MuzzleSalvoSize
    elseif weapon.DoTPulses then
        if bugtext == true then
            LOG(' DoTPulses')
        DPS.RateOfFire = 1 / (math.round(10/weapon.RateOfFire) / 10)
        DPS.Damage = weapon.Damage * weapon.MuzzleSalvoSize * weapon.DoTPulses
    elseif weapon.ContinuousBeam then
        -- ual0401
        if bugtext == true then
            LOG(' Continuous Beam')
        --LOG(' weapon.BeamCollisionDelay='..weapon.BeamCollisionDelay)
        local temp = weapon.BeamCollisionDelay == 0 and 1 or weapon.BeamCollisionDelay
        --LOG(' temp='..temp)
        DPS.RateOfFire = 1 / (weapon.BeamCollisionDelay == 0 and 1 or weapon.BeamCollisionDelay)
        DPS.Damage = weapon.Damage * 10
    elseif (weapon.BeamLifetime and weapon.BeamLifetime > 0) then
        -- xsb2301 xea0002
        if bugtext == true then
            LOG(' Pulse Beam')
        local BeamCollisionDelay = weapon.BeamCollisionDelay or 0
        local BeamLifetime = weapon.BeamLifetime or 1
        if BeamLifetime > 5 then
            BeamLifetime = 5
        DPS.RateOfFire = 1 / (math.round(10/weapon.RateOfFire) / 10)
        DPS.Damage = weapon.Damage * BeamLifetime * 10
    elseif (weapon.RackSalvoReloadTime and weapon.RackSalvoReloadTime > 0) and not weapon.RackSalvoFiresAfterCharge then
        if bugtext == true then
            LOG(' Salvos')
        -- Salvos don't use weapon.RateOfFire
        DPS.RateOfFire = 1 / ((weapon.MuzzleSalvoSize * weapon.MuzzleSalvoDelay + weapon.RackSalvoReloadTime))
        DPS.Damage = weapon.Damage * weapon.MuzzleSalvoSize
        -- ueb2101
        if bugtext == true then
            LOG(' One Shot')
        local ProjectilesPerOnFire = weapon.ProjectilesPerOnFire or 1
        local AttackGroundTries = weapon.AttackGroundTries or 1
        local MuzzleSalvoSize = weapon.MuzzleSalvoSize or 1
        -- don't use ProjectilesPerOnFire if MuzzleSalvoSize is present.
        if MuzzleSalvoSize > 1 and ProjectilesPerOnFire > 1 then
            if MuzzleSalvoSize ~= ProjectilesPerOnFire then
                WARN('unit ['..bp.BlueprintId..'] has wrong ProjectilesPerOnFire in Weapon ['..weapon.DisplayName..']')
            ProjectilesPerOnFire = 1
        DPS.RateOfFire = 1 / (math.round(10/weapon.RateOfFire) / 10)
        DPS.Damage = weapon.Damage * MuzzleSalvoSize * ProjectilesPerOnFire
    if DPS.RateOfFire == 0 then DPS.RateOfFire = 1 end
    --LOG(' Damage: '..DPS.Damage..' - RateOfFire: '..DPS.RateOfFire..' - new DPS: '..(DPS.Damage*DPS.RateOfFire))
    DPS.DPS = DPS.Damage*DPS.RateOfFire
    return DPS

This function is included inside my (private) tooltip mod:
(Needs option "Show Armament Build in Factory Menu" enabled)

This mod also displays the original FAF game calculation and Hussars calculation from the unit manager.
You will see that all 3 DPS values from the different source almost have the same dps.

But you can't calculate all weapons correctly because you don't have all needed date inside the unit blueprints.
There are some weapons with racks or multiple shoots that can't be calculated without a helper-variable added to the unitblueprint.

That's why all attempts stoped at this point.
User avatar
Supreme Commander
Posts: 1344
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 46 times
Been liked: 193 times
FAF User Name: Uveso


Return to FAF Suggestions

Who is online

Users browsing this forum: Google [Bot] and 1 guest