Single Player/Multiplayer Best Practice

Hello. I’ve got a quick question regarding best practices. My intent for my next game is to develop a game that can be played either Single Player by yourself, or multiplayer with a dedicated server to persist a world, with gameplay essentially being the same for both (like Minecraft or Terraria - though different gameplay specifics).

Through some initial testing, it seems like I can run the game with Switch Has Authority and it works as I would need it to. As expected, an instance of the game running as a dedicated server returns true, an instance of the game running as a client connected to a server returns false, and a standalone version of the game (not connected to a server) returns true.

However, I wanted to see if I’m missing something, or if there’s a better way to do this. As the gameplay should be nearly identical regardless of online vs offline play, my hope is to not have to rewrite all of the code for the two modes.

I’d appreciate any validation that I’m doing this correct, or pointing me in the right direction if I’m not.

1 Like