retrowars/retrowars

Server: add an option to limit handed out games

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

I'm always frustrated when I and my friends get games which we don't like while playing multiplayer

Describe the solution you'd like
A clear and concise description of what you want to happen.

Add an environment variable to the server that can limit the games that it hands out

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Exiting and rejoining the lobby until we get the games we want

Additional context
Add any other context or screenshots about the feature request here.

I'd like to make a Tetris-only multiplayer server (best game imo)
More server configuration documentation would also me much appreciated. :)

In the meantime, what can I edit in the code (and recompile afterwards) to make it only choose Tetris every single time?

Thanks for this recommendation, I completely agree we should be able to have server operators specify what games they want to play. I will add this as it shouldn't be too hard.

However, while you are here, can I counter propose something which may make this more ergonomic without having to spin up your own server (though that should certainly be an option). Right now, a server consists of a number of "Rooms". You don't really get exposed to this, it is just an implementation detail. Furthermore, it doesn't really get used, because not many people play this game!

Rooms are controlled via the env vars MAX_ROOMS (defaults to 10) and ROOM_SIZE (defaults to 4). If more than 4 people join a server, a new room is created until MAX_ROOMS is reached. New players are assigned to the first non-full room. When nobody is in a room, the room is removed from the server.

But it was in my original plans (and still in the code - though unused) to be able to let people create their own private rooms on a public server, then share invites to that room to their friends.

It will require a lot more work, because it needs a UI for adding a new room, selecting which games to enable. However I think it will be better for most players as you don't need to spin up a separate server just to customise rules.

Thoughts on whether to prioritise one or the other approach?

Well, I think the first approach is by far easier and faster to implement that the second, so it would be cool to get that out and maybe push the private rooms for later.
Still certainly a cool idea!

Just wanna add, that for this to make more sense #137 has to be considered, as I'm not even sure if a Tetris-only server would be accepted as a public server

This has now been implemented, via the --supported-games=tetris,asteroids argument or the SUPPORTED_GAMES=tetris,asteroids env var when starting a server. Will now begin work on #137.

However, if you are that way inclined, I'd be happy to accept public servers that only support a limited subset of games via PRs to the retrowars/retrowars-servers project. Only thing is we don't yet support server descriptions, so it would be good if the hostname hinted at the games available (e.g. tetris.my-server.com).

I should note that this does not require any update to the client to work. Old clients can connect to a server with a limited subset of games just fine.