SoftbearStudios / mk48

Mk48.io ship combat game
https://mk48.io
GNU Affero General Public License v3.0
314 stars 60 forks source link

Limbo State - lag compensation #178

Open mitm001 opened 2 years ago

mitm001 commented 2 years ago

I am zeroing in on a target with a level 8 sub just a few exp from sea wolf. This next kill puts me over the top. I slow down to try and stealth into range, I am almost on target, just about to open fire, next thing I know, the lag compensation routine you use sends me back to a position I was at 15 seconds or so ago. I start the approach again as the target is still within visual range. Edge closer, wham, I am looking at the login screen with no ships, no exp, back to level 1.

A more user friendly approach would be to move the ship into limbo, a state where you can do nothing and receive no input. Your last known position, exp, weapons state, etc and reason for limbo are logged and stored server side to a pflie. You are then disconnected from the game after a short time period, usually 5-15 minutes, if you do not log back in. Upon logging back in, you start right where you left off, otherwise back to the start if you do not log back in within the allowed time.

This requires a user pfile and accounts so something to consider later. You only use limbo in cases where the server would now disconnect them like happened to me above using the lag routine. If they lose connection on their own by X out or whatever, no limbo.

caibear commented 2 years ago

I'm worried that this could easily be used to escape enemies by temporarily disconnecting.

If they lose connection on their own by X out or whatever, no limbo.

AFAIK from the server's perspective it's impossible to know if they hit X or lost internet connection. Also even if the server could detect that, players could fake losing their connection by turning off their internet.

Currently the server waits ~6 seconds after you disconnect and then kills you.