Replicating Functions

Guide for Replicating Functions in Multiplayer Games.

On this page

Function Replication (Remote Procedure Calls or RPCs for short) are functions that are called locally, but executed remotely on another machine (separate from the machine performing the call). RPC functions can be very useful and allow either the Client or the Server to send messages to each other over a network connection. Replicated function calls can be set to either Reliable or Unreliable where Reliable calls are guaranteed to occur, while Unreliable calls may be dropped during heavy network traffic. Most Replicated Functions that handle cosmetic visuals are unreliable to avoid saturating the network.

There are 3 primary types of Replicated Functions: Multicast, Run on Server, and Run on owning Client. Multicast functions should be called on the Server, where they are executed, and then forwarded automatically to Clients. Server functions are called by a Client and then only executed on the Server. Client functions are called by the Server and then only execute on the owning Client.

Server and Client Replicated Functions have some restrictions, for one they can only be used on Actors that have a Net Owner. Actors have Net Owners if they are a Player Controller or owned by a Player Controller. For example, a Pawn possessed by a Player Controller can have Server or Client Replicated Functions executed upon it.

Implementation Guides

Выбрать тему

Добро пожаловать на новый сайт документации Unreal Engine 4!

Мы работаем над множеством новых функций, включая систему обратной связи, чтобы вы могли рассказать нам, о том, что мы делаем. Этот вариант не совсем готов для использования в конечном релизе, поэтому перейдите на форум обратной связи по документации, чтобы рассказать нам о проблемах с этой страницей или написать нам о любых проблемах, с которыми вы сталкиваетесь в работе с документацией.

Мы обязательно сообщим вам, когда новая система будет запущена.

Отправить отзыв