Netmode: Play As Client while testing game?

In order to make sure everything is replicating properly should I be using the ‘Play As Client’ net mode?

If you play multiple copies of the game (settable in start-game settings,) only one of them will be server. The others will be started as their own processes, as clients, anyway, which is good testing.

Testing only as client only makes sense if you have a more persistent server somewhere else, such as for an existing online game, or a MMO, or something like that.

If you play multiple copies of the game (settable in start-game settings,) only one of them will be server. The others will be started as their own processes, as clients, anyway, which is good testing.

Are you referring to “Play as Listen Server” ?

Testing only as client only makes sense if you have a more persistent server somewhere else, such as for an existing online game, or a MMO, or something like that.

By ‘an existing online game’ you mean a game like Apex Legends or Fall Guys where the players all connect to a dedicated server for each match, right? Net mode: ‘Play As Client’ would be good for this?

Conversely, a game where one player hosts a match and the other players join their lobby, such as Phasmophobia or Among Us, that would be better tested with Net mode: ‘Listen Server’ ?

Hey @Fairchild1!

What jwatte is saying is that: in that very same menu where you’re seeing those options, you can adjust the number of .exe’s you open, each one after the first will be a client with the first being the server, which is good for testing as you can just switch between the windows to test client vs server. Even if you take the “Host” away and replace it with a dedicated server, the clients will behave identically. It’s generally recommended to test this way before getting a dedicated server up and running, if you are making a game with a dedicated server (Apex or something like you said). That way you can actually SEE what’s getting done on the server visually instead of trusting it to make the leap to other clients blindly.

1 Like

Typically, to test net code, you will run at least two instances.
One of those will always be a “regular client.”
You can then choose whether the other one will be “dedicated server” or “listen server.”
I recommend testing in both modes.

If you’re developing some persistent game where there already exists a game server that’s “always up,” then “play as client” is a way to connect to that, using your local development code. The netcode may end up de-syncing if the server/client code ends up mis-matching, though.

2 Likes