Hi. I’ve been using GAS for a bit, and one of the things that is stumping me is client-side prediction for damage. So in the GASDocumentation, it says:
Execution calculations… can change more than one
Attribute
and essentially do anything else that the programmer wants. The downside to this power and flexibility is that they can not be predicted and they must be implemented in C++.
This makes sense to me, and when looking at Lyra’s code, we see:
void ULyraDamageExecution::Execute_Implementation(const FGameplayEffectCustomExecutionParameters& ExecutionParams, FGameplayEffectCustomExecutionOutput& OutExecutionOutput) const
{
#if WITH_SERVER_CODE
Which implies that indeed the damage calculation is occurring on the server. However, when shooting at targets with network emulation on, there’s no perceivable lag whatsoever. In fact, it runs surprisingly well when battling AI.
In comparison, my game has horrendous lag when killing AI. I have a similar damage execution (albeit not entirely the same), but the only way I can get client-side prediction is if I turn my damage execution calculation off and use modifiers instead.
What’s happening here? What exactly am I missing? Both my game and Lyra are using AttributeSet
delegates to update the UI, so clearly there’s a big difference but I can’t tell.