Navigation
Unreal Engine C++ API Reference > Plugins > NetworkPrediction
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- UNetworkPredictionComponent
- UBaseMovementComponent
- UCharacterMotionComponent
- UMockCharacterAbilityComponent
- UFlyingMovementComponent
- UMockFlyingAbilityComponent
- UMockPhysicsComponent
- UMockRootMotionComponent
- UParametricMovementComponent
- UMockNetworkSimulationComponent
References
Module | NetworkPrediction |
Header | /Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkPredictionComponent.h |
Include | #include "NetworkPredictionComponent.h" |
Syntax
UCLASS&40;Abstract&41;
class UNetworkPredictionComponent : public UActorComponent
Remarks
UNetworkPredictionComponent This is the base component for running a TNetworkedSimulationModel through an actor component. This contains the boiler plate hooks into getting the system initialized and plugged into the UE replication system.
This is an abstract component and cannot function on its own. It must be subclassed and InitializeNetworkPredictionProxy must be implemented. Ticking and RPC sending will be handled automatically.
Its also worth pointing out that nothing about being a UActorComponent is essential here. All that this component does could be done within an AActor itself. An actor component makes sense for flexible/reusable code provided by the plugin. But there is nothing stopping you from copying this directly into an actor if you had reason to.
Variables
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
FNetworkPredictionProxy | NetworkPredictionProxy | Proxy to interface with the NetworkPrediction system. |
![]() ![]() |
FReplicationProxy | ReplicationProxy_ServerRPC | ReplicationProxies are just pointers to the data/NetSerialize functions within the NetworkSim. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Invoke the ServerRPC, called from UNetworkPredictionWorldManager via the TServerRPCService. | |
![]() |
bool | Helper: Checks if the owner's role has changed and calls InitializeForNetworkRole if necessary. | |
![]() |
FReplicationProxySet | ||
![]() ![]() |
void | InitializeForNetworkRole
(
ENetRole Role, |
Finalizes initialization when NetworkRole changes. Does not need to be overridden. |
![]() ![]() |
void | Classes must initialize the NetworkPredictionProxy (register with the NetworkPredictionSystem) here. EndPlay will unregister. | |
![]() ![]() ![]() ![]() |
void | ServerReceiveClientInput
(
const FServerReplicationRPCParameter& ProxyParameter |
The actual ServerRPC. This needs to be a UFUNCTION but is generic and not dependent on the simulation instance. |
Overridden from UActorComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | EndPlay
(
const EEndPlayReason::Type EndPlayReason |
Ends gameplay for this component. |
![]() ![]() |
void | Initializes the component. | |
![]() ![]() |
void | PreReplication
(
IRepChangedPropertyTracker& ChangedPropertyTracker |
Called on the component right before replication occurs |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | Called right before receiving a bunch |