When newer monitors came out and as hardware improved-
When newer monitors came out and as hardware improved-
== HOW IT MIGHT'VE SLIPPED THROUGH ==
Easy, fixed development hardware, this game was made originally for the PS3/XENON hardware (Xbox 360), which ran the game at around 30fps~, dipped lower but still, target fps was 30.
== HOW IT MIGHT'VE SLIPPED THROUGH ==
Easy, fixed development hardware, this game was made originally for the PS3/XENON hardware (Xbox 360), which ran the game at around 30fps~, dipped lower but still, target fps was 30.
Over the course of 140 frames in one second, this will approx happen 42.8% of the time (140 * 0.428 ≈ 60).
The total ammo depleted in that second will be ~60 units-
Over the course of 140 frames in one second, this will approx happen 42.8% of the time (140 * 0.428 ≈ 60).
The total ammo depleted in that second will be ~60 units-
The integer part (0) is taken as the base amount to deplete.
The fractional part of (0.428) is used as the chance
A random number is generated-
The integer part (0) is taken as the base amount to deplete.
The fractional part of (0.428) is used as the chance
A random number is generated-
Yep, it's fixed! We can pour the gas can at 60FPS perfectly fine, and when we go-to 240FPS (way higher than 60FPS) we pour the same amount of fuel as before!
Yep, it's fixed! We can pour the gas can at 60FPS perfectly fine, and when we go-to 240FPS (way higher than 60FPS) we pour the same amount of fuel as before!
To solve this, the logic had to be replaced entirely lmao, it has to handle fractional depletion values that occur at high frame rates. The final solution was to use a probably-based approach to ensure the avg. depletion rate is always consistent.
To solve this, the logic had to be replaced entirely lmao, it has to handle fractional depletion values that occur at high frame rates. The final solution was to use a probably-based approach to ensure the avg. depletion rate is always consistent.
const float fCurrentTimeStep = MAX( fwTimer::GetTimeStep(), fBaseTimeStepSeconds );
Introduces a bug.
At 60FPS or below, it works correctly, fwTimer::GetTimeStep() will be 1.0/60.0 or greater, so the MAX function chooses the correct delta time.
const float fCurrentTimeStep = MAX( fwTimer::GetTimeStep(), fBaseTimeStepSeconds );
Introduces a bug.
At 60FPS or below, it works correctly, fwTimer::GetTimeStep() will be 1.0/60.0 or greater, so the MAX function chooses the correct delta time.
== ORIGINAL FLAWED CODE ==
Formatted to fit, not what it looks like in og.
Whoever was developing this correctly identified the need for the baseline fBaseTimeStepSeconds and to use the actual time per frame fwTimer::GetTimeStep()
== ORIGINAL FLAWED CODE ==
Formatted to fit, not what it looks like in og.
Whoever was developing this correctly identified the need for the baseline fBaseTimeStepSeconds and to use the actual time per frame fwTimer::GetTimeStep()
The primary job of it is to handle this continuous action and most importantly deplete the weapon's ammo over time as the player holds the fire button.
The goal of the depletion is to happen at a constant rate of course.
The primary job of it is to handle this continuous action and most importantly deplete the weapon's ammo over time as the player holds the fire button.
The goal of the depletion is to happen at a constant rate of course.
This methods determines how a weapon behaves when used. Other weapons use FireDelayedHit or FireProjectile, for this, it uses FireVolumetric, it's a special case designed for weapons-
This methods determines how a weapon behaves when used. Other weapons use FireDelayedHit or FireProjectile, for this, it uses FireVolumetric, it's a special case designed for weapons-
== ABOUT THE CODE ==
== ABOUT THE CODE ==
Video of issue attached, 1st is at 60, 2nd is at 240 fps (my monitor refresh rate)
Video of issue attached, 1st is at 60, 2nd is at 240 fps (my monitor refresh rate)