ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
644 stars 74 forks source link

[TF2] Persian Persuader Demos cannot earn ammo for their primary weapon on Level 1 & Level 2 dispencers. #4880

Open slender100 opened 1 year ago

slender100 commented 1 year ago

https://user-images.githubusercontent.com/109390636/229248785-8079e44d-1882-48b5-8124-ada89b6608c1.mp4

The video speaks for itself.

Despite the fact that both primary & secondary weapons get the same ammo reduction, ammo cannot be earned for a primary weapon from dispensers unless the dispenser is level 3.

KalleKokosnott commented 1 year ago

I believe the reason why this is happening to the primary weapon, as shown in the video, is because of the game rounding down to a whole number, regarding the amount of ammo received from a Dispenser. Keep in mind that a player receives 20%/30%/40% ammo, depending on the Dispenser's level. The primary weapon's max ammo capacity is so small that the only Dispenser level that can give ammo is the third level Dispenser.

If I'm not mistaken, the math for this is the max ammo, multiplied by the percentage of ammo received from a dispenser (20%, 30% or 40%), then rounded down to a whole number.

slender100 commented 1 year ago

I believe the reason why this is happening to the primary weapon, as shown in the video, is because of the game rounding down to a whole number, regarding the amount of ammo received from a Dispenser. Keep in mind that a player receives 20%/30%/40% ammo, depending on the Dispenser's level. The primary weapon's max ammo capacity is so small that the only Dispenser level that can give ammo is the third level Dispenser.

If I'm not mistaken, the math for this is the max ammo, multiplied by the percentage of ammo received from a dispenser (20%, 30% or 40%), then rounded down to a whole number.

even then, I'm still not sure why I'm still earning ammo for the stickybomb launcher, unless the stickybomb launcher has just enough capacitance to earn ammo from level 1 & 2 dispensers.

KalleKokosnott commented 1 year ago

even then, I'm still not sure why I'm still earning ammo for the stickybomb launcher, unless the stickybomb launcher has just enough capacitance to earn ammo from level 1 & 2 dispensers.

The Stickybomb Launcher indeed has enough max ammo to receive at least 1 ammo from Dispensers with the Persian Persuader equipped. The Stickybomb Launcher has 5 max ammo with the Persian Persuader equipped. Level 1 Dispenser: 5 x 0.2 (20%) = 1 Level 2 Dispenser: 5 x 0.3 (30%) = 1.5 (rounded down to 1) Level 3 Dispenser: 5 x 0.4 (40%) = 2 This means that a level 3 Dispenser gives the player 2 secondary ammo, compared to only 1 secondary ammo with both level 1 Dispenser and level 2 Dispenser.

Back to the issue, about the reduced primary ammo, it is a frustration to only receive ammo from a level 3 Dispenser, especially during a heated battle. All primary grenade launchers (Stock Grenade Launcher, Loch-N-Load, Iron Bomber, Loose Cannon) have reduced max ammo of 3. Level 1 Dispenser: 3 x 0.2 (20%) = 0.6 (rounded down to 0) Level 2 Dispenser: 3 x 0.3 (30%) = 0.9 (rounded down to 0) Level 3 Dispenser: 3 x 0.4 (40%) = 1.2 (rounded down to 1)

slender100 commented 1 year ago

Replying to https://github.com/ValveSoftware/Source-1-Games/issues/4880#issuecomment-1492787426

I understand now. Will wait to see if a fix is implemented to address this issue.