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

Allow users on a server to spectate games already in progress #196

Open
assertivist opened this issue Sep 2, 2021 · 2 comments
Open

Allow users on a server to spectate games already in progress #196

assertivist opened this issue Sep 2, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@assertivist
Copy link
Member

If a user connects to a server with a game is still active, we should allow for "Start Game" to bring the new user into the game as a spectator.

This feature is deceptively difficult, as Avara depends on the deterministic local state of each user's game. In order to pull this off, the game clients would need a way to sync not only the level and the active players, but also the inputs for every player for each frame that has been played until that point.

@assertivist assertivist added the enhancement New feature or request label Sep 2, 2021
@jmunkki
Copy link

jmunkki commented Nov 12, 2021

What you could do is keep a record of all the player actions and allow the player who joined to spectate to obtain a copy. Load the level and then replay those actions without rendering any graphics (just the game engine). This should bring you up to real time and then you can start replaying the game with graphics. Depending on how slow/fast this turns out to be, you might want to render the graphics here and there (the GPU is going to do the heavy lifting anyway).

You could also expand this by recording games this way and then allow replaying saved games (player POV or free flight camera).

Also, if you send the saved game to a (web) server and allow people to stream data to their client, they could spectate games live even when they are not connected to the game server.

@assertivist
Copy link
Member Author

keep a record of all the player actions and allow the player who joined to spectate to obtain a copy

This is outlined in #43, and with a serialization format this should be trivial, even P2P

(player POV or free flight camera)

It actually has live POV spectator mode already, it will be simple to adapt this for use during film playback. Camera flight controls would be awesome too, also useful for BSPViewer. I'll open a separate issue for that I think.

send the saved game to a (web) server

This idea has been in gestation for a long time, the most recent sketch of such a thing is here:
https://github.com/avaraline/depot
but that's more specific to tracking and distributing level sets.

It would be awfully neat to also store game statistics and player data, which requires some kind of link between a player in the game and a user on a website. It would probably be good to enumerate a user story for such an ID/verification process that isn't too invasive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

2 participants