Switching between NetMode Standalone & PlayAsClient, is this normal?

Hello, a few questions. And some background context below.

Question A: Is it normal to switch back and forth between Standalone & Play As Client when developing? Or do you just pick one and stay with it forever until your game or MVP/POC is complete?

Question B: For a multiplayer game that also has a single player mode (you can play against another human or against an AI), do you typically develop the whole thing in Play As Client and just somehow use a local host or local server for single player? Or do you use Standalone for single player and Play as Client with dedicated server only for multiplayer? Not trying to go down he rabbit hole of politics of single players requiring an online connection. I’m just trying to understand architecture of how you develop a game that supports both online and single player within the context of the below SwitchHasAuthority part and architecting in general.

Background:
I made a POC for a 2 player card game in NetMode = Standalone and I’m now doing some refactors to 1.) Propertly implement GameState and PlayerState and 2.) Support multiplayer properly using replication & Play as Client with dedicated server.

During the initial POC I was using NetMode Standalone only. But since I started my above mentioned reactors I’ve been switching back and forth between Standalone & Play as Client (multiplayer).

Let’s say my GameMode is updating an integer variable called ClockTime to = 15. I want a RepNotify for my client to update my Scoreboard to say 15 seconds left. Super simple. That works. But right now, I’m not 100% sure if I should be developing in NetMode Standalone or Play As Client. I would like to ultimately make a multiplayer game but i’m still in the Proof of Concept phase. So I tend to switch back and forth between those two while I’m refactoring this POC.

Switch Has Authority always goes to Authority when you’re in netmode Standalone. That makes sense… However, I only want my client to update not my server because sometimes I switch over to Play As Client… So it seems my logic needs to completely change based on what NetMode I’m in…


Note that my GameState’s ClockTime variable is set to RepNotify and OnRep_ClockTime is my function seen in screenshot.

Hey @SkankHunt1000

Before we start, here’s a quick explanation:

  • StandAlone: This is when you open the game without listening for incoming connections. Most games start in this mode until a player logs in or creates a session.
  • ListenServer: When you create a session, your game becomes a ListenServer, allowing other clients to connect.
  • Client: A player who joins a session as a participant, connecting to a ListenServer or a dedicated server.
  • Dedicated Server: This is used for hosting matches without an active client playing on the server. It’s common in competitive games where authority is managed by a remote server, preventing players from modifying data and cheating. In contrast, a ListenServer player could potentially alter data.

In editor:

When you play as StandAlone in the editor, it creates a game where no one can join. So, if you launch with two players in StandAlone mode, it will create two separate “game instances” —one for each player. They won’t be connected or share the same game world, essentially playing two independent sessions.

When you play as a ListenServer with two players, one of them (usually the viewport in the editor) will act as the server, while the other will be a client connected to it.
On the other hand, if you start as a ListenServer with only one player, it will function similarly to StandAlone mode, with the key difference being that other players can join your game, whereas in StandAlone mode, they cannot

Finally, if you play as a Client, the editor will launch a dedicated server in the background. Regardless of whether you have one player or more, all of them will be clients connected to this background dedicated server.

A. It’s not that common; you switch when you want to test a standalone connection flow between one client and another. In your case, I would use ListenServer, first playing with one player to test single-player, and then with two players to test multiplayer.

B. It depends. If you plan to support dedicated servers, you should test using Dedicated for multiplayer. If the idea is to let one player host, you should test using ListenServer with at least 2 players. If you plan to have both (like the game Ark), you should test both. If multiplayer support is critical for your game, I recommend testing it from the beginning, as late-stage development may require major refactors due to the different initialization flows for clients and servers.

I think its all, but let me know if i miss something, have a great day!.

Ahh this makes sense. I’m fairly new to unreal, but not new to software :wink: When unreal gave me those 3 options I was assuming I had to just pick one. I didn’t know you could start in standalone and then connect later. Still working on my first game in unreal so thanks for being patient with a noob.

Yes I plan on running a dedicated server for multiplayer clients. I will not go the listen server route.

If multiplayer support is critical for your game, I recommend testing it from the beginning, as late-stage development may require major refactors due to the different initialization flows for clients and servers.

Yes yes yes. Thank you. That’s exactly what I’m doing now. I got my POC functional, and decided to move forward with multiplayer now before I go any further.

I think its all, but let me know if i miss something, have a great day!.

I think my question could have gone down a rabbit hole, but sounds like I’m just committing to dedicated + Play as client so I’m all set now. And I’ll cross the next bridge when I get to it.

You rock, thank you!