Forged Alliance Forever Forged Alliance Forever Forums 2018-07-22T23:24:56+02:00 /feed.php?f=42&t=16319 2018-07-22T23:24:56+02:00 2018-07-22T23:24:56+02:00 /viewtopic.php?t=16319&p=166088#p166088 <![CDATA[Re: Units Database]]>
Here is a function for all weapons and how to calculate the DPS:
(With debug function)
Code:
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')
        end
        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
        else
            DPS.Damage = weapon.Damage * MuzzleSalvoSize
        end               
    elseif weapon.DoTPulses then
        if bugtext == true then
            LOG(' DoTPulses')
        end
        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')
        end
        --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')
        end
        local BeamCollisionDelay = weapon.BeamCollisionDelay or 0
        local BeamLifetime = weapon.BeamLifetime or 1
        if BeamLifetime > 5 then
            BeamLifetime = 5
        end
        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')
        end
        -- Salvos don't use weapon.RateOfFire
        DPS.RateOfFire = 1 / ((weapon.MuzzleSalvoSize * weapon.MuzzleSalvoDelay + weapon.RackSalvoReloadTime))
        DPS.Damage = weapon.Damage * weapon.MuzzleSalvoSize
    else
        -- ueb2101
        if bugtext == true then
            LOG(' One Shot')
        end
        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..']')
            end
            ProjectilesPerOnFire = 1
        end
        DPS.RateOfFire = 1 / (math.round(10/weapon.RateOfFire) / 10)
        DPS.Damage = weapon.Damage * MuzzleSalvoSize * ProjectilesPerOnFire
    end
    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
end


This function is included inside my (private) tooltip mod:
http://faforever.uveso.de/forum/SmartUnitTooltipV2.zip
(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.

Statistics: Posted by Uveso — 22 Jul 2018, 23:24


]]>
2018-07-22T23:15:25+02:00 2018-07-22T23:15:25+02:00 /viewtopic.php?t=16319&p=166087#p166087 <![CDATA[Re: Units Database]]>
just fix bugs as they are raised

how can icedreamer realistically know the answer?

this is too careful

Statistics: Posted by nine2 — 22 Jul 2018, 23:15


]]>
2018-07-22T16:52:38+02:00 2018-07-22T16:52:38+02:00 /viewtopic.php?t=16319&p=166053#p166053 <![CDATA[Re: Units Database]]> 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.

Statistics: Posted by Louvegarde — 22 Jul 2018, 16:52


]]>
2018-06-13T17:38:34+02:00 2018-06-13T17:38:34+02:00 /viewtopic.php?t=16319&p=164888#p164888 <![CDATA[Re: Units Database]]>
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.

Statistics: Posted by JoonasTo — 13 Jun 2018, 17:38


]]>
2018-06-13T16:42:45+02:00 2018-06-13T16:42:45+02:00 /viewtopic.php?t=16319&p=164887#p164887 <![CDATA[Re: Units Database]]> the zthuee is already known about, its gonna be fixed at some point i guess

the dot damage does indeed appear to be wrong, but the dps is correct regardless. (yes janus does 1600 damage/pass, but it never hits its bombs on one target, go figure) i didnt notice this before, the dps calculation does take it into account, so it looks like they are separate functions and one forgot to be updated.

the most fucked one is the cybran aa of course though. the script disables/enables the weapon, so some of its cooldowns are bypassed. and thats on top of 60 other different things going on in there, which make it all very confusing, and THATS on top of just random bad code which doesnt do anything but might interfere with calculations.

manual calculation of the cybran aa put it somewhere around: 120 dps so its not massively far off, but really this kinda depends on magic a little bit so dont trust this number too much either

this will take some thought to fix tbh. xD

Statistics: Posted by Exotic_Retard — 13 Jun 2018, 16:42


]]>
2018-06-13T15:08:36+02:00 2018-06-13T15:08:36+02:00 /viewtopic.php?t=16319&p=164884#p164884 <![CDATA[Re: Units Database]]> Statistics: Posted by keyser — 13 Jun 2018, 15:08


]]>
2018-06-13T14:46:12+02:00 2018-06-13T14:46:12+02:00 /viewtopic.php?t=16319&p=164883#p164883 <![CDATA[Re: Units Database]]>
If you look at the zthuee projectile blueprint you will see that the line that produces a child projectile in line with the original projectile is commented out so it only has five child projectiles, not six as you would assume. But like I mentioned, it's a blueprint problem, not a calculation error.

And seraphim destroyer torpedoes do 100 DPS, not 160 because of the MuzzleSalvoDelay interfering with the RateOfFire. It's unable to fire 2 torpedoes every 1 second because the MuzzleSalvoDelay is still active for 0,6 seconds. What ends up happening is a torpedo every 0,8 seconds. A constant stream.

