The compute damage code

Computing actual damage statistics for weapons in WR is rather difficult since their firing mechanics is varied, and information provided by Pixonic is often incomplete. For this reason a Python code was created to allow (hopefully) accurate computation of the actual output damage of every weapon type.

**A full table with results for all the weapons updated to v. 4.0 is here**

## Weapon Types

From the point of view of damage calculation there are 4 types of weapons in WR:

1. Normal Weapons (Example: Taran): They shot a given number of projectiles (or charges, or missiles...) at a given rate per second, each projectile deals a fixed amount of damage if it hits, once the clip is expended, reloading takes a given time until the weapon is ready to fire again. The time during which a weapon is firing is called "burst", the burst plus the time the weapon takes to recharge is called "cycle". The damage during a burst divided by the seconds of duration of the burst is called Burst DPS (Damage-per-second), the same damage divided by the duration of the cycle is called Cycle DPS. Burst Damage, Burst and Cycle DPS are the three basic damage statistics of every weapon.
2. Reload-While-Firing (RWF) Weapons (Ex.: Orkan): These weapons begin reloading as soon as the first projectile is fired, generally at a much lower rate that they fire, so they eventually empty the clip, and begin reloading. This has a few effects that need to be accounted for. First, the burst usually fires more projectiles than are in a fully charged clip, because some more are reloaded before the burst finishes. This makes the burst longer and more powerful, altering also the cycle length. All this is included in the calculation. Another effect is that one does not need to wait for a full recharge to fire again. One can even keep firing new projectiles at the speed at which they reload. These cases are clearly not listed in the tables, but can be derived easily from them (e.g. when firing at the reload rate the damage per second is equal to the cycle DPS).
3. Accelerated State Weapons (AS) (Ex. Punisher): These weapons (currently all the machine guns) fire at their base fire rate for a time (3s usually) then accelerate (usually by 1.5) until they empty the clip or fire is interrupted. This alter the burst length, hence the cycle length, but not the burst damage. The tables for these weapons are computed assuming a full burst is fired. If one fires shorter bursts, the low-fire-rate time is repeated every time, lowering the DPS. Since the code calculates the number of bullets fired at low speed, the result of shorter bursts can be derived by hand, though.
4. Distance-dependent (DD) weapons (ex. Scourge): these weapons deal more damage the closer you are to the target, in a way that is published and dependent only on distance. For these weapons, damage is always computed at a given distance, but once the distance is fixed they behave like normal weapons. If you move closer or farther while firing, of course, results will vary.

## Aspects not accounted for

* Bullet dispersal: All the bullet / pellet weapons in the game do not fire with absolute accuracy, but their bullet disperse with distance, with the effect that part of them will not hit when the target is far away. Although this makes their damage dependent on distance, they are not considered DD weapons for a few reasons. First, Pixonic does not publish the dispersal function, so it is not possible to account for it (it would be possible to test for it and derive an approximation, but it would be rather time consuming). Second, the result of bullet dispersion depends on the target size: an Ancile bubble will collect much more damage than a Stalker at any given distance. Even knowing the dispersal function, one should then know the cross section of the target. Another difference with respect to DD weapons is that with bullet dispersal, if you are close enough all bullets will hit, and getting closer will not vary the damage. For DD weapons, the damage keeps increasing the more you move closer. An extreme case of bullet dispersal are the Noricum and Zenit, where the computation of the damage from a full salvo is rather irrealistic.
* Splash damage of rocket weapons: since, again, it is not published and would depend on the distance between the target and the explosion point, and the target size. All computations assume a direct hit.
* Ricochet effect (e.g. Shocktrain): all calculations are for the first hit only.
* Double damage to shield and bot (Ember): it appears that the Ember deals damage both to the bot and to its physical shield, if present, in the sense that they both receive the full damage the Ember deals. This is not the case of energy weapons, that ignore the energy shields but do not deplete them, or rockets, that ignore physical shields but do not damage them. The ember also ignores (e.g. does not deplete) energy shields. Calculations for Ember apply to the bot Hp OR to the physical shield HP.

## The compute\_damage code

The code is written in Python 3.6, but should run with Python 2.7 too. For non-programmers the easiest way to run it is:

- Open a python console in the folder where you saved the code. You should have called the file 'computedamage.py'.
- type:

```
import computedamage as wr

```

- type:

```
wr.compute_damage('orkan')

```

you should get a table similar to this:

## orkan      version  3.8
Input stats:
Base rate of fire   8.30
Shots in the clip   32
Base burst time  3.9
Base reload time 23.0
Base cycle time 26.9
Weapon reloads while firing:
Actual shots in the burst  38
Actual burst time  4.6
Actual reload time 22.7
## Actual cycle time 27.3
L   dmg   BDMG    BDPS    CDPS
 1     0      0     0.0     0.0
 2     0      0     0.0     0.0
 3     0      0     0.0     0.0
 4     0      0     0.0     0.0
 5   970  36860  7999.9  1349.6
 6  1070  40660  8824.6  1488.7
 7  1180  44840  9731.8  1641.7
 8  1300  49400 10721.5  1808.7
 9  1430  54340 11793.6  1989.6
10  1570  59660 12948.2  2184.3
11  1720  65360 14185.3  2393.0
## 12  1890  71820 15587.4  2629.6

```

The table lists the game version at which the statistics are updated, the input values, and the actual values after special mechanics are accounted for. Then follows the table itself, listing level, damage (per bullet), burst damage, burst and cycle damage per second.

Additional options are present: some weapon tables have comments associated to them:

```
wr.compute_damage('ember',comm=1)

## ember      version  3.8
Input stats:
Base rate of fire  30.00
Shots in the clip  300
Base burst time 10.0
Base reload time  5.0
## Base cycle time 15.0
L   dmg   BDMG    BDPS    CDPS
 1   170  51000  5100.0  3400.0
...
## 12   490 147000 14700.0  9800.0

The damage is per SECOND in the wiki table, so since the Ember
consumes 30 l/s and has 300l of fuel, I divided dmg per second
by 30 to get the per-liter damage. Values from Pixonic higher,
wiki has lower and is LIKELY correct, so I use Wiki

```

Distance-dependent weapons allow to compute for different distances:

wr.compute\_damage('scourge',at\_distance=200)

## scourge    version  3.8
Input stats:
Base rate of fire  10.00
Shots in the clip  100
Base burst time 10.0
Base reload time  5.0
Base cycle time 15.0
Weapon has distance dependence, L12 damage    504,   126 at distance  400, 600
For a variation of  -189.0HP per 100m
## Damage computed for distance  200
L   dmg   BDMG    BDPS    CDPS
 1   313  31325  3132.5  2088.3
 2   344  34475  3447.5  2298.3
...
## 12   882  88200  8820.0  5880.0

```

One can forecast the effect of a buff / nerf to damage. For instance, if the Molot were buffed by 10% of the damage:

```
wr.compute_damage('molot',multip=1.1)

A damage modificator has been applied: 1.1

## molot      version  3.8
Input stats:
Base rate of fire   4.20
Shots in the clip   70
Base burst time 16.7
Base reload time 10.0
Base cycle time 26.7
Weapon accelerates 1.5 times after 3 seconds
Shots fired before acceleration  12
Time after acceleration 9.11
Actual burst time 12.1
## Actual cycle time 22.1
L   dmg   BDMG    BDPS    CDPS
 1   278  19481  1608.5   881.1
...