gschup / bevy_ggrs

Bevy plugin for the GGRS P2P rollback networking library.
Other
294 stars 41 forks source link

Adding players after p2p session already started #109

Closed pepebecker closed 4 months ago

pepebecker commented 4 months ago

Is it possible to add more players later after the p2p session already started?

I'm trying to build a Bevy game in which I can start alone (with out any peers) and then let other players join my game while I'm still playing (without restarting). This means that I won't know the total number of players when I setup the p2p session using SessionBuilder

gschup commented 4 months ago

Hi! Sorry, this is not possible. The player number is fixed and has to be known in advance.

pepebecker commented 4 months ago

Ohh, I see. Is this a common fact with all Rollback Networking implementations? Can you recommend any other options which would be ideal for my use case? Thank you.

gschup commented 4 months ago

This restriction is a design choice that GGPO made for their original use-case of enabling rollback netplay for short rounds of 1v1 emulated arcade fighting games. Since GGRS is basically a reimplementation of that library, it carries similar choices with it. It's not an all-purpose p2p networking library.

I am not terribly up-to-date with the current crate ecosystem, but I feel like you would like to have a centralized architecture, where players are clients to a central host/server that manages and distributes the game state. One of the players might double as the host. Then players can drop in and out easily. It's not impossible to solve such a scenario in a strict decentralized p2p setting, though.

I recommend joining the bevy discord and chatting in the #networking channel. Lots of experienced and friendly people there!