Janus also seems wrong, should be 120 DPS not 160. Based off old data perhaps? I'm not sure how you can get 160 otherwise.

Speaking of DoT damage, the fire cycle is missing all DoT information for all units. Janus, for example, shows 120 damage per fire cycle, should be 1200. Nanite torpedo on Galaxy shows 40 damage per fire cycle, should be 200.

There's probably more but I haven't checked them all so *shrugs*

Statistics: Posted by JoonasTo — 13 Jun 2018, 14:46


]]>
2018-06-13T12:41:37+02:00 2018-06-13T12:41:37+02:00 /viewtopic.php?t=16319&p=164881#p164881 <![CDATA[Re: Units Database]]> http://spooky.github.io/unitdb/#/XSL0103,XSS0201 pretty sure these are right, the torpedoes and zthuuee damage at least, found the typo in the dps code for beams that makes it incorrect for things with a beam lifetime, should have been a + not a - xd

expect that bit to be fixed soon™ at least, but the torpedo dps is correct as best i can tell. the zthuee and other splitting projectiles need to be fixed in the blueprints themselves, they are mostly right but may need more checks.

you also said ect. like there are other things wrong, what are they? can you give examples?

also keyser i dont know. i dont remember your example that you gave but probably yes. the db is updated reasonably quickly when issues are found. it would be best to check not just assume its broken every time xD

regardless, spookys db currently has the most accurate dps calculations available.

Statistics: Posted by Exotic_Retard — 13 Jun 2018, 12:41


]]>
2018-06-13T08:30:49+02:00 2018-06-13T08:30:49+02:00 /viewtopic.php?t=16319&p=164871#p164871 <![CDATA[Re: Units Database]]> Statistics: Posted by JoonasTo — 13 Jun 2018, 08:30


]]>
2018-06-13T04:14:00+02:00 2018-06-13T04:14:00+02:00 /viewtopic.php?t=16319&p=164867#p164867 <![CDATA[Re: Units Database]]> Statistics: Posted by keyser — 13 Jun 2018, 04:14


]]>
2018-06-13T01:52:00+02:00 2018-06-13T01:52:00+02:00 /viewtopic.php?t=16319&p=164866#p164866 <![CDATA[Re: Units Database]]>
http://spooky.github.io/unitdb/#/by-class

Statistics: Posted by Exotic_Retard — 13 Jun 2018, 01:52


]]>
2018-06-13T01:24:29+02:00 2018-06-13T01:24:29+02:00 /viewtopic.php?t=16319&p=164865#p164865 <![CDATA[Re: Units Database]]>
IceDreamer wrote:
The old DPS numbers were often wrong. Calculating them is really difficult to get right in some edge cases. I'm pretty sure it's being worked on, and should come at some point.

It's not actually all that hard, I've got an excel sheet that does almost everything right, anything I've tried anyway. There's probably something I've missed but it seems to cover most of the mechanics.

It goes something like this:
Code:
IF(Turreted=True;MuzzleCount;MuzzleSalvoSize)*IF(AND(RackFireTogether=True;MuzzleSalvoSize=1);RackCount;1)*IF(BeamLifetime>0;(Beamlifetime+0.1)/0.1;1)*IF(DotPulses>0;DotPulses;1)*Fragments*Damage/(IF((MuzzleSalvoSize-1)*MuzzleSalvoDelay>1/RateOfFire;(MuzzleSalvoSize-1)*MuzzleSalvoDelay;IF(MuzzleSalvoSize*MuzzleSalvoDelay>1/RateOfFire;MuzzleSalvoSize*MuzzleSalvoDelay;1/RateOfFire))+RackSalvoChargeTime+RackSalvoReloadTime) = DPS

Where Fragments is the only value not directly in the blueprint. To get that value you need to read the blueprint of the projectile of the weapon and get the local value for the number of child projectiles and add one to it(except for the zthuue, that has that line commented out,) then multiply with the child projectile blueprints local value for the number of child projectiles plus one and so forth until your loop ends at the last blueprint not referencing a new one anymore. I think Salvation is the longest at 3 iterations.

Statistics: Posted by JoonasTo — 13 Jun 2018, 01:24


]]>
2018-06-13T00:42:53+02:00 2018-06-13T00:42:53+02:00 /viewtopic.php?t=16319&p=164864#p164864 <![CDATA[Re: Units Database]]> Statistics: Posted by IceDreamer — 13 Jun 2018, 00:42


]]>
2018-06-13T00:37:49+02:00 2018-06-13T00:37:49+02:00 /viewtopic.php?t=16319&p=164862#p164862 <![CDATA[Units Database]]> Statistics: Posted by pieguy — 13 Jun 2018, 00:37


]]>