Skip to main content
GameDev.net gamedev.net
🔒 Locked

What is a lobby server?

Started by 215648 Oct 30, 2014 at 2:24 PM 12 replies 16.3k views
Original Post
215648
215648
I searched the internet but couldn't find a perfect answer. What are lobby servers? How are they different from general servers?

I want to start working on a small multiplayer fps game from scratch using C++ and DirectX 11. So, I want to start learning about networking (using winsock) for it. I cannot find any good resource for it. Isn't there a book or something similar which teaches networking (using winsock) to absolute network beginners?
StarMire
StarMire

Game servers actually run the game (assuming it isn't strictly peer to peer), lobby servers are just for showing what games are available to join, and letting people join them, from which the games begin when certain requirements have been met (like a certain number of people join). They may or may not allow more people to join in during the games.

Is your game going to be peer to peer, or will you have a game server running the game logic to prevent cheating and reduce latency between the peers?

rip-off
rip-off

The FAQ is a good place to start. I'd recommend getting comfortable with socket programming outside a game, for example, creating a simple chat server and client.

Then, I'd go back and start reading how other people have approached games like yours, for example the answer to Q12 in the forum FAQ.

You might want to build a proof of concept using the models you've chosen in a simple game first. Networking needs to be designed into the game from the start, so it really pays to get comfortable with the tools you'll need and familiar with the issues that choosing a particular networking model will cause. All networking models have trade-offs, from accuracy to time sensitivity, so you'll want to be aware of that as you design the rest of your game.

BrentMorris
BrentMorris

Don't forget about RakNet either! It was just open sourced with a BSD license after Oculus bought it. It takes care of a lot of networking stuff including packet priority/reliability, data-replication across client/server, events, and it all uses a nice "TCP-over-UDP" algorithm that keeps things fast. It can also communicate between 32/64 bit clients/servers with no issue. It's a pretty mature library.

It is only free on computers, however. It will cost you money if you want to branch into consoles.

Ravyne
Ravyne

You can think of them as simply being the server where matches are made. In console games, its pretty popular to automate the process of matchmaking so you don's see lobby servers too much. On the PC side of things, traditional lobbies are more popular. Typically you might have a chat-stream like IRC and a list of available servers that shows the game type, number of players, max players and score or remaining game time. You just pick the one you want to join.

throw table_exception("(? ???)? ? ???");
hplus0603
hplus0603
Additionally, a lobby server will typically act as a NAT punch-through introducer.
enum Bool { True, False, FileNotFound };
215648
215648

Thank you for all the replies. I appreciate that.

Now, my question is what is NAT and NAT punch-through? (I know it's Network Address Translation, but I don't really understand anything.)

What is difference between NAT and NAT punch-through? People often talk about port forwarding/NAT punch-through. From what I know, you need to port forward in order to play in peer-to-peer or if you're hosting a server. Can somebody please explain me what is NAT and how it is used?

rip-off
rip-off
Have you tried reading the FAQ or Googling?
215648
215648

Have you tried reading the FAQ or Googling?


Yes, but I don't understand it perfectly.
rip-off
rip-off

Which part is confusing you? I'm not sure any of us will be able to do better than the Internet at explaining the overall picture unless we have some specific context to aim at.

215648
215648

Which part is confusing you? I'm not sure any of us will be able to do better than the Internet at explaining the overall picture unless we have some specific context to aim at.

I searched a lot and finally came to this conclusion.

Suppose there are 3 computers in your home. One of your brother, one of your sister and one of your father. All of them use the same router to access the internet. Now, what NAT (Network Address Translation) does is that you and your family have the same public ip address if you all browse at the same time (but not the same private ip). If any of you use the internet from any computer, then the same (public) IP address is used to request a connection from the server. From the perspective of the server, only one computer is requesting the information. So, NAT provides some security layer. What NAT does is translate between private and public ip address.

What I mentioned above correct? How is NAT related to peer-peer/server hosting/gaming? What is port forwarding and how it can help to host servers or to play a match in peer-to-peer ?
hplus0603
hplus0603
The problem comes if you (or your father, or your microwave oven) want to host a game.
For some other player to join the game you are hosting, they need your public IP address.
Unfortunately, that address is the one of your router -- not of your computer.
Your router doesn't know what it means when someone tries to connect to "your game."
There are two solutions:

1) Use port forwarding, and make the way to configure hosted games aware of the user doing port forwarding. This requires network knowledge and administration for each user who wants to host a game, making hosting "hard."
2) Use NAT punch-through, using an external third party server to "see" what your external IP address is, and "see" which port the router happened to pick for your connection, and let the other player know about what it sees.

Option 2) is generally automatic with most good-quality routers/firewalls, unless they are locked down in "super paranoid" mode, in which case you can forget about hosting anything.
enum Bool { True, False, FileNotFound };
215648
215648

The problem comes if you (or your father, or your microwave oven) want to host a game.
For some other player to join the game you are hosting, they need your public IP address.
Unfortunately, that address is the one of your router -- not of your computer.
Your router doesn't know what it means when someone tries to connect to "your game."
There are two solutions:

1) Use port forwarding, and make the way to configure hosted games aware of the user doing port forwarding. This requires network knowledge and administration for each user who wants to host a game, making hosting "hard."
2) Use NAT punch-through, using an external third party server to "see" what your external IP address is, and "see" which port the router happened to pick for your connection, and let the other player know about what it sees.

Option 2) is generally automatic with most good-quality routers/firewalls, unless they are locked down in "super paranoid" mode, in which case you can forget about hosting anything.

Thanks for such a great explanation.

wodinoneeye
wodinoneeye

Lobby servers also do additional functions while doing their primary function of matching up players for games :

Game launch control (waiting players listed, info display, countdowns

Filter game type/flavor/difficulty - grouping players (some 'best fit' logic)

Private game request forwardings and coordination/management

Latency/consistancy test a players connection to group players (if there are enough of them) within similar 'response time' levels.

Are most games divided between consoles/PCs? (different lobby servers segregating them with possibly different interfaces)

coordinating Chat functionality outside of games

Awards/achievement/scores might be facilitated (data retrieval, update transactions) - if not done on a seperate server

--------------------------------------------[size="1"]Ratings are Opinion, not Fact

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.