I have been writing a browser-based multiplayer game that I'm running off a home-built socket server using socketIO and threejs. In the game there is a finite number of rocks that players can pick up and build into 'cairns' (they're a kind of trail-marker), the players can see each other moving around in the world. The idea is that the positions of the rocks persists until somebody else moves them, so that new players see the markers left by past players.
This is all working and stuff, but I have hit a problem. What happens if loads of people were to enter the world at once? The socket server can probably deal with quite a few players, but the client browser will definitely hit a limit pretty fast where it struggles to render and update a lot of avatars in the world.
After a bit of research, seems the most obvious solution would be to create 'rooms', so that when too many players fill one instance of the world the server just makes another instance and starts putting players in there. But in my game this creates a problem, each room is sort of a ‘parallel universe’, so when it comes to the rock positions how do you merge them back so that the rocks are in the right place for people in world A and world B? I don't think you can.
The only other idea I had was just to make a queue so that if the world is full, new players just have to wait. But that's a pretty discouraging solution for players. My question is what other ways are there of dealing with player numbers in an open-world of which there can only be one instance?
There is a possibility that this is a game-design problem and I should've thought about the implications of the rock mechanic before I started coding it…oops