Skip to content

Networking overview

Networking Guide Compendium

Networking Replication Guide:

Survival Game - C++ Networking Sample

Different types of replication:#

  • Actor Replication

  • Variable Replication

  • Subobject/Component replication

  • Function Replication (RPC, can only mark UFUNCTION to be replicated in C++ but are BP callable)

  • Event Replication

Gamestate vs Game Instance#

  • Gamestate is replicated extension of GameMode b/c GameMode only exists on the server for security. GameMode contains the win/loss rules of the games. Should not hav emuch data that changes during Play

  • GameState would hold the positions of the chess pieces on the board. GameState tracks current state of the game (player kills/team kills)

  • Gamestate allows clients to access game data like scores & match time, scoreboard stuff. Freely replicated

  • GameInstance is data that's persisted between levels. E.g. You want to keep track of what a player did in this level to affect the next level

Gamemode contains rules/logic e.g. conditions for a touchdown, first down in football. Gamestate is state that's replicated to everyone freely e.g. the scoreboard

Playercontroller/playerstate is the equivelent. E.g. playerstate contains score, name, etc while setting those variables and when and routing input is through Playercontroller

GameSession is meant to handle interactions with OnlineSubsystem like accepting login, checking ban lists/server capacity, spectator permissions, starting/ending session with platform

Objects Can Be In One of these Categories#

  • Server Only

  • Server & Clients

  • Server & Owning Client

  • Owning Client



Engine Practicalities:#

UnrealEngine\\Engine\\Binaries\\Win64\\UE4Editor.exe "UnrealEngine\BBR\BBR.uproject" 0-LevelStart?listen -Game
UnrealEngine\\Engine\\Binaries\\Win64\\UE4Editor.exe "UnrealEngine\BBR\BBR.uproject" -Game
UnrealEngine\\BBR\\BBR.uproject 0-LevelLockArena?listen -Game
UnrealEngine\\Engine\\Binaries\\Win64\\UE4Editor-Win64-Debug.exe "UnrealEngine\\BBR\\BBR.uproject" 1-SimpleMasterArenaFlow?listen -Game -log

Launch server mode in standalone build:

 ?listen -server