bstone icon indicating copy to clipboard operation
bstone copied to clipboard

Plasma Sphere Damage Tied to Frame Rate

Open sudobbq opened this issue 2 years ago • 2 comments

Problem: Plasma sphere attack rate is too fast at high frame rates (60+) Discovery: Playing the game as usual and getting hit by plasma spheres nearly felt like instant death from full health.

Build I'm using: 296ebe1636ccce60071aed7edf8ce072ee3f80c2.zip

Testing: DOSBox To compare against the original exe In DOS Box, I tested the damage per second done by the plasma sphere when lowering the CPU cycles for DOSBox.

  • First test was at 50,000 cycles which gives me 60fps. Damage was pretty fast.
  • Second test was at 10,000 cycles, bringing the frame rate down to about 20fps. The rate of the damage was slow enough for me to react without taking too much damage.

Bstone: I then tested the same thing in bstone and can confirm that it reproduces the same behavior that is true to the original DOS executable. I did this by capping the framerate of bstone.exe in the nvidia driver to 20fps. The experience was reproduced just like in the DOS version.

This bug is extremely similar to this bug report: https://github.com/bibendovsky/bstone/issues/398 However, Instead of the spheres doing too much damage, the damage is tied to the frame rate. Damage per second skyrockets when increasing from 20 to 60+

sudobbq avatar Jan 25 '24 00:01 sudobbq

I think the damage is correct. Dependency on frame rate is a different story but, obviously, requires a solution in the future.

Facts:

  • Game clock ticks at 70 Hz.
  • Sphere speed is 3096 units.
  • Minimum distance between the centers of the player and the sphere to inflict the damage is less than 65536 units or almost 1 tile.
  • Sphere does 4 points of damage per tick on non-novice difficulty level.
  • Sphere does 1 point of damage per tick on novice difficulty level.

Now let do the math. For simplicity we put the player and the sphere on imaginary line which parallel to X-axis or Y-axis. Here is a diagram: bstone_esphere_damage_diagram_20240225

Length of the damage distance: (65536 units - 1 unit) * 2 = 131070 units Time to travel the damage distance by the sphere: 131070 units / 3096 units per ticks = 42.34 tick ≈ 42 ticks Or in seconds: 42 ticks / 70 Hz = 0.6 sec Total inflicted damage on non-novice difficulty: 42 ticks * 4 points per tick = 168 points Total inflicted damage on novice difficulty: 42 ticks * 1 points per tick = 42 points

bibendovsky avatar Feb 24 '24 23:02 bibendovsky

Electro spheres can be a nuisance.

gamestales avatar May 27 '24 09:05 gamestales