#OneResistanceAttribute Damage Exec- Multiple damage types
1 messages ยท Page 1 of 1 (latest)
I do see some issues though
Narxim's version https://github.com/Narxim/Narxim-GAS-Example/blob/master/Source/GAS_Example/AbilitySystem/Calculations/DamageGameplayEffectExecutionCalculation.cpp
- Empty container for the target tags ... could use the target tags ?
- Single tag container for the Source: You're missing out on all GA asset tags / GE Assets tags / Owned tags
- The container could be buffered too.
Oh ok here
have a look at mine
Ok well this is specifically for damage tags and I just want the flat values
maybe it will be give you some ideas
Well, I can tell you that you might want more than that ๐
Passing Damage.Fire is fine
but passive All owned tags, GA assets and Ge assets too give you MORE
I don't even have any currently
Ex: My attack is a "Type.Distance" and my GE has the tag "Ignore.Resistance" and my character has "Source.NPC"
Well, any GE buff / debuff to resistance could have those too ...
Hang on let me show you how I award and do this with GEs
whereas if you pass only one tag, you're limited to this one tag to create your GE buff / debuff
nothing
This is adding damage
but what if you game has melee and distance damage, and you have to have a buff for distance fire resistance ?
So when there's like 50 of those damage type effects added, it will evaluate the attribute value and it only checks for the damage type tag
See my point ?
that shouldn't be handle elsewhere
.
by just passing along the source / target tags in the Exec
Ok but this static evaluate function doesn't perform any modifiers
by creating those tags, passing them in the GA asset tags (which are automatically added to the Applied GEs asset tags) + GE asssets tags + GE damage modifiers
This static evaluate function only returns the total value of the requested attribute if any target tags or source tag requirements are met
so this can't assist in calculating that it has a buff
this will simply evalute the base attribute value with those tags
This specific case for grabbing these values can't be modified and calculated using tags this can only fetch raw attribute value unmodified
Or what
do I say in another GE like this is Ranged Damage Buff GE and it just adds ability damage with the Ranged tag and then it could also pull that out and add it as further base damage
As you wish ๐ You'll be yourself a favor by giving all the tags + modifiers to the eval
Ok well then help me understand this specific static evaluate function how further tags and modifiers can be calculated into it
GA_Attack_Distance -> Asset tag: Ability.Attack.Distance
Look at my implementation on Narxim's
FAggregatorEvaluateParameters EvaluationParameters{};
EvaluationParameters.SourceTags = Spec.CapturedSourceTags.GetAggregatedTags();
EvaluationParameters.TargetTags = Spec.CapturedTargetTags.GetAggregatedTags();```
Get the tags
bool bUseDynamicDamageTypeTag = false;
// We'll calculate the current resistance, and the multiplier.
if (DamageType.IsValid())
{
EvaluationParameterWithDamageType = EvaluationParameters;
// Add the damage tag of this type of damage.
FGameplayTagContainer SourceEvaluationWithDamageType = *EvaluationParameters.SourceTags;
SourceEvaluationWithDamageType.AddTag(DamageType);
EvaluationParameterWithDamageType.SourceTags = &SourceEvaluationWithDamageType;
bUseDynamicDamageTypeTag = true;
}```
Duplicate the tag containers and add the modifiers in
Evaluate
float CurrentResistance = 0.f;
ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(
DamageStatics->ResistanceDef,
bUseDynamicDamageTypeTag ? EvaluationParameterWithDamageType : EvaluationParameters,
CurrentResistance
);```
I just copied code from it.
That method only works if you do it single damage type at a time
lol
If you hit with multiple damage types that calculation comes back wrong
have you read it ?
I'm looking at it right now
doesn't seem so
currently handle 2 different damage at the same time
can do more
Ok so also your method calculates the damage type and then immediately rolls an output but you have the benefit you param the attribute property that's being modified so you can modify health and bleeding properties
Mine adds all the damages together, then attempts critical strike and final damage reduction before sending out to a meta incoming damage attribute
I think mine is a good start but mine is just crude compared to yours
your effective resistance calculation, the immunity tags
I could easily make better containers for eval params which would help calculate I suppose
I just need to further develop the calculation
my game doesn't have any of those features at all yet
Oh you know what as well
it's also because I couldn't figure out how to get the damage type tag into the GE to be read in the eval params properly, and also in your exec you're manually adding the tag to the eval params when you copy them I didn't consider that
I'm working right now to make a proper modifier just like you said distance fire resistance but instead I'm going to try for ranged fire damage buff before I consider this a good calculation thank you for the next step and discussion
i think this can be done a bit more intuatively thouigh
Please continue
have to give me a few, i am working
no worries
like i said "i think"
let me have a little play
cause the narxims one seems quite rigid
I'm trying to figure out the best place to put the Ability.Context.RangedAttack tag
Well that's also my thing
you can see in my loop I have my URPGAbilitySystemLibrary::GetDamageTypeTags()
I just make a container
for example, you apply a GE, say GE_Damage
But that only works to apply 1 damage type at a time
this has asset tags Damage.Fire, Damage.Sword
I want to apply all damage types at the same time
GE_Damage_FireSword sorry
you can get the damage tags
and evaluate them.
not sure why you need to do the above?
But then it aggregates the total value of the attribute together
instead of individual resistances having their own unique values
And individual damages
then you should split the child tags from the incoming source tags
for damage, and loop
That's what I've done
That's just making the damage tag container so I can loop on it
again, you dont need to do this
I actually complained this is my biggest complaint is doing that tag container like that. I would really like a better way to do this
and he also told me about adding more aggregator tags and eval params instead of just the single damage tag for better calculations I'm working on that
FGameplayTagContainer AllMyDamageTypes = UGameplayTagsManager::Get().RequestGameplayTagChildren(NativeTags::DamageType);
```
boom
.
you now have all the damage types
I use this
from source tags
But anyways I should extract them from source tags?
cause your GE should be supplying the tags
as per my blog post
so when you apply the GE
the sourcetags in the GE will contain ALL the damage type info to be applied right
Oh it is
It never shows up in the eval params in the exec calc if I try to add asset tags and do damage like I'm doing now
could have a whole config table etc ...
but hey, the goal is to show it can be done.
what?
My GE Damage is unaware of any damage types I do it just calls for Damage to apply
because you're applying the damage wrong
then you have a huge flaw
it doesnt matter when yoou apply it
the source tags should be valid
show me your logic
maybe lets take a step back
When I apply GE to add Damage Attribute with Asset Tags of Damage Type and then call the apply damage it never captures the asset tags of the effects used to add the damage attribute
he's not using GAs method to apply damage 100%
it doesnt matter
we dont use GA's for damage
for our projectiles
show me your damage application
@twilit sky
I just have a static function
On overlap
It's just basic
I'm trying to read through where it captures all the tags and I'm getting lost a bit
so where are the damage types ever set
Spec should be created on projectile creation, from the source asc
then, applied when hitting
that is true, that is what we do. but thats not relevent here
the issue is, there is no tags on the GE being set
This is how I current add fire damage.
yup no asset tags at all
I understand
because if I do this and then try the calculate captured magnitude with eval params it's not capturing any source tags
this is actually really wrong
It works perfectly for being really wrong
this is not an argument though
I can make a whole game that works and is coded with the feet. Doesn't mean it's right
also btw, i highyl recommend not doing a CT linear curve thing, the precision will ruin you.
It's a cubic curve with a linear line
... yes I run into that
yeah it sucks lol
we ended up not doing that
but made a mod mag calc
that grabs the level
and does our math
or ... the exec ... ๐
anyway. that above GE is wrong
or both
I can scrap this and start over maybe I did it wrong from the beginning
source tags are only used if your applying this GE if that attribute will ever be modified.
or if the ge is applied, if that attribtue will be modified.
well that kinda thing
bit more to it, but im not explaining everything about it.
secondly why is this infinite
Because I use these as temporary stat effect rolls like path of exile in an RNG inventory items
Equip an item get + Base Fire Damage
unequip the item it goes away
but when you use the weapon
it does the damage FROM this ge?
so this GE gets applied
you say throw fireball
it pulls the damage val from this applied GE?
or this is the base for that item?
In my projectile ability when I spawn the projetile I create DamageEffectInfo
then you add more to it?
cause i see a few issues here, i would be seperating my attributes
i think i understand what your after.
no dont show code
lets discuss your damage pipeline
how it should work
ok
My player equips items that awards OutgoingAbilityDamage as flat damage of whatever Asset Tag Damage Type I want
i think you need 2 attributes min
the ability provides a damage coefficient so like Fireball does 100-250% base damage that gets rolled when the projectile is spawned
on overlap it applies damage, in the exec calc measures all base damages * ability coefficient then minus resistance, critical strike then damage reduction
ok
so
2 attributes
//This is the outgoing base damage which the actor has. This should be calculated and stored on the set.
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_OutgoingBaseDamage, Category = "Shooter|Set|Damage", Meta = (AllowPrivateAccess = true))
FShooterGameplayAttributeData OutgoingBaseDamage;
UFUNCTION()
void OnRep_OutgoingBaseDamage(const FShooterGameplayAttributeData& OldValue);```
this is the first one
I have that one
``cpp
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_OutgoingAbilityDamage, Category = "Shooter|Set|Damage", Meta = (AllowPrivateAccess = true))
FShooterGameplayAttributeData OutgoingAbilityDamage;
UFUNCTION()
void OnRep_OutgoingAbilityDamage(const FShooterGameplayAttributeData& OldValue);` ```
then you have this
.
I agree so far
now when you apply fireball
you will be using OutgoingAbilityDamage
for the fireballs damage
this gets calculated with the base
so that covers that bit
I don't get that
honestly
Why make the ability damage also an attribute
How are you going to use that as an attribute
ill explain
Where does that get any GE to add value to it
I don't understand the point of Ability and I can't conceptualize how to use Ability attribute
ill explain..
float OutgoingBaseDamage = 0.0f;
ExecutionParams.AttemptCalculateCapturedAttributeMagnitude(CuraDamageStatics().OutgoingBaseDamageDef, EvaluateParameters, OutgoingBaseDamage);
you have this in your execution calc right
pulls the base damage value
//Calculate the Outgoing Ability Damage passing in the base value above.
float AbilityDamage = 0.0f;
ExecutionParams.AttemptCalculateCapturedAttributeMagnitudeWithBase(CuraDamageStatics().OutgoingAbilityDamageDef, EvaluateParameters,
BaseAbilityDamageMultiplied, AbilityDamage);```
this will pull the ability damage
which can be "SetByCaller"
from your fireball GE
or just set inside it
I could easily let the ability roll a rng attack damage from inside the ability and send it in the set by caller
and the Spec can get the set by caller for ability damage sure
thats why you need 2 attributes
instead of an attribute
you cant setbycaller without an attribute..
?
So how does it work now? What attribute has it been binding to?
show me the ge
unless
you manually just pulled it
inside the calc
(i highly recommend not doing)
I didn't pull anything?
so how do you read the value?
cause now your forcing ALL your damage to now be setbycaller
otherwise your damage calc will break
Just the damage coefficient
you cant just make a GE say do 1000 damage
and not use setbycaller
you put yourself into a limitation
?
its really hard to explain
Coefficient = 1.f
second
why is this a 0-1 value?
your stuff doesnt do specific damage?
i am probably completly mis understanding how your game is supposed to work.
It's like an ARPG
It's exactly like an ARPG
It's RNG damage ranges
Base Damage * Ability Coefficients with many stat effect rolls and modifiers
Your character does 50 fire damage and 100 ice base damages, the ability causes 75-225% base damage plus whatever other modifiers
So the ability RNG rolls 122% damage
and then in the exec calc it loops all damage types and multiplies all base damages * 122%
then takes off the resistances from there
The issue is when I do this for adding the damage in the infinite effect as the base damage
when I create the GE for the actual damage effect to fire off, the GE from the ability to apply damage doesn't capture the asset tags of the infinite effects on my player as well to aggregate them to the Damage Effect
That's why I add the damage tags down to the source required tags is so in the exec calc when I'm evaluating the attribute with tags, in the source tags I just put the damage type and it matches up
It looks like this when I roll some gear and equip it to the player
So I fire projectile, it doesn't calculate all my damages and capture all the damage types and everything until the exec calc hits the enemy so the projectile doesn't send asset tags to send the damage type with the attack
Wow
So I added all of the captured tags source and target, and then passed all of the ability's dynamic spec source tags as well into it and from there I was able to add a tag to my ability that said it was a RangedAttack, and then I added a Fire Immunity tag that was granted to the enemy as well
And when I start making gameplay effects using the eval params directly in the modifiers themselves it works out
Adding the target must not have immunity fire tag negated 100% fire damage when the enemy's ASC had the fire immunity tag granted to it
Then I can make an effect that is called Ranged Fire Damage and this is a multiplier instead of just flat addition and it requires not only the fire damage tag, but also the Ranged Attack tag from the Ability's dynamic spec source tags
I'm dying inside now that Kaos told me tho not to use CT_Linear because that's how I add arbitrary amounts of attributes either whole or fractional values
I don't even understand what it is
I make a curve table with a 2 keys linear. -10000, -10000 /// 10000, 10000
And then you can roll any number between those and apply the gameplay effect at that level and it awards you exactly that much attribute value
So in my RNG stats on equipment I can just give an RNG range of +10-50 health and it RNGs 37 and applies + Health GE at Level 37
Or I can do small values like multipliers and do like 1.05-1.10 for a 5-10% multiplicative
apply the gameplay effect at 1.07 level
But kaos is correct
there's just so many times that float imprecision nails you
It's so frequent I feel like
like i said
make a MMC
UCLASS()
class DOMINANCEGAMEPLAY_API UDominanceLevelToValueCalc : public UGameplayModMagnitudeCalculation
{
GENERATED_BODY()
public:
virtual float CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const override;
};```
float UDominanceLevelToValueCalc::CalculateBaseMagnitude_Implementation(const FGameplayEffectSpec& Spec) const
{
return Spec.GetLevel();
}```
lmfao
no imprecision here.