• 🏆 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!

question about damage detection system

Status
Not open for further replies.
Level 9
Joined
Dec 12, 2007
Messages
489
Hello there,
I would like to ask about damage detection system.

I have searched through THW, WC3C, and even TH's site about each damage detection system hosted respectively.

I came to few options which draw my attention, namely:
- Rising_Dusk's IDDS (found here)
- Bribe's DamageEngine (found here)
- looking_for_help's PDD (found here)
- Flux's DamagePackage (found here)
- and Nestharus's DDS (found here)

actually, I've been using Dusk's IDDS, mainly because it got features like:
- able to differentiate attack and spell
- able to create different kinds of damage type (a great feature to abuse)
- and most of all, trigger priority which really helps in designing which trigger action went first or later (I find other resource lack of this particular feature)

since Dusk's library is outdated by today's standard for a damage detection system (lack of trigger refresh functionality and somehow frequently crash Wc3 on use), I'm considering to switch to other dds if I'm unable to find a fix to the IDDS.

I'm asking for second opinion about other 4 damage detection systems which might be tweaked to get similar feature, mainly the trigger priority and the capability to differentiate damage type (more than attack, spell, and code)

and yes, my knowledge in vJass is limited, hence the option to code my own damage detection system is simply not preferable

so any idea about which damage detection system that fit my question?
 
Level 22
Joined
Feb 6, 2014
Messages
2,466
Mine will execute triggers based on the order they are registered, so if you are registering them all on map initialization and unsure which will execute first, perhaps creating your own "registerDelayed" function will do the trick which will register the trigger after a specific time delay. That way, you can control what triggers get registered first. Note that registered codes will always execute before registered triggers.
I actually updated my own local copy that added new features like Damage.lockAmount() and fix a bug that occurs when unit with very very high hp (>70k) takes a small damage but too lazy too update the thread.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
I'm not sure what do with mine at the moment. The trick I do in it to capture damage after it is applied doesn't detect small amounts of damage ;/. Pretty much everyone else uses a timer, which breaks GetWidgetLife.

Eh, if I get back into vJASS coding a bit, we'll see if I can fix it, but for now, I wouldn't recommend using mine : P. Mine does have the most features. It also has a much more advanced trigger priority system than what you are going to be used to (see Trigger in my resources under the Spells section). Again though, one of the cool features I came up with for it that also puts it ahead of the competition is currently broken >.>.



Bribe's is going to be less feature rich and less optimal. It is built for GUI users. It is the most used because it has a great GUI interface.

looking_for_help's was the first to be able to differentiate between magic and physical properly. However, it does have pretty sloppy coding (if you read the code) and it isn't going to be as optimal or clean as other ones.

Flux seems like the best choice. However, Flux is using life change event like mine does. Maybe he managed to fix it? Or maybe he just didn't happen to see the bug. He does keep mentioning that .01 is the minimum amount of damage allowed. Maybe anything less will just trip up his DDS?

Also, his bucket system for trigger refreshing isn't as good as my old heap solution. Why he doesn't just use my little macro and take out the unit indexer disable/enable line I'll never know ; P.


See heap solution as a usable resource complete with a tiny 8 line implementation of a highly optimal DDS here -> JASS/script.j at master · nestharus/JASS · GitHub
 
Level 11
Joined
Sep 14, 2009
Messages
284
Why is Dusk's IDDS outdated? I've used it for a long time now and I've never had any crash or problems with it. I switched to it from Bribe's which caused a lot of problems and had so many exceptions for abilities that was annoying to take into consideration. But that's just my opinion.

EDIT: Oops didn't look at the date. Sorry for necropost.
 
Rising Dusk's IDDS uses an insertion sort to sort out triggers, which means that if you have 50 registered damage triggers, it will take at most 50 look-ups to sort it back.

If we go out of the HiveWorkshop for a while, we have @Jesus4Lyf's Damage, which requires Event and AIDS (Also by @Jesus4Lyf)

Bribe's DamageEngine is designed for GUI users, and should not have too many flaws, if any. (whether using GUI or JASS).

looking_for_help's DDS was another breakthrough which allowed users to hard-codedly detect whether or not an attack is a spell based on the sign of the damage. Also, as remarked by @Flux,

I realized I need a vJASS DDS that can distinguish Physical and Magical Damage. Physical Damage Detection System (PDDS) by looking_for_help is the only candidate so I initially used it. However, there are things I don't like about PDDS:
(No offense to lfh)

- Not modular enough
When a user doesn't need the damage modification feature, PDDS still uses extra computation for it.

- Has room for microoptimization
Can be improved such as only using 1 hashtable read and write with a struct instead of putting source, target, amount, etc to each of their own hashtable space.

- Looks outdated
Doesn't use UnitAlive and uses a trigger with variable changes value event to trigger registered function calls.
Also, lfh wasn't as good as he is now when he created PDDS (PDDS.source/target/damageType is not readonly).

etc, etc..

Flux's Damage Package and Nestharus' DDS are the Damage Detection Systems which I haven't used yet, as I've coded my own DDS from scratch (A little bit based on most of these without the spell differentiation)

Anyway, Dusk's IDDS was created during the mid 2000's, which means that it does not attempt to take advantage of the spell differentiation technique pioneered by looking_for_help, (according to @Jesus4Lyf,) is not recursively-defined, and would fail.
 
Status
Not open for further replies.
Top