tranek/GASShooter

Why We Captured the Damage Attribute From Source?

RyuginStudio opened this issue · 1 comments

On line 21 of GSDamageExecutionCalc.cpp
DEFINE_ATTRIBUTE_CAPTUREDEF(UGSAttributeSetBase, Damage, Source, true);

According to your description, 'Damage' is a meta attribute, it can distribute the value to own attributes, Eg. health or armor.
Well, my question is why we need to captured the 'Damage' from the 'source'?

I think 'Source' is the GE's instigator. If A was injured by B, Then Why A need to care about B's meta attribute 'Damage'.

A doesn't know about B's meta attribute Damage. All sources of damage in the damage GE are collected into B's Damage attribute. The server then takes this value, does whatever calculations it needs to, then outputs it to A's Damage attribute. A then reads from its own Damage attribute.

This is GAS convention initially copied from Epic's ActionRPG sample project. Epic's Lyra fixes a potential bug by creating a separate outgoing damage meta attribute BaseDamage, but otherwise follows the same pattern of reading the damage meta attribute from the source.