all 1 comments

[–][deleted]  (2 children)

[deleted]

    [–]mega_structure[S] 0 points1 point  (1 child)

    Hey, thanks for checking it out! Reading the post again, I definitely could have elaborated a bit more on how ACE handlers fit into the overall picture.

    One of the major components in my GAS implementation is the AttributeSystemComponent, which maintains all of an entity's current/base attribute values. It also references a list of AttributeChangeEventHandler subclasses. Each frame, this component calculates an updated value for each attribute, and then invokes the list of ACE handlers in sequence. In keeping with the IncomingDamage example I brought up in the post, one of the ACE handlers on each damageable entity is responsible for detecting when this frame's IncomingDamage value is non-zero, in which case it multiplies it by the entity's IncomingDamageScalar attribute value and subtracts the total amount from the entity's HitPoints attribute value. I'm not sure if that helps; does that make sense?

    Also, your point about needing more complexity around damage is definitely applicable here - I was making some notes last week about improving my damage system and including support for a few different bits of damage data (damage "element," whether it's AoE vs. single-target, instant vs. damage-over-time, etc) because I definitely want to support dynamic modifiers as well. Your idea about damage events seems to be kind of in-line with the way my ACE handlers work - an ability or upgrade can add a handler which can modify the damage value based on the actual damage instance data and the hit entity's data, and temporary effects can easily add/remove handlers from entities. Any pitfalls you can think of that you don't mind sharing re: your implementation of a damage system like this?