#OneResistanceAttribute Damage Exec- Multiple damage types

1 messages ยท Page 1 of 1 (latest)

native heart
#

I do see some issues though

#
  • 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.
twilit sky
#

Oh ok here

native heart
#

have a look at mine

twilit sky
#

Ok well this is specifically for damage tags and I just want the flat values

native heart
#

maybe it will be give you some ideas

native heart
#

Passing Damage.Fire is fine

#

but passive All owned tags, GA assets and Ge assets too give you MORE

twilit sky
#

I don't even have any currently

native heart
#

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 ...

twilit sky
#

Hang on let me show you how I award and do this with GEs

native heart
#

whereas if you pass only one tag, you're limited to this one tag to create your GE buff / debuff

twilit sky
#

This is 25% fire resistance

#

What else do I need to pass along

native heart
twilit sky
#

This is adding damage

native heart
#

but what if you game has melee and distance damage, and you have to have a buff for distance fire resistance ?

twilit sky
#

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

native heart
#

See my point ?

twilit sky
#

Ok that could just be handled elsewhere

#

This is for flat damage calculations right

native heart
#

that shouldn't be handle elsewhere

twilit sky
#

.

native heart
#

*edit

#

that should and can very easily be handled here

twilit sky
#

Inside this GE

#

I should handle buffing for ranged damage bonus

native heart
#

by just passing along the source / target tags in the Exec

twilit sky
#

Ok but this static evaluate function doesn't perform any modifiers

native heart
#

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

twilit sky
#

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

native heart
#

As you wish ๐Ÿ™‚ You'll be yourself a favor by giving all the tags + modifiers to the eval

twilit sky
#

Ok well then help me understand this specific static evaluate function how further tags and modifiers can be calculated into it

native heart
#

GA_Attack_Distance -> Asset tag: Ability.Attack.Distance

native heart
#
    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.

twilit sky
#

That method only works if you do it single damage type at a time

native heart
#

lol

twilit sky
#

If you hit with multiple damage types that calculation comes back wrong

twilit sky
#

I'm looking at it right now

native heart
#

doesn't seem so

#

currently handle 2 different damage at the same time

#

can do more

twilit sky
#

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

knotty kraken
#

i think this can be done a bit more intuatively thouigh

twilit sky
knotty kraken
#

have to give me a few, i am working

twilit sky
#

no worries

knotty kraken
#

like i said "i think"

#

let me have a little play

#

cause the narxims one seems quite rigid

twilit sky
#

I'm trying to figure out the best place to put the Ability.Context.RangedAttack tag

knotty kraken
#

this here

#

using hardcoded tags

twilit sky
#

Well that's also my thing

#

you can see in my loop I have my URPGAbilitySystemLibrary::GetDamageTypeTags()

knotty kraken
#

your damage calc should extract the damage type tags out

#

of the GE being applied

twilit sky
#

I just make a container

knotty kraken
#

for example, you apply a GE, say GE_Damage

twilit sky
#

But that only works to apply 1 damage type at a time

knotty kraken
#

this has asset tags Damage.Fire, Damage.Sword

twilit sky
#

I want to apply all damage types at the same time

knotty kraken
#

GE_Damage_FireSword sorry

#

you can get the damage tags

#

and evaluate them.

#

not sure why you need to do the above?

twilit sky
#

But then it aggregates the total value of the attribute together

#

instead of individual resistances having their own unique values

#

And individual damages

knotty kraken
#

then you should split the child tags from the incoming source tags

#

for damage, and loop

twilit sky
#

That's what I've done

knotty kraken
#

no you havent

#

you have hardcoded them

twilit sky
#

?

#

No

knotty kraken
#

you dont need to do this

twilit sky
#

That's just making the damage tag container so I can loop on it

knotty kraken
#

again, you dont need to do this

twilit sky
#

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

knotty kraken
#
    FGameplayTagContainer AllMyDamageTypes = UGameplayTagsManager::Get().RequestGameplayTagChildren(NativeTags::DamageType);
    ```
#

boom

twilit sky
#

.

knotty kraken
#

you now have all the damage types

twilit sky
#

Ok can I be real

#

I already fkin do that with my equipment stat effect rolls

knotty kraken
#

secondly

#

you should extract them

twilit sky
#

I use this

knotty kraken
#

from source tags

twilit sky
#

But anyways I should extract them from source tags?

knotty kraken
#

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

native heart
twilit sky
#

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

native heart
#

could have a whole config table etc ...

#

but hey, the goal is to show it can be done.

twilit sky
native heart
knotty kraken
#

then you have a huge flaw

native heart
#

you should use the GA's apply effect to target

#

and not ASC's target apply to owner

knotty kraken
#

it doesnt matter when yoou apply it

#

the source tags should be valid

#

show me your logic

#

maybe lets take a step back

twilit sky
#

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

native heart
#

he's not using GAs method to apply damage 100%

knotty kraken
#

it doesnt matter

#

we dont use GA's for damage

#

for our projectiles

#

show me your damage application

#

@twilit sky

twilit sky
#

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

knotty kraken
#

so where are the damage types ever set

native heart
#

Spec should be created on projectile creation, from the source asc

#

then, applied when hitting

knotty kraken
#

the issue is, there is no tags on the GE being set

twilit sky
#

This is how I current add fire damage.

knotty kraken
#

yup no asset tags at all

twilit sky
#

I understand

knotty kraken
#

thats not adding fire damage

#

thats not how it works

twilit sky
#

because if I do this and then try the calculate captured magnitude with eval params it's not capturing any source tags

knotty kraken
#

this is actually really wrong

twilit sky
#

It works perfectly for being really wrong

knotty kraken
#

you understand what SourceTags here mean right?

native heart
#

I can make a whole game that works and is coded with the feet. Doesn't mean it's right

knotty kraken
#

also btw, i highyl recommend not doing a CT linear curve thing, the precision will ruin you.

twilit sky
knotty kraken
#

you apply ge level 900 it will do 899.6 damage

#

not 900.

twilit sky
#

... yes I run into that

knotty kraken
#

yeah it sucks lol

#

we ended up not doing that

#

but made a mod mag calc

#

that grabs the level

#

and does our math

native heart
#

or ... the exec ... ๐Ÿ˜„

knotty kraken
#

anyway. that above GE is wrong

native heart
#

or both

twilit sky
#

I can scrap this and start over maybe I did it wrong from the beginning

knotty kraken
#

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

twilit sky
#

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

knotty kraken
#

right..... ok

#

i think i understand where this is going

twilit sky
#

unequip the item it goes away

knotty kraken
#

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?

twilit sky
#

In my projectile ability when I spawn the projetile I create DamageEffectInfo

knotty kraken
#

then you add more to it?

twilit sky
#

Which packs in with this

knotty kraken
#

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

twilit sky
#

ok

#

My player equips items that awards OutgoingAbilityDamage as flat damage of whatever Asset Tag Damage Type I want

knotty kraken
#

i think you need 2 attributes min

twilit sky
#

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

knotty kraken
#

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

twilit sky
#

I have that one

knotty kraken
#

``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

twilit sky
#

.

knotty kraken
#

right

#

so your infinite GE

#

should be modifing

#

OutgoingBaseDamage

twilit sky
#

I agree so far

knotty kraken
#

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

twilit sky
#

I don't get that

#

honestly

#

Why make the ability damage also an attribute

#

How are you going to use that as an attribute

knotty kraken
#

ill explain

twilit sky
#

Where does that get any GE to add value to it

knotty kraken
#

you need 2 attributes

#

trust me

#

Base and Ability

twilit sky
#

I don't understand the point of Ability and I can't conceptualize how to use Ability attribute

knotty kraken
#

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

twilit sky
#

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

knotty kraken
#

thats why you need 2 attributes

twilit sky
#

instead of an attribute

knotty kraken
#

you cant setbycaller without an attribute..

twilit sky
knotty kraken
#

this requires an attribute to bind too..

#

else will do nothing..

twilit sky
#

So how does it work now? What attribute has it been binding to?

knotty kraken
#

show me the ge

#

unless

#

you manually just pulled it

#

inside the calc

#

(i highly recommend not doing)

twilit sky
knotty kraken
#

yeah you manually pulled it

#

from inside the calc

twilit sky
#

I didn't pull anything?

knotty kraken
#

so how do you read the value?

twilit sky
#

The Spec has 2 maps of SetByCallerss... FName:Float and FGameplayTag:Float

knotty kraken
#

right like i said

#

your pulling it manually

#

i really dont recommend doing this.

twilit sky
#

Oh that's what you meant ok then yes

#

Why not

knotty kraken
#

cause now your forcing ALL your damage to now be setbycaller

#

otherwise your damage calc will break

twilit sky
#

Just the damage coefficient

knotty kraken
#

you cant just make a GE say do 1000 damage

#

and not use setbycaller

#

you put yourself into a limitation

twilit sky
#

?

knotty kraken
#

its really hard to explain

twilit sky
#

Coefficient = 1.f

knotty kraken
#

second

twilit sky
#

1000 fire damage

#

0 resistance

#

1000 damage

#

Damage 1000

knotty kraken
#

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.

twilit sky
#

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

twilit sky
#

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

native heart
twilit sky
#

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

knotty kraken
#

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.

twilit sky
#

Usually my imprecision issues are only evident in UI

#

Like my movespeed for example I have a constant curve that a time of 3 is value of 1.15 and it applies the gameplay effect properly, however in my UI it displays 14%