Version 7.0 Migration Notes
SnapNet for Unreal Engine version 7.0 merges both the Local Players Only and Entire Simulation prediction modes into a single unified network model. This allows fine-grained control over which entities are predicted on which clients and developers can even change behavior on the fly!
In order to make this happen, a number of breaking changes to the API were unavoidable. For the most part, settings are upgraded automatically but developers will want to double-check that things are configured correctly after the upgrade and deprecated API usage will need to be fixed up.
Default Entity Prediction At Spawn
The Prediction Mode setting has been deprecated since developers no longer need to choose between Local Players Only and Entire Simulation prediction modes. In its place, a new setting—Default Entity Prediction At Spawn—has been added so that developers can configure a reasonable default for their game’s genre. Those who previously had Prediction Mode set to Entire Simulation, will find this new setting set to All, meaning that all entities will be predicted by default. Those who previously had Prediction Mode set to Local Players Only, will find this new setting set to Owner, meaning that entities will be predicted only by their owning player by default. Please verify that Default Entity Prediction At Spawn is configured appropriately for your title.
Legacy Level Loading Architecture
WarningWe plan to remove this functionality in the future. If you find your project requires this setting enabled, please reach out to us as soon as possible.
The Experimental World Partition Support setting has been removed and its functionality has now become the default. No action should be required by developers. In case any issues arise, developers can revert to the previous behavior by setting the Legacy Level Loading Architecture option.
Prediction At Spawn
Servers can now configure which players predict which entities at run-time. As a result, the Prediction Mode property has been deprecated and replaced by Prediction At Spawn. This new property functions identically to the prior Prediction Mode but includes a Default option which will fall back to the Default Entity Prediction At Spawn project setting detailed above. When migrating call sites to use
SetPredictionAtSpawn(), consider whether any existing usage of
SetPredictionMode() can be removed in favor of using the project defaults.
Any entity that requires its owning player’s input to simulate should set the newly added Requires Owner Input property or call
SetRequiresOwnerInput(). For example, characters typically require their owning player’s input for movement, but rockets typically don’t. Subclasses of
ASnapNetCharacterEntity will have this enabled by default. Correct usage of this property ensures clients will always have the requisite player inputs for the subset of entities they are predicting.
The Predicted setting was deprecated because it is no longer required by SnapNet to function correctly. Any existing usage can be safely removed.
Spawning and Owner Player Index
When spawning an event, you must now pass the instigating
USnapNetEntityComponent rather than the owner player index. This is because the parameter is used for ensuring accurate timing in lag-compensated replays and an owner player index is no longer sufficient for that purpose. Instead, the instigating entity and whether it is predicted by the spectated player is the salient feature when playing back a replay with a lag-compensated perspective. Please update any existing
SpawnEvent() call sites to provide the instigating entity or events will not be predicted. Note that it is valid to pass
nullptr if the event should never be predicted.
If there are any events relying on the value of
GetOwnerPlayerIndex(), we recommend explicitly adding and populating a FSnapNetPropertyPlayerIndex to transmit that data.