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

Support >2 Players #1

Open
rameshvarun opened this issue Mar 5, 2019 · 5 comments
Open

Support >2 Players #1

rameshvarun opened this issue Mar 5, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@rameshvarun
Copy link
Owner

No description provided.

@mmazzarolo
Copy link

@rameshvarun I'm curious, any idea how this would work?

@rameshvarun
Copy link
Owner Author

The first step is to support games with a fixed player count, and where players can't join or leave after the game starts. For example, a game will have something like SimpleGame.playerCount = 3.

The required changes can be split into three areas:

  1. Netcode: The core synchronization algorithms should already support >2 players, but might need extra debugging.
  2. Transport: Right now, one player is the host and the other player is a client. In >2 players there will be one host with multiple clients. Each client connects to the host, and messages between clients are relayed through the host (this simplifies a lot of things).
  3. Lobby: Right now the game starts as soon as a client joins. This needs to be updated so that the game waits for the playerCount to be satisfied. Also needs UI to show people connecting / leaving.

The next step after this will be to allow games with a variable count, so a game will have something like SimpleGame.playerCount = { min: 2, max: 4}. We maintain the assumption that players don't join or leave. The only additional work required here is at the Lobby layer. Look to existing games like Halo to figure out UI.

The next step after this will be joinable / leavable games, but this is more complicated and requires additional changes, so I will leave that for another day.

@mmazzarolo
Copy link

Understood, thanks for sharing.
Mad props for this library, by the way. Still playing around with it, but both the code and the way it has been architected are clear and well written.

@rameshvarun rameshvarun added the enhancement New feature or request label Apr 10, 2021
@edge-rps
Copy link

edge-rps commented Jul 4, 2023

Bump:

WebRTC One To Many Broadcast (SFU): https://www.youtube.com/watch?v=GMbdEnK8h3U
4 Player Webrtc tank game: https://github.com/maxscharwath/toonks-game

@mmazzarolo
Copy link

@edge-rps I don't think your links are specifically related to rollback netcode, right? 👀

@rameshvarun rameshvarun mentioned this issue Aug 21, 2023
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
None yet
Development

No branches or pull requests

3 participants