|Topic was automatically imported from the old Question2Answer platform.
I want to create a multiplayer game where you can have a bunch of multiplayer game rooms, similar to games like Among Us where there is a list of rooms you can join or create.
I have done some research on this topic, and found that one way to go about this is changing the port number on each room. For instance, room 1 would be on port 6970 and room 2 on 6971, and both games could run parallel to each other.
Does an approach like this work for a single server file, and how do I allow players to see these rooms and join them? I assume I can keep one port aside just to show the server list, but then I would have to get the player to connect to a different port, and show available ports on the server-list.
I can’t seem to find any resources on how to achieve this goal, so I may be suggesting really bad ideas.
would each room be a different server and thus have different players playing on it, or are there supposed to be multiple rooms in one game server? (I haven’t played among us)
Millard | 2020-11-20 19:11
From what I know Among Us uses IDs or codes(as they are known by the players). The client sends and receives this IDs from the server. And the server creates a room for each ID. I think they use containers for each room, but that might be very complicated. You could try like creating the room as a class in an array and the server could loop through the array and send information to the clients, but as you may imagine that is very resource-heavy. I am not an expert in networking so you should take what I said as a general idea and search for more networking pages.
ra45 | 2020-11-21 09:30
They are like, multiple servers, but I doubt they have each room handled by a single, physical server. Most FPS games achieve this somehow, with different games happening at the same time.
bubbybumble | 2020-11-21 16:11
What do you mean containers for each room? I’ve never heard that term in networking. I’ll look into that though, and see if this is what I’m looking for.
bubbybumble | 2020-11-21 16:13
I’m just trying to understand, is there a more than one room in a game, and is it isolated until you move into another room?
Millard | 2020-11-21 16:20
What do you mean containers for each room?
I mean you create a program that represents one room(talking to clients, etc…), and for every room, you run another instance of it. You also need a program that manages them and assigns IDs or ports.
@Millard He’s talking about a multiplayer room (a lobby).
would each room be a different server and thus have different players playing on it
something like that
ra45 | 2020-11-21 19:03