Created By Cedric 'eXi' Neukirchen - An Unreal Engine Blog

Transcription

'Unreal Engine 4' Network CompendiumCreated by Cedric 'eXi' NeukirchenBlog: cedric-neukirchen.netCo-Founder of Salty Panda StudiosYou can hire us: saltypandastudios.comDocument-Version 1.5.4

Table of ContentsATTENTION.4Introduction.5Network in Unreal.6A small example:. 6Another example:. 6IMPORTANT!.7Framework & Network.8Common Classes. 11Game Mode.12Examples and Usage.13Blueprint.13UE4 .17Game State.20Examples and Usage.21Blueprint.21UE4 .24Player State.26Examples and Usage.27Blueprint.27UE4 .29Pawn.31Examples and Usage.32Blueprint.32UE4 .36Player Controller.40Examples and Usage.42Blueprint.43UE4 .45HUD.48Widgets (UMG).49Dedicated vs Listen Server.50Page 2Dedicated Server. 50Listen-Server. 51Replication.52What is 'Replication'?. 52How to use 'Replication':. 53Replicating Properties. 54Remote Procedure Calls.59Requirements and Caveats.60RPC invoked from the Server.61RPC invoked from a Client.61RPCs in Blueprints. 62RPCs in C . 63Validation (C ).65Ownership.67Actors and their Owning Connections.69Actor Relevancy and Priority.71Relevancy. 71Prioritization. 73Actor Role and RemoteRole.75Role/RemoteRole Reversal.76Mode of Replication. 77ROLE SimulatedProxy.78ROLE AutonomousProxy.79Traveling in Multiplayer.80Non-/Seamless travel. 80Main Traveling .82APlayerController::ClientTravel.82

Enabling Seamless Travel.83Persisting Actors / Seamless Travel.84Online Subsystem Overview.85Online Subsystem Module.86Basic Design.86Use of ons.88Shared Cloud.89User rnal UI.90Sessions and Matchmaking. 90Basic Life-Time of a Session.91Session Interface.92Session Settings.93Session Management.94Creating Sessions.94Create a Session via Blueprint .94Create a Session via C .94Updating Sessions.95Page 3Destroying Sessions.96Destroy Session via Blueprint.96Destroy Session via C .96Searching Sessions.97Searching Session via Blueprint.97Searching Session via C .97Joining Sessions.98Joining Session via Blueprint.98Join Session via C .98Cloud-Based Matchmaking.99Following and Inviting Friends.100How to Start a Multiplayer Game.101Advanced Settings. 102Use Single Process.104Run as Dedicated Server.105Start and Connect to a Server.106Blueprint.106Start a Server.106Connect to a Server.106UE4 .107Start a Server.107Connect to a Server.107Starting via Command Line.108Connection Process. 109The major steps are.109Sources:.111

ATTENTIONThis Compendium should only be used with a base understanding of the SingleplayerGame Framework of Unreal Engine 4.It will NOT teach beginners how to use Unreal Engine 4 in general.Please refer to the “Blueprint Compendium”, created by Marcos Romero, for gettingstarted with Unreal Engine 4 as a beginner.This Network Compendium expects you to know how to use Blueprints and also C (forthe C examples).Examples were created in Unreal Engine Version 4.14.x, so they might differ a bit from the newestUE4 version you are using.It's solely meant to get you started with Networking in UE4!Page 4

IntroductionWelcome to this, hopefully, useful Unreal Engine 4 Network Compendium.The official Documentation is already quite good, but I wanted to sum up all the stuff,which I learned in the past two years while working with UE4 and Multiplayer Games,in one big Compendium with Blueprint and Code examples.The following pages will introduce you into the Network Framework, explain Classes,Replication, Ownership, and more. When ever I can, I will provide a Blueprint anda C example, which should shed some light on how the things work.The pages will, of course, also contain lots of content taken from theofficial Documentation (Source 1*), since this is how the system works after all.This Document is meant as a summary and not as a writtenredefinition of something that already has been explained!Page 5

Network in

Examples were created in Unreal Engine Version 4.14.x, so they might differ a bit from the newest UE4 version you are using. It's solely meant to get you started with Networking in UE4! Page 4. Introduction Welcome to this, hopefully, useful Unreal Engine 4 Network Compendium. The official Documentation is already quite good, but I wanted to sum up all the stuff, which I learned in the past .File Size: 2MBPage Count: 111