bibendovsky / bstone

Unofficial source port for Blake Stone series
Other
302 stars 33 forks source link

Plasma Sphere Damage Tied to Frame Rate #473

Open sudobbq opened 9 months ago

sudobbq commented 9 months ago

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.

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+

bibendovsky commented 8 months ago

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

Facts:

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

gamestales commented 5 months ago

Electro spheres can be a nuisance.