Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma Sphere Damage Tied to Frame Rate #473

Open
sudobbq opened this issue Jan 25, 2024 · 2 comments
Open

Plasma Sphere Damage Tied to Frame Rate #473

sudobbq opened this issue Jan 25, 2024 · 2 comments
Labels

Comments

@sudobbq
Copy link

sudobbq commented Jan 25, 2024

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: #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
Copy link
Owner

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

@gamestales
Copy link
Contributor

Electro spheres can be a nuisance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants