User:TheKnightOfOyashiro/Refractor 2 damage system

The Refractor 2-era Battlefield games -- Battlefield 1942 to Battlefield 2142 -- have a material-based damage system rather than a direct, weapon-based damage system. This means that damage is, basically, determined by the type of material a weapon spawns in its barrel rather than the weapon itself. This can make deciphering the intended damage of a weapon rather cryptic, as there are several factors in determining final damage.

Material damage
First, there is the  line within the   configuration file. That determines how much basic damage a material does. The weapon of interest, for example M14 rifle, has an  configuration file in its primary directory. This file usually has a  line which determines what kind of projectile it fires. Sometimes it's specific, and sometimes what is written is vague. The M14's is.

The objects/handweapons/common file directory has a configuration file named "projectile". This sets down which projectile type refers to which material type. In 's case, it is material 218. Going back to the  file, one can search for said material by simple pressing control+f and typing 218 in the dialogue box that pops up. There, it can be seen that material 218 is placed under the "rifle" heading, and has a  value of 5.

Modified damage
One issue with Battlefield Vietnam is the unaltered usage of Battlefield 1942 damage system files. This means that many of the weapons used in Battlefield Vietnam are either simply renamed Battlefield 1942 files -- or not even that far, with non-renamed files determining the modified damage. However, if one were to look in each damage system file, the material line is usually unique, so only one has material 218. In this case, it is under the file "sniper". Interestingly, that is the old No 4 sniper rifle file.

With that knowledge, it is possible to determine the modified damage based upon what the user is firing upon. There are three infantry groups. Those are materials 40, 41, and 42. For material 40, the damage multiplier is 10 (for the M14, 5*10 = 50, so it would be an instant kill). Material 41 has a multiplier of 3 (15 damage), and material 42 a multiplier of 2 (10 damage). This same concept can be applied to other portions of the game and other weapons, although more research would be in order to acquire the damage.

Other modifiers
The two other modifiers are damage dropoff over distance and the angle at which the projectile hits its target. The angle damage is determined by Cos(angle). So, zero degrees means the multiplier remains at 1, while a degree value of 30 changes it to 0.866. The modified damage is applied to that.

There is also the problem of damage dropoff over distance. Many weapons do not have damage dropoff in the early games, mostly just sub machineguns and pistols. There are some lines in the objects file of a weapon which state that the damage dropoff begins at a certain distance (for instance 20 meters) and ends at another (for instance 60 meters) The multiplier for the minimum damage possible is also there, but is only applied when the distance to target is its maximum, and usually the multiplier is 1 anyway, so there is no change.