Download

Networking: Shed some light on this for me

Ok so since I’ve built up an audience to my questions, I figured I wouldn’t stop the show just yet :wink:

Ok So This is in relation to networking, and client / server builds.

  1. From what I have been able to understand so far, When you build for a server, you must do this in source, and there is a very specific process to that. Great, that I get and makes sense. This gets uploaded to a dedicated server, and clients communicate to it via a specific IP. The server creates sessions that clients connect to on the fly via some programming. If I am wrong let me know.

  2. This is where it gets a bit convoluted in my head. I understand the difference between a “listen Server” and a “Client”, however, it throws me a curve when I think about building the game and having a copy and installing it on a computer. My questions:

  3. Does a Listen server have a separate “building” process like a dedicated server build needs?

  4. Can a Client become a listen server while playing the game?

I am pondering this because lets say the game client connects to the server plays a few matchmaking rounds, but then decided to host its own session with P2P . In my head, The client has to assume the role of “listen server” for a friend to remotely connect to them, but if the game they are playing was built as a “client” would it become a “listen server” once they create a session?

I have watched the unreal networking videos, and other networking videos, and the only thing I ever see is when they PIE and either select “Play as listen server” or “standalone/offline”. That is where the confusion really lies because, if a client can become a LISTEN SERVER then why doesn’t running as standalone work for connecting p2p while in PIE?

Thanks!

Hi Mindfields,

First off, not sure what you mean by client vs listen. There is no such thing as client, its either listen or dedicated.

As for the two models, a listen server means the player who makes a game is also the server. The visuals and networking are part of the same app. A dedicated server is built from source, yes, because it is stripped down to just server logic - no visuals, think minecraft servers.

In either model there is a host and then the connecting clients.

  1. Both models run the same logic for session hosting. The difference is how checks are made for the host. A dedicated server does not have a player because it is dedicated to processing network activity.

  2. Nor exactly. If a client wants to become a server they leave thier current session to host thier own. There can only be one game instance and that belongs to the host’s machine.

In your example, it reminds me of the demons souls model where you can “host” invasions. However all players are always connected to the game’s servers (unless hollow ofc). In this case, the client is telling the server to allow other clients to connect with them. In demons souls, only while human are you online to the game’s servers and this is the only time you see player ghosts running around and can be invaded. You are simply telling the dedicated server to allow others to connect to you when you go human - you become a “host”, but are not in charge of the server.

To your example, going p2p means its “unranked” because the server that would keep track of stats is non-existent. The host of this unranked server could use all the same game logic except for what the dedicated server holds. Getting back to demons souls, if a client hosts an unranked session, they will have thier character avatar with all thier equipment, but anyone connecting would not because a dedicated server would bring those stats over. In that sense, connecting clients would have to be defined because thier stats don’t come over (health, gear, gender, etc).

Using a listen server is much easier to test. You don’t need to recompile and launch a new dedicated server and then launch your client each time you want to test. Instead you make the build and launch a listen server to be one in the same. IIRC you can’t connect to dedicated servers from PIE since its about accessing the desired subsystem, though I’ve read Unreal has been working on thier own in the past (not sure how far akong that is, I use steam).

WOW! Thank you so much for the info! Ill need to read and reread to digest this. Thanks!

Testing with a dedicated server is built into the editor or you can run a dedicated server separately and have an editor client connect to it no problem.

Listen server may be cheaper (free) and easier to test but they have many drawbacks.

Since the host is also a client code becomes more complicated since you have to separate server and client logic. It is not difficult but it adds complexity.
Competitive real time games give the host a significant advantage of zero ping.
Anti-cheat is very difficult since all the logic is exposed to the end-user.
Establishing a connecting to a residential host has many challenges and the stability and performance will very a lot compared to a dedicated server running on hardware and software known ahead of time.
If the host leaves and the game needs to continue you need server migration which can be a headache to implement.