Networking Overview

In multiplayer game sessions, game state information is communicated between multiple machines over a network connection. In contrast, single-player, local games store all game state information on a single machine. Communication over a network connection makes creating multiplayer experiences inherently more complex than single-player experiences. The process of sharing information between players involves a different approach than a single-player game. Unreal Engine (UE) features a robust networking framework that powers some of the world's most popular online multiplayer games to help you streamline this process. This page provides an overview of the concepts that drive multiplayer programming and guides you to additional documentation about UE's tools for building multiplayer experiences.

In CGS, all Components and Events are replicated—even data that you might think doesn't need replication.

Why CGS do this?

All systems in Unreal Engine are handled this way:

<aside> When a Character presses input, it processes through conditions and then plays a Montage via Multicast on every client. It then performs a line trace (single shot) in the forward direction to detect enemies and applies damage on the hit action. In these systems, the main replicated function is Play Montage.

</aside>

Combat Game Sample takes a different approach. The server tracks exactly which Gameplay Tags are added to the character and which inputs are consumed. While this might seem unoptimized (it’s optimzied), the system is designed for Coop/PVP games rather than MMOs. So game main concerns are desyncs and network pool management.

<aside> Additionally, CGS minimizes RPC (multicast) usage in favor of Rep Anim Notify, ensuring data replication to both clients and server. This means if a client disconnects after an animation starts playing, the animation will continue correctly after reconnection.

</aside>

The Collision Manager and Damage System currently have one imperfection: since damage applies when Melee Hit is called from the Collision Manager, the first attempt may encounter gaps between collision traces.