DPS is damage per second. But how is it calculated?
There are two types of weapons, those based off accuracy and those based of spread/splash. They'll need to be calculated differently.
Secondly what I call the base DPS of a weapon is the DPS is has without factoring in anything from the ships involved. It's the base DPS the weapon itself has with just using its own stats to calculate it and you would use this to compare weapons.
Lets see how complicated DPS truly is. Yes, I'm that bored.
Accuracy based Weapons.
To start with we'll simply say DPS = Damage/Reload.
To keep this short (as it'll get pretty large fairly fast), I'll call Damage 'D' and Reload 'R'.
D/R = DPS
But that is terribly inaccurate as there are many other aspects of the game that'll affect it. So let's add these other aspects into the formula one by one.
Accuracy is a percentage amount of the shots that hit. For an average valve of the amount of damage that is done, we can simply times it by the damage. I'll call Accuracy 'A'.
We then end up with (D*A)/R = DPS
Some weapons have a secondary damage of a different damage type. This is just additional damage on top of the normal damage so just add them together to get:
((D+SD)*A)/R = DPS
Next up we have Salvos. The salvo is the number of shots fired by the weapon before it starts to reload. The damage is split between the shots so no effect there. However since the weapon doesn't start to reload until after the last shot in the salvo is fired and that there is a 0.1 second delay between shots in the salvo being fired, we'll need to add the delay to the reload time to get the time between the start of each salvo.
If the salvo is 1 then it'll instantly reload after the shot is fired without delay. So the delay is actualy 0.1*(S-1), S being the number of shots in the salvo.
When we add that into what we have already we get:
((D+SD)*A)/(R+0.1*(S-1)) = DPS
Just a note, remember the order of calculations. Multiplication before addition. In some cases I'll add additional un-needed brackets just to make it easier to figure out instead of constantly checking what gets done first.
Now it's worth pointing out that if you truly want the most accurate formula possible you'll have to factor in some unlisted aspects. One of which is that all weapon damage stats is double that of the damage the weapon actually does.
We therefore need to halve the end result (or times by 0.5). But I'll add it straight to the damage stats themselves to keep related parts of the equation together. SO:
(((D/2)+(SD/2))*A)/(R+0.1*(S-1)) = DPS
That formula will calculate the DPS of an accuracy based weapon firing against a ship that has no defensive bonuses and doesn't factor in any bonuses the ship it's equipped to has.
Let's add those in next.
Factoring in everything.
Where to start... Damage bonuses! Specials like concussive warheads increase the damage of specific weapon types.
The damage type could be different for the primary damage (D) that's of the damage type of the weapon listed in the weapon's stats (Type: Penetrating) and the secondary damage (SD) which will state its damage type (Ballistic Damage: 300). So we'll add two new stats to the formula, DB (damage bonus) and SDB (secondary damage bonus).
The percentage damage bonus is the amount of the current damage it'll add.
So new damage = D + D*DB which when you factorise it becomes new damage = D*(1+DB)
So all we really need to do is multiply the damage by (1+DB) and thus we get:
(((D/2)*(1+DB)+(SD/2)*(1+SD))*A)/(R+0.1*(S-1)) = DPS
Now what about the enemy ship's damage reduction?
Remember both primary and secondary damage types could be different so we'll need to add separate reductions to both.
Let's take the overall damage reduction (I'll call it 'DR' and 'SDR'). You'll be best working out the overall damage reduction separately.
Now using the damage reduction, we can work out how much of the damage is kept by simply taking away the damage reduction from 1, in other words 1-DR. So 1 - 60% = 40% damage is dealt. We would then just need to multiply the damage by that just like we did with the damage bonus.
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*A)/(R+0.1*(S-1)) = DPS
As you guessed it, we'll end up with adding a load of (1+[value]) and (1-[value]) to the formula.
Next stop would be the reload. Certain hulls and specials provide reload bonuses as well as the ship's rank.
Take the current reload as a fire rate of 100%. Then add the total of the reload bonuses (I'll call it RB in the formula) with that initial 100%. The weapon is now firing at a rate of 1+RB (the initial fire rate + the increase) as fast as it was before.
So since it's firing 1+RB faster, we simply divivde the reload by 1+RB to get the new reload, R/(1+RB).
R/(1+RB) when put into the formula ends up as:
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*A)/((R/(1+RB))+0.1*(S-1)) = DPS
Just accuracy bonuses and evade left, both of these have some issues...
When adding accuracy bonuses to a weapon with 100% accuracy, it'll still be a 100% accurate. Some suggest that accuracy over 100% is possible and negates some evade. However the only thing kixeye has ever confirmed about accuracy and evade is that they are calculated separately so that suggestion is false and accuracy over 100% is the same as 100% accuracy.
What hasn't been confirmed is exactly how accuracy bonus (AB) works out of 3 possible suggested ways.
1. The percentage bonus is added to the percentage accuracy. 70% + 50% = 120%.
2. The bonus is a percentage increase of the accuracy percentage. 70% + (50% * 70%) = 105%.
Accuracy can go over 100% in the above two options and we would need to add a max value of 100% for it (I'm using a spread sheet for this so the MIN function could work for this).
3. The accuracy bonus reduces the amount of that misses, calculated in the same way as damage resistances to avoid going over 100%.
The fact that it seems to be possible with the right combination of specials to make some weapons with less than 100% accuracy have 100% accuracy and never miss makes me think that it's not the 3rd option. Also the fact that accuracy reduction (AR, so far only engine specials give reductions) couldn't possibly work in the same way and that I'm sure Kixeye would have both accuracy bonus and reduction working in the same way.
I would like to assume it's option 2 as other bonuses/reductions work in that manner and it would make the most sense for accuracy to follow suit.
Therefore the overall accuracy would be A*(1+AB)*(1-AR).
As mentioned before that could potentially go over 100% and thus we'll need to limit it to a max of 100%. Since I'm putting this into excel I could use the MIN function. It'll give the smallest of the two entered values, one being 100% and the other being the overall accuracy, MIN(1,A*(1+AB)*(1-AR)). So if the accuracy is lower than 100%, it'll return the accuracy otherwise the accuracy is over 100%, it'll return 100%.
Once that is put into the formula we have:
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*MIN(1,A*(1+AB)*(1-AR)))/((R/(1+RB))+0.1*(S-1)) = DPS
Evade, what's the issue here? Negative evade! The question is, does negative evade do anything?
A lot of people will say negative evade increases accuracy, we know that accuracy and evade are calculated separately (as stated by Kixeye). So does that mean that negative does not give shots that are going to miss, a chance of hitting?
I'll go with no. But until kixeye says something else we won't know exactly way or what negative evade does or is for. I believe it could just be to limit the maximum evade ship hulls can have.
Just like damage reduction, the enemy's evade (E) can be treated as a percentage of the damage lost so we want to find the percentage we keep which is basically 100% - E. But since I personally think negative evade does nothing, I would need to put a minimum value of 0% for evade to avoid negative evade causing an increase of accuracy. Again since I'm using Excel I could use the MAX function to return the evade, or if it is lower than 0, return 0.
(1-MAX(0,E)) alternate using the MIN function MIN(1,(1-E))
Now we just multiply by that and I'll place it next to accuracy in the formula as they are similar things after all. Doesn't matter which order you multiply in.
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*MIN(1,A*(1+AB)*(1-AR))*(1-MAX(0,E)))/((R/(1+RB))+0.1*(S-1)) = DPS
There we have it. A formula that'll calculate the DPS of a single accuracy based weapon on one ship will do to another ship factoring in every bonus that could affect the DPS from either ship as well as the weapon's stats. Oh, hang on a minute, modules on arbiters... The formula requires you to use the overall damage reduction which I'm sure you can calculate yourself, I hope, unless you're relying on the in-game value given to you in the shipyard.
Splash based weapons.
I'll start back at the base DPS stage as I want a base DPS formula for it to compare weapons.
Splash and spread is alternative to accuracy/evade. Accuracy and evade doesn't affect weapons based of splash and spread. We can therefore start by talking the base DPS formula for the accuracy based weapon and just removing accuracy. Splash and spread determine the proportion of damage dealt so we need to insert something in place of accuracy that involves splash an spread, but how do they work is the question.
(((D/2)+(SD/2))*[Splash and Spread Stuff here])/(R+0.1*(S-1)) = DPS
Splash is easy. It's the radius of the area around the impact point that will receive damage. The damage dealt is equal to have close the target is.
The very edge of the splash area and beyond would receive 0% damage with the exact point of impact receiving 100%. We can assume that the rate at which the damage decreases is consistent between the two points, so a point half of the splash radius away from the impact would take 50% damage.
Spread could be the radius of the area of which the projectile could land. The problem would then be how the point of which the projectile will land is randomized.
1. A random point is generated so that all points within the area is equally likely and thus more will less will land within a short distance of the target compared to a large distances due to the outer edges cover a larger area then the inner does. This would involve a lot of maths and makes high spread give an insanely low DPS to the point that it just blatantly incorrect compared to in-game results. Thus I highly doubt this is the way it is done.
2. A random direction from the target and a distance (between 0 and the value of spread) away from the target are generated. Therefore there will be an even spread of projectiles landing at each distance. More projectiles will appear to land near the center of the area near the target. This is what I assume is the way it is done.
But spread could also be the area of the projectiles land in. But that would mean reducing spread wouldn't make nearly as much of a difference as it does in-game so this also looks to be wrong.
An additional problem is that splash and spread don't work off the same range scale. 20 splash is equal to the distance of a land tile, the same and 20 range for a weapon. However spread isn't on the same scale, 20 spread is not equal in distance to that of a land tile or 20 weapon range or 20 splash.
Since when did people leave things unknown? Welcome the people I consider the greats of BP, those who are willing to spend time testing everything to its fullest to gain an understanding how things actually work.
Schmee did some great testing explained in his simulator thread in the player guides section (link to schmee's simulator). The results were that 1 spread seems to be 3/8 (0.375) splash. So we have our conversion factor, something that links the two, now we can do something.
Back to the calculations side of things, maybe. I'll need to split things up again into two. If splash is greater or equal to 0.375 spread, then splash will always cause damage to the target. But if it is smaller than splash wouldn't always hit the target. The proportion of damage dealt would need to be calculated differently for each scenario.
Splash < 0.375*Spread
The projectiles are assumed to be spread evenly at each possible distance from the target as explained earlier.
So when the projectile does land within distance to do splash damage, the likelihood of doing 0% damage is the same as 100% damage and thus on average will do half damage.
OK, the percentage of projectiles that do damage will on average do half damage. So what is the percentage that will do damage?
To get that we simply need to divide the distance it needs to land within to do damage (Splash) by the max distance it could land within (0.375*Spread). We then get Splash/(0.375*Spread) The possible max distance it could land away from the target is 0.375*Spread. We just need to divide that by Splash to determine the chance of it landing within the distance of splash from the target.
We've got our chance of doing damage as Splash/(0.375*Spread) and the fact that when it does, it'll do on average 50%.
So when Splash < 0.375*Splash, the accuracy/proportion of damage taken is (Splash/(0.375*Spread))*0.5 Yes I know there is no need for the second lot of brackets... I just think it's easier to understand with them in.
Splash > 0.375*Spread
In this case splash will always do damage. It won't on average be 50% due to the smaller spread causing it always to land within a closer area.
Let’s work out the average distance the projectile will land from the target. That'll simply be 0.375*Spread*0.5 (or (0.375*Spread)/2 ).
Then we can find the proportion of splash radius this is away from the target by dividing it by Splash. (0.375*Spread*0.5)/Splash
Splash does max damage at the center and minimum at the edge. In other words it does the inverse, the higher the distance the smaller the damage. So we also need to inverse the proportional distance of splash from the target to get the proportion of damage dealt (on average as it's average distance). We end up with:
1 - (0.375*Spread*0.5)/Splash
So now we now the calculations needed for splash. But we need to add to the formula a way of figuring out which method is to be used.
Good old IF functions. As before I'm putting this in excel so using the IF function to combine the two I get:
That's what we need to insert in place of accuracy. But before I do that, I'm going to replace Spread with SPR and Splash with SPL just to shorten it down.
Here's the formula from before for the base DPS.
(((D/2)+(SD/2))*[Splash and Spread Stuff here])/(R+0.1*(S-1)) = DPS
The final result for a formula that works out the base DPS of a splash/spread based weapon is as follows:
(((D/2)+(SD/2))*IF(SPL<0.375*SPR,(SPL/(0.375*SPR))*0.5,1-(0.375*SPR*0.5)/SPL))/(R+0.1*(S-1)) = DPS
Factoring in everything.
Time to factor in all bonuses again...
We already know how to implement the bonuses for damage reductions, damage bonuses and reload bonuses. So I'll just put those in straight off without explaining them again to get this:
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*IF(SPL<0.375*SPR,(SPL/(0.375*SPR))*0.5,1-(0.375*SPR*0.5)/SPL))/((R/(1+RB))+0.1*(S-1)) = DPS
You know how to add a percentage increase and decrease bonus by now.
The Splash bonus (SPLB) is a percentage increase, so we need to multiply each SPL by (1+SPLB).
The Spread bonus (SPRB) is a percentage decrease, so we need to multiply each SPR by (1-SPRB). This assumes you enter the percentage spread bonus as a positive, not a negative as listed in the stats. If you want to enter it into the formula as a negative then use (1+SPRB) instead. I just simply prefer entering in all values as positives so I don't have to mess around with negative values.
Anyway, we end up with this:
(((D/2)*(1+DB)*(1-DR)+(SD/2)*(1+SDB)*(1-SDR))*IF(SPL*(1+SPLB)<0.375*SPR*(1-SPRB),((SPL*(1+SPLB))/(0.375*SPR*(1-SPRB)))*0.5,1-(0.375*SPR*(1-SPRB)*0.5)/(SPL*(1+SPLB))))/((R/(1+RB))+0.1*(S-1)) = DPS
A formula that'll calculate the DPS that a Splash/Spread based weapon from one ship will deal to another ship which factors in all stats involved from bonuses each ship has as well as the weapon's own stats.
That last part was fairly quick. Why not combine the two, the accuracy and spread/splash based weapon formulas to create a general formula.
I would just need to stick an IF function into it to determine which of the two is used.
IF(SPL=0,[If true use accuracy base weapon formula],[else use splash/spread based weapon formula]) Simple enough?
General formula for the base DPS of a weapon.
IF(SPL=0,(((D/2)+(SD/2))*A)/(R+0.1*(S-1)),(((D/2)+(SD/2))*IF(SPL<0.375*SPR,(SPL/(0.375*SPR))*0.5,1-(0.375*SPR*0.5)/SPL))/(R+0.1*(S-1))) = DPS
General formula for the DPS of a single weapon in a given scenario factoring in everything but the speed of the enemy.
D = Damage
DB = Damage Bonus
DR = Damage Reduction
SD = Secondary Damage
SDB = Secondary Damage Bonus
SDR = Secondary Damage Reduction
A = Accuracy
AB = Accuracy Bonus
AR = Accuracy Reduction
E = Evade
R = Reload
RB = Reload Bonus
S = Salvo
SPL = Splash
SPLB = Splash Bonus
SPR = Spread
SPRB = Spread Bonus
Exceptions and faults with the formula.
Siege cannon D35-S, an accuracy weapon that also has splash. Solved with its own special formula, I'll post that tomorrow if I remember.
Halo missile and Arc missile. The projectiles land at fixed unknown distances from the target. Requires some guess work.
Doesn't factor in movement of ships which would affect splash/spread based weapons. Needs to figure out the time the projectile spends in the air and the relation between combat speed and distance in terms of splash.
I'll come back to this at some point.
If negative evade does allow shots that miss to hit, then it would need to be placed with the accuracy bonuses within the MIN function to prevent it effectively causing more than 100% chance to hit.