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

VRChat freezing and crashing when too many people join at once #17

Closed
iffn opened this issue Jul 3, 2023 · 1 comment · Fixed by #18
Closed

VRChat freezing and crashing when too many people join at once #17

iffn opened this issue Jul 3, 2023 · 1 comment · Fixed by #18

Comments

@iffn
Copy link

iffn commented Jul 3, 2023

There seems to be an issue with QvPen that causes VRChat to freeze and crash within a few seconds of joining the world when too many people enter at once. For example, during the community meetup, 80 people can join a world at once.

I assume this is caused by these lines in the OnPlayerJoined function which calls a network event whenever a person joins the instance.

if (VRCPlayerApi.GetPlayerCount() > 1 && !Networking.IsOwner(gameObject))
SendCustomNetworkEvent(NetworkEventTarget.Owner, nameof(StartSync));

OnPlayerJoined not only gets called for the people already in the instance when someone joins, but the person joining gets a call for each player already in the instance plus one for themselves.

As far as I understand, when player 70 joins for example, the 68 non owners already in the world will send the event to the owner. Also, the person joining will send 70 events to the owner.

So 80 people joining at once should send Sum(n=2...80)[n-2 + n] = 6320 network events within a few seconds. This will likely break something.

The effect can be seen here:
https://www.youtube.com/watch?v=VRqSuXP7fxg&t=4830s

@ShingenPizza
Copy link
Contributor

Just wanted to add that the above calculations are understated.
The 6320 events are just the signals to the master to start syncing, which are likely followed by the same number of actual synchronizations.
Even more importantly, each of this pair of events happens per pen.

So with a regular set of 15 pens, when 80 people join, thats even 189600 networking events.

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

Successfully merging a pull request may close this issue.

2 participants