-
Notifications
You must be signed in to change notification settings - Fork 8
Net Prediction
Important
Learn how to build Net Predicted Abilities with Net Predicted Focus Targets!
Requires Vigil Version >=1.1.0
Note
Vigil is not guaranteed to be in sync between server and client beyond the initial activation of the scan ability
This is not a constraint with Vigil, but rather the Gameplay Ability System
A prediction key is only valid on the frame where the ability is activated
Note
A prediction key can be regenerated -- and on the frame where that occurs -- the ability and therefore Vigil will be in sync
Based on limited testing, this workflow has 100% accurate results under ideal networking conditions -- albeit, with very high latency of ~300ms.
Under non-ideal networking conditions or potential edge cases, having the server and client disagree on the focus target is entirely possible.
This should be handled, but how it is handled depends on your implementation.
Intended to be called from a Gameplay Ability:
const FOnVigilNetSyncCompleted Delegate = FOnVigilNetSyncCompleted::CreateWeakLambda(this,
[this]
{
// DoStuffPostVigilSync();
});
if (!VigilComponent->RequestVigilNetSync(this, Delegate, EVigilNetSyncType::OnlyServerWait))
{
// EndAbilityOrSomething();
}Here is an example of a gameplay ability that prints the net predicted focus result, you can use this same workflow:
Tip
Expand the node to change the sync type

Caution
This workflow is largely untested
Please provide feedback!!
Either @vaei on Unreal Source Discord in the #ue5-general channel
Or create an Issue -- even if there is no issue and you simply want to report that it works well