tranek / GASShooter

Advanced FPS/TPS Sample Project for Unreal Engine 4's GameplayAbilitySystem plugin
MIT License
953 stars 265 forks source link

A question about attribute changes #26

Closed Shatur closed 3 years ago

Shatur commented 3 years ago

Hi! First of all, thanks for the great documentation and the example, it helped me a lot. But one thing is unclear to me. In your code you listen for attribute change value here on server and client:

https://github.com/tranek/GASShooter/blob/37cee9604be5490b0671f177b335f796367ab55f/Source/GASShooter/Private/Player/GSPlayerState.cpp#L254

And then applying knock or death logic. But can an attribute change be mispredicted? Or is this delegate is called only if the value was confirmed from server?

tranek commented 3 years ago

An attribute change can be mispredicted if you locally predict the change. GASShooter intentionally does not locally predict changes to health or the knockdown tag. Those are designed to only be applied from the server.

These GitHub Issues are only for bugs with the project's code. Please go to the Unreal Engine forums, AnswerHub, or Unreal Slackers Discord Server for help with your own projects.

Shatur commented 3 years ago

An attribute change can be mispredicted if you locally predict the change. GASShooter intentionally does not locally predict changes to health or the knockdown tag. Those are designed to only be applied from the server.

Oh, got it, you use GameplayEffectExecutionCalculations to avoid prediction. Thank you!