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

[Network] Server rewind #17

Open
fairhat opened this issue Jul 18, 2020 · 1 comment
Open

[Network] Server rewind #17

fairhat opened this issue Jul 18, 2020 · 1 comment

Comments

@fairhat
Copy link
Contributor

fairhat commented Jul 18, 2020

This is more of a question and possibly feature request:

In FPS type games it's common that the Server goes back in time (for a maximum of N ticks) to check if someone's bullet hit another player (if a client says he hit someone but the server did not see it on his tick, due to network delay).

Most FPS games favor the shooter (which means you can run around the corner and get hit like a second afterwards because the player shooting you had a latency of ~500ms), while others favor the one running away.

Is it currently possible to implement something like this with this library?
I know that Godot does not allow rewinding a scene and doing so would cause a lot of other problems (all clients would rewind their states too during that tick)

However it'd be already "good enough" to get history data for that action:

  • Where did the shooter aim at ? (at the tick we acknowledged the shot)
  • Where was the player that got shot? (at the (tick + travel time of the bullet))

If i was able to know this i could reconstruct an invisible bullet + hitbox of the player and use smth like raycasting to check it.

Edit: Assuming i have Aim and position of all players stored in previous state snapshots(!)

@Kehom
Copy link
Owner

Kehom commented Jul 18, 2020

Well, this is rather difficult to be (properly) done purely from GDScript. I'm not sure if GNative would be any better. My original intention was to perform the entire correction and re-simulation automatically, but that required to indeed "warp back in time", which is not exactly easily done, much less in a generic way.
What I can do, however, is provide means to retrieve a specific snapshot, get data from it then the server code could act on that information.

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

No branches or pull requests

2 participants