• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Architecture Help On Design (Combat Suite)

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
I've been working on my combat suite of late.

Currently, I have it set up like this-

DamageType: damage types like fire so unit's can have resistances/absorptions for them

Damage: A simple struct with a damage type and a value.

DamageGroup: A group of damages with an apply damage method that takes a widget and applies all damages in group to it.

AttackType: Attack types do targeting. They take a target widget or location and run an algorithm, applying the damage group to all viable targets. Attack types may be timed as well. Stores a boolexpr.

Attack: A table that associates an attack type with a group of damage groups via attack[damageGroup].attackType = newAttackType. Primarily stores and runs a trigger with a set of triggerconditions. Using a timer to remove triggerconditions so as not to abruptly stop the trigger if it is running.

AttackTarget: A special attack target struct that boxes up targets and provides locking mechanisms so that a target is not destroyed until nothing is using it. Automatically removes locations upon destruction if it is boxing a location. Returns generic x,y,z, coordinates, widget, destructable, item, unit, or location. Can only be destroyed via unlocking (no actual destroy method).

So what I'm wondering is how I would apply effects (modifications to damages, damage groups, and etc) to the above. I've been thinking about it a lot. I can't just change the values... effects are temporary modifications that may be caused by aura, buffs, and etc...

What I'm thinking is that perhaps I can just apply an effect to an attack and let the effect deal with it ; P.

Also, you guys think my above architecture is ok so far? I think it's quite open, quite modular, and pretty darn optimal and powerful ^_^.

So far everything above is pretty much coded except for effects.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
I guess the whole system runs threw the DamageType right? As you mentioned about resistance why not just add there extra damage as an example? Or is it maybe like you pre-set damage types which the system compares to resistances? Then my suggestion is useless I guess :p

Boxing a location? You mean reusing it for GetLocationZ? Wouldn't it be better just move the location instead of removing it? Anyway the idea is really awesome.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
for boxing.. -> Returns generic x,y,z, coordinates, widget, destructable, item, unit, or location

obviously stores one of those ; p. Also -> provides locking mechanisms so that a target is not destroyed until nothing is using it

->I guess the whole system runs threw the DamageType right

that's incorrect ; ). DamageType only handles resistances. Damage handles actual damage (applies numeric value), DamageGroup applies a group of damages, etc, etc ;D. When you get into the Attack stuff, you get into attack types, like damage over time. However, I'm starting to debate that attack types might be better as attack effects (like damage over time), and targeting should be entirely done by abilities, making the Target thing only having to store widgets.


Please note that I don't see anything wrong with the above. My issue was here ;D
->So what I'm wondering is how I would apply effects (modifications to damages, damage groups, and etc) to the above. I've been thinking about it a lot. I can't just change the values... effects are temporary modifications that may be caused by aura, buffs, and etc...

edit
Updates

Something to do with base value and mod value. More to be ascertained.

Should be able to easily stack effect (with addition/multiplication bonuses) values and future effects.

The mod value allows effects to just change a numeric value and start a timer which will undo the change when the effect wears off.

Applying to future effects would work with specific damage types (0 being all). Effects would base its own values off of the already present effect mod values associated with damage types it is changing.

Armor type and damage type share same instance as they are two sides of the same coin :\.

Armor would be numeric values for armor type
ArmorGroup would be the full armor object (apply damage group to target, target applies damage group to its armor group, etc).


So far, people have commented on my design as being convoluted and overly complicated ; P.
 
Last edited:
Status
Not open for further replies.
Top