It irks me how shots can pass through enemies without harming them when the framerate is low, most notoriously when attacking test chests and such.
To fix this, I propose making the local player’s shots check collisions about or 30 or 20 times per second regardless of actual framerate and also checking the collisions of other players’ shots every other frame.
I’m not so good at explaining how that would work, so I’ll illustrate it with a gif and some pseudocode.
This gif depicts a level 1 sorc shooting, shown at 10 frames per second. The gaps between the shots at the top could easily fit a test chest, if one were inbetween the shots it would not get hit at all. The transparent shots at the bottom show where the bullet could’ve been if the framerate had been 30 fps.
How it works right now: (as I understand)
Every frame:
For each shot visible from any source:
Set the position of the shot, relative to where it was shot, using the time since it was shot
Draw the shot
Check whether the shot collides with anything
How I want it to work:
Make unimportant shots collide this frame? YES
Every frame:
For each shot visible from any source:
If the shot is the player's responsibility:
Loop (amount of milliseconds since last frame, divided by ~33 ms)
Check collision at wherever the shot should be at this inbetween frame
Set the position of the shot etc.
Else if unimportant shots should collide this frame or the shot was emitted by a monster:
Set the position of the shot etc.
Check whether the shot collides with anything
For each shot visible from any source:
Draw the shot
If unimportant shots collide this frame, they don't next time, otherwise they do.
A possible downside of this would be seeing other players’ shots pass through walls, trees etc., but that’s not a concern because the server does not care what you think about others’ shots - it just looks ugly. Also a sanity check needs to be added for when the actual fps exceeds 30, otherwise this would make shots check collisions less often!
Hopefully I’ve made myself clear without sounding like the physical embodiment of autism bashing a keyboard. Thanks for reading and throw me an opinion!
Edit: I feel like I need to highlight that the fps increase is supposed to be from paying less attention to shots from other players. Thinking about it later, it seems that the best solution is to merge the massive amounts of damage indicators stationary enemies get, which is what makes the game lag in the first place. And that’d do nothing when you disable allied particles because there’s nothing to marginalize.