Overheat mechanics in Advanced Warfare
Feb 13, 2015 1:14:09 GMT -5
asasa, bmac39, and 7 more like this
Post by probaddie on Feb 13, 2015 1:14:09 GMT -5
Before I start, I owe a debt of gratitude to Marvel4, who both extracted the numbers that govern the overheat mechanic and tested the various theories I derived - including countless many that were left on the cutting table.
Overheat affects three specific energy weapons in the game: the EM1, AE4 and EPM3. Instead of a finite reserve of ammunition that must be replenished upon depletion, these weapons provide the user with an infinite reserve of ammunition; to balance this, these weapons can only be shot for a limited time before they accumulate too much heat from firing. Once a prescribed amount of heat is accumulated, the user cannot fire the weapon until it dissipates the accumulated heat. The user can also manage their heat accumulation by manually "reloading" the weapon, which causes the weapon's heat to dissipate more quickly.
How is this heat represented in the game, then? First, note that the "bars" that are presented in-game are not meaningful: they are a stylized representation of the weapon's heat, and the heating mechanics do not recognize these as actual quanta. Instead, heat is implemented as a continuous quantity, ranging from zero to one. Zero, of course, represents no accumulated heat, and one represents the maximum heat capacity of the weapon. This is true for all weapons, even as it appears that some weapons have more "heat capacity" than others. To differentiate the behaviour of each gun, there are four variables that pertain to overheat. (Because we have no way of knowing exactly what they're called in the game's code, I'll be providing my own names based on how they relate to overheating.) They are overheatUpRate, overheatDownRate, overheatDownRateFast, and overheatPenalty.
overheatUpRate determines how much heat is added to your accumulated total when firing the gun. It is expressed in normalized units of heat per second. For example, the AE4 has an overheatUpRate of 0.4 - this was buffed from 0.5 in a recent update - meaning that, if the gun were fired continuously, it would gain 0.4 heat every second; therefore, it would overheat in exactly 2.5s, the time it would take for the weapon's accumulated heat to reach 1. (Of course, it does not fire continuously; the complications that arise from the discrete nature of firing mechanics in-game will be explained later.) Similarly, the EM1 has a overheatUpRate of 0.25, meaning that it takes 4.0s to overheat.
overheatDownRate determines the rate at which the gun loses heat when not firing the gun. (What "not firing the gun" specifically means will be explained later.) This parameter is also expressed in normalized units of heat per second. As an example, the EM1 has a overheatDownRate of 0.3, meaning it takes the weapon approximately 3.33s to dissipate all of its heat after a full overheat. overheatDownRateFast governs the rate of heat loss when the user invokes the "reload" mechanic for these weapons - the requisite reload the player avatar performs during a complete overheat does not qualify. In all cases, this rate is higher than the overheatDownRate number for the same weapon. The EM1 has a overheatDownRateFast of 0.6, so when "reloading" this weapon dissipates its heat twice a quickly as it otherwise would if the user merely allowed the heat to dissipate normally.
overheatPenalty is simply the amount of time the user must wait after a complete overheat before they are able to aim down the sights of their weapon again, measured in seconds. This is to prevent a confusing situation where the user attempts to ADS a weapon that is not properly aligned because of the "reload" animation.
Were it the case that the game presented itself in a continuous manner, this exposition would be done. However, the game and its all mechanics are frame-bound, and the discrete nature of the game must be taken into account. For example, it was stated that the overheatUpRate of the EPM3 is 2.5, indicating that the weapon would overheat in 0.4s (without any cooling). In theory, this would mean that the weapon would, if fired at its maximum firerate of 1200 RPM (0.05s fireTime), expel 8 rounds before succumbing to overheat. One might think that, if any deviation from this theory is possible, the weapon should be able to fire more rounds before reaching the overheat limit, as the time between shots might allow the weapon to cool enough allow a 9th shot. However, the exact opposite is true: it is possible for the EPM3 to overheat on only 7 shots.
There are two primary reasons for this. First, the game does not consider the weapon to be "not firing" for the purposes of overheat until a time equal to fireTime has passed since the weapon was last fired. This is why the AE4, even though it fires in discrete quanta, does not recover any heat while the user is holding the fire button, because by the time fireTime has expired from the last shot another shot is being fired. In the case of the EPM3, firing at its maximum firerate of 1200RPM prevents the weapon from ever dissipating its heat, and therefore no more than 8 shots can be discharged before overheating.
Second, the game calculates heat by adding to the accumulated total over a length of time equal to fireTime (rounded up to the nearest frame). This can cause strange behaviour with a gun whose fireTime is (mathematically) an exact multiple of the time between frames, as the game's engine represents the time between frames as an integer (milliseconds) (Source: github.com/id-Software/Quake-III-Arena ). The EPM3 at maximum output discharges a shot every 50ms, and the time between frames is at least 16ms (60 frames per second). Now, if the game runs perfectly and the time between frames is exactly 16 ms constantly, then over three frames only 48ms will have passed, less than the required 50ms. Therefore, the pulse of heat will be calculated over 4 frames instead of 3, resulting in 4 * (2.5 * 0.016s) = 0.16 units of heat added to the accumulated total. Should this happen often enough, the total heat will reach its maximum in only 7 shots (6 * 0.16 = 0.96 < 1, 7 * 0.16 = 1.12 > 1). In the case where the time between frames is delayed by a single millisecond (17ms total), the game will only calculate the pulse of heat over 3 frames - since 3 * 17ms = 51ms, which is longer than the EPM3's firetime - and the weapon receives a pulse of 3 * (2.5 * 0.017s) = 0.1275 units of heat. Therefore, the EPM3 will reach its total heat capacity in 8 shots (7 * 0.1275 = 0.8925 < 1, 8 * 0.1275 = 1.02 > 1).
Similar phenomena are possible with the other two energy weapons as well, such that they output slightly fewer "shots" than the theoretical heat rates would suggest.
Edit: Changed the variable names to match known overheat variables from Modern Warfare 2 due to a suggestion by Marvel4.
Overheat affects three specific energy weapons in the game: the EM1, AE4 and EPM3. Instead of a finite reserve of ammunition that must be replenished upon depletion, these weapons provide the user with an infinite reserve of ammunition; to balance this, these weapons can only be shot for a limited time before they accumulate too much heat from firing. Once a prescribed amount of heat is accumulated, the user cannot fire the weapon until it dissipates the accumulated heat. The user can also manage their heat accumulation by manually "reloading" the weapon, which causes the weapon's heat to dissipate more quickly.
How is this heat represented in the game, then? First, note that the "bars" that are presented in-game are not meaningful: they are a stylized representation of the weapon's heat, and the heating mechanics do not recognize these as actual quanta. Instead, heat is implemented as a continuous quantity, ranging from zero to one. Zero, of course, represents no accumulated heat, and one represents the maximum heat capacity of the weapon. This is true for all weapons, even as it appears that some weapons have more "heat capacity" than others. To differentiate the behaviour of each gun, there are four variables that pertain to overheat. (Because we have no way of knowing exactly what they're called in the game's code, I'll be providing my own names based on how they relate to overheating.) They are overheatUpRate, overheatDownRate, overheatDownRateFast, and overheatPenalty.
overheatUpRate determines how much heat is added to your accumulated total when firing the gun. It is expressed in normalized units of heat per second. For example, the AE4 has an overheatUpRate of 0.4 - this was buffed from 0.5 in a recent update - meaning that, if the gun were fired continuously, it would gain 0.4 heat every second; therefore, it would overheat in exactly 2.5s, the time it would take for the weapon's accumulated heat to reach 1. (Of course, it does not fire continuously; the complications that arise from the discrete nature of firing mechanics in-game will be explained later.) Similarly, the EM1 has a overheatUpRate of 0.25, meaning that it takes 4.0s to overheat.
overheatDownRate determines the rate at which the gun loses heat when not firing the gun. (What "not firing the gun" specifically means will be explained later.) This parameter is also expressed in normalized units of heat per second. As an example, the EM1 has a overheatDownRate of 0.3, meaning it takes the weapon approximately 3.33s to dissipate all of its heat after a full overheat. overheatDownRateFast governs the rate of heat loss when the user invokes the "reload" mechanic for these weapons - the requisite reload the player avatar performs during a complete overheat does not qualify. In all cases, this rate is higher than the overheatDownRate number for the same weapon. The EM1 has a overheatDownRateFast of 0.6, so when "reloading" this weapon dissipates its heat twice a quickly as it otherwise would if the user merely allowed the heat to dissipate normally.
overheatPenalty is simply the amount of time the user must wait after a complete overheat before they are able to aim down the sights of their weapon again, measured in seconds. This is to prevent a confusing situation where the user attempts to ADS a weapon that is not properly aligned because of the "reload" animation.
Were it the case that the game presented itself in a continuous manner, this exposition would be done. However, the game and its all mechanics are frame-bound, and the discrete nature of the game must be taken into account. For example, it was stated that the overheatUpRate of the EPM3 is 2.5, indicating that the weapon would overheat in 0.4s (without any cooling). In theory, this would mean that the weapon would, if fired at its maximum firerate of 1200 RPM (0.05s fireTime), expel 8 rounds before succumbing to overheat. One might think that, if any deviation from this theory is possible, the weapon should be able to fire more rounds before reaching the overheat limit, as the time between shots might allow the weapon to cool enough allow a 9th shot. However, the exact opposite is true: it is possible for the EPM3 to overheat on only 7 shots.
There are two primary reasons for this. First, the game does not consider the weapon to be "not firing" for the purposes of overheat until a time equal to fireTime has passed since the weapon was last fired. This is why the AE4, even though it fires in discrete quanta, does not recover any heat while the user is holding the fire button, because by the time fireTime has expired from the last shot another shot is being fired. In the case of the EPM3, firing at its maximum firerate of 1200RPM prevents the weapon from ever dissipating its heat, and therefore no more than 8 shots can be discharged before overheating.
Second, the game calculates heat by adding to the accumulated total over a length of time equal to fireTime (rounded up to the nearest frame). This can cause strange behaviour with a gun whose fireTime is (mathematically) an exact multiple of the time between frames, as the game's engine represents the time between frames as an integer (milliseconds) (Source: github.com/id-Software/Quake-III-Arena ). The EPM3 at maximum output discharges a shot every 50ms, and the time between frames is at least 16ms (60 frames per second). Now, if the game runs perfectly and the time between frames is exactly 16 ms constantly, then over three frames only 48ms will have passed, less than the required 50ms. Therefore, the pulse of heat will be calculated over 4 frames instead of 3, resulting in 4 * (2.5 * 0.016s) = 0.16 units of heat added to the accumulated total. Should this happen often enough, the total heat will reach its maximum in only 7 shots (6 * 0.16 = 0.96 < 1, 7 * 0.16 = 1.12 > 1). In the case where the time between frames is delayed by a single millisecond (17ms total), the game will only calculate the pulse of heat over 3 frames - since 3 * 17ms = 51ms, which is longer than the EPM3's firetime - and the weapon receives a pulse of 3 * (2.5 * 0.017s) = 0.1275 units of heat. Therefore, the EPM3 will reach its total heat capacity in 8 shots (7 * 0.1275 = 0.8925 < 1, 8 * 0.1275 = 1.02 > 1).
Similar phenomena are possible with the other two energy weapons as well, such that they output slightly fewer "shots" than the theoretical heat rates would suggest.
Edit: Changed the variable names to match known overheat variables from Modern Warfare 2 due to a suggestion by Marvel4.