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

Damage Detection System

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Hi all.

I am currently creating my own DDS (for some nice reasons).

But first of all I would like to ask what existing DDS is the best and why.
So here I come: What existing DDS is the best and why?

Also is there anything to get specific data like Damage-Type from the event "Unit takes damage"?

There are some features I want to give it.

EDIT: Also what the hell is the boolean from UnitDamageTarget()?
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Bribe:

Best performance in GUI
Poor features GUI
Bad lifebars
Bad life
Simplest
Few dependencies
Easiest to learn

Lfh's:
Worst performance
Best features GUI
Good features vJASS
Worst coding
Good lifebars
Bad life
Least modular
Few dependencies

Coke:

Best performance (depends)
Ok-Good features
Bad life
Bad lifebar
Good code
vJASS Only
Most natural design
Most modular
Few dependencies
2nd best architecture

Nestharus:

vJASS only
Best features (most)
2nd best to best performance
Good lifebars
Good life
vJASS Only
LOTS of dependencies
Best code
Most complex
Hardest to learn
Most modular
Best architecture

Which one has what you're looking for? Everyone has their own prefs.


I recommend you study all four in the order above.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yea I am now busy discussing stuff about LFH's system.
I have seen some stuff but there are many things that are done that could be removed.

I will take a look at Bribe's this afternoon.
I can't find your DDS in the spell section neither a user that is named Coke.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well I cannot read or modify vJASS :)
I never really worked with vJASS and I got an outdated NewGen.
But can either of those systems tell wether the attacker was melee/ranged or was a spell?
Without registering data for every unit and using something like <0 damage for spells.
Like in the one of Looking_For_Help?

I can detect any damage and I can tell if that damage comes from a basic attack of a melee unit.
I am trying the best I can to achieve the same for ranged units because once I got that, I can assume that if both are false, the damage was from an ability.
Of course I would exclude coded damage but that is obvious :)
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
None of these will say if it was melee or ranged attack, and all of them(or additions to the systems made by the same person) will tell you if it was spell or not.

Melee/ranged attack is really, really, really hard to do properly and glitch-free
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
None of these will say if it was melee or ranged attack, and all of them(or additions to the systems made by the same person) will tell you if it was spell or not.

Melee/ranged attack is really, really, really hard to do properly and glitch-free

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (TempUnit is A melee attacker) Equal to True
    • Then - Actions
      • Game - Display to (All players) the text: ((Name of TempUnit) + is a melee attacker.)
    • Else - Actions
      • Game - Display to (All players) the text: ((Name of TempUnit) + is a ranged attacker.)
Works fine for me...
But for that I still have to know if it was a basic attack that dealt the damage.
The system of LFH can do that but it removes the spell reduction of WC3.
Next to that, some spells must have negative values because they are not reduced by the spell reduction.

Next to that:
I have got another question:
Is there a way to know what damage type abilities have?
Or is there a list with the damage types of abilities?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Actually I have a different and problemless way of how I get a melee unit attack event.
If someone takes damage and it is not the melee attacker, it is either a spell or a ranged unit.

But to come back to my question:
But can either of those systems tell wether the attacker was melee/ranged or was a spell without registering data for every unit and using something like <0 damage for spells?
Like in the one of Looking_For_Help?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Yea I am now busy discussing stuff about LFH's system.
I have seen some stuff but there are many things that are done that could be removed.

Like for example? I'm really interested now.

Also you should first try to understand how DDSs with type detection support work before throwing around with wild (and wrong) assumptions like "He is restricting people", "Limiting map makers" or "Why do you restrict people not to use wait timers?".

Before you can criticizes anything (that not only applies to DDS but in general), you first have to know what you are talking about. And you obviously don't.

Well I cannot read or modify vJASS :)
I never really worked with vJASS and I got an outdated NewGen.

Then update?

But can either of those systems tell wether the attacker was melee/ranged or was a spell?
Without registering data for every unit and using something like <0 damage for spells.
Like in the one of Looking_For_Help?

No. You could use elunes grace instead of runed bracers to detect piercing damage. But that still won't help you, because first you wouldn't be able to distinguish physical and spell damage and second you still could not detect non-piercing ranged damage like mortars.

I am trying the best I can to achieve the same for ranged units because once I got that, I can assume that if both are false, the damage was from an ability.

Why would you need that? If the damage was spell, it was from an ability, so a standard damage type detection should already be sufficient to do that?


Actually I have a different and problemless way of how I get a melee unit attack event.
If someone takes damage and it is not the melee attacker, it is either a spell or a ranged unit.

Thats what damage type detection is for. And has absolutly nothing to do with the attacker being melee or ranged. Pure melee units without any abilities can also deal spell damage (spirit link et al), so you can't make assumptions like that. Learn the basics, then ask again.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Also you should first try to understand how DDSs with type detection support work before throwing around with wild (and wrong) assumptions like "He is restricting people", "Limiting map makers" or "Why do you restrict people not to use wait timers?".

Before you can criticizes anything (that not only applies to DDS but in general), you first have to know what you are talking about. And you obviously don't.
Give me one reason why you use Conditions instead of Actions if it is not for the performance.
Actions can handle wait timers, Conditions cannot.
So you make sure that if people use wait timers, they get an bug.

Then update?
I never use vJASS. I prefer to make my stuff so everything is configurable in GUI and the system in JASS.
Everyone without NewGen can use it, everyone without JASS knowledge can use it.
I only need vJASS to edit maps or use systems of other people.
I could update I suppose but it took me 12 installs to have it actually installed.
And since then NewGen didnt have an update... I don't have any idea why I got an outdated version.

No. You could use elunes grace instead of runed bracers to detect piercing damage. But that still won't help you, because first you wouldn't be able to distinguish physical and spell damage and second you still could not detect non-piercing ranged damage like mortars.
Thats a pity.

Why would you need that? If the damage was spell, it was from an ability, so a standard damage type detection should already be sufficient to do that?
Because then I can do it without removing the standard spell reduction stuff from WC3.

Thats what damage type detection is for. And has absolutly nothing to do with the attacker being melee or ranged. Pure melee units without any abilities can also deal spell damage (spirit link et al), so you can't make assumptions like that. Learn the basics, then ask again.
Same as above. If this works, I can detect damage without removing the standard spell reduction stuff from WC3.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Works fine for me...

Because you didn't test it well enough.

Give me one reason why you use Conditions instead of Actions if it is not for the performance.
Actions can handle wait timers, Conditions cannot.
So you make sure that if people use wait timers, they get an bug.

DestroyTrigger is only considered safe if no sleeps are used within a callback. Otherwise you might get a handle stack corruption. The most natural and safest thing to ensure this is to use trigger conditions.


Because then I can do it without removing the standard spell reduction stuff from WC3.

Same as above. If this works, I can detect damage without removing the standard spell reduction stuff from WC3.

You don't have to remove it? You just have to include one single trigger that checks for this specific item. Thats a work of maybe 5 minutes. If your only rationale for writing a new DDS is to remove one setup step that takes about 5 minutes, then good luck with that.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Because you didn't test it well enough.
That is indeed true. edo494 explained why.

DestroyTrigger is only considered safe if no sleeps are used within a callback. Otherwise you might get a handle stack corruption. The most natural and safest thing to ensure this is to use trigger conditions.
In that case we can create a doubled trigger.
Switch between those two when we should destroy the active one and instead destroy it when you switch back to the first.
I doubt people will use wait timers above 300 seconds. If they do they can configure the maximum supported wait timers.

You don't have to remove it? You just have to include one single trigger that checks for this specific item. Thats a work of maybe 5 minutes. If your only rationale for writing a new DDS is to remove one setup step that takes about 5 minutes, then good luck with that.
I dont completely understand what you just said...
I do not write a new DDS only because of that. There are some nice features that I want to add too. Like:
- Adjusting attack-type and damage-type.
- Allowing control of which unit will actually take the damage (instead of the original unit)
- Creating 2 events: "A unit is about to take damage" and "A unit has just taken damage"
- Make a real value as an ignore armor factor
Some more if there come more ideas.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
In that case we can create a doubled trigger.
Switch between those two when we should destroy the active one and instead destroy it when you switch back to the first.
I doubt people will use wait timers above 300 seconds. If they do they can configure the maximum supported wait timers.

And how would I know there are no more pending waits when destroying the trigger? While waiting for the 300 seconds to exceed an arbitrary amount of new damage events could occure, each again triggering a new wait. Thats just as bad thought through as your melee/ranged "detection".

I dont completely understand what you just said...

Yes and thats the problem. Therefore again: learn the basics before judging about other people work.

- Allowing control of which unit will actually take the damage (instead of the original unit)

Thats already implemented in (nearly) all existing DDS.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
And how would I know there are no more pending waits when destroying the trigger? While waiting for the 300 seconds to exceed an arbitrary amount of new damage events could occure, each again triggering a new wait. Thats just as bad thought through as your melee/ranged "detection".
First of all: I dont use "Unit is a melee/ranged attacker" to detect if a unit is melee or ranged.
Secondly: You misunderstood the concept.
I hope that my OP paint skills are enough to get the picture.

Yes and thats the problem. Therefore again: learn the basics before judging about other people work.
Ok

Thats already implemented in (nearly) all existing DDS.
Same as some have the 2 events, but still.
Recalculating and reapplying armor?
Using different attack-type and damage-type?
Next to that I will make it especially for other systems that I will make.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
If you wait and dont shadow variable, you will have bugs as well, and far far worse ones. Also there is edit button, dont double post.

If you think these all are severe problems, go on and make your own DDS which will overcome all these obstacles.

And please, research something before bitching, as said.

LFH is actually the one that came with the very method of checking if damage is from attack or ability. And there is currently no way to say if it is ability without using runed bracers or eluned grace, because how else do you think you can say if damage comes from ability?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
First of all: I dont use "Unit is a melee/ranged attacker" to detect if a unit is melee or ranged.

Of course not, as it doesn't work. I also didn't say you would?



No, you misunderstood the problem with your concept. Waiting n seconds doesn't help, because during that period new damage events can occure. You have no method to determine whether a pending wait will trigger a new damage event on the current active trigger, which might again result in a new wait exceeding your wait time of n seconds.

Your picture is wrong, because the block "running effect from trigger" can potentially be infinitly long if waits are involved.

Same as some have the 2 events, but still.

Really? Which one? All available DDS (Bribes, Cokes, Nestharus, mine and Weeps) use trigger conditions, for the provided reasons.

Recalculating and reapplying armor?
Using different attack-type and damage-type?

Yes...
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
If you think these all are severe problems, go on and make your own DDS which will overcome all these obstacles.
You should read the first post.

And please, research something before bitching, as said.
Did I forgot to tell that I am toxic as hell?

LFH is actually the one that came with the very method of checking if damage is from attack or ability. And there is currently no way to say if it is ability without using runed bracers or eluned grace, because how else do you think you can say if damage comes from ability?
For now.

Of course not, as it doesn't work. I also didn't say you would?
No but you said that I check if a unit is melee or ranged is wrong... I never showed you how I do it... How can you be so sure it is wrong?

No, you misunderstood the problem with your concept. Waiting n seconds doesn't help, because during that period new damage events can occure. You have no method to determine whether a pending wait will trigger a new damage event on the current active trigger, which might again result in a new wait exceeding your wait time of n seconds.
Do you mean that the code in the DDS after you set the event to 1 (or another integer) will also wait until the wait timer is over?
In that case I can tell you (I was afraid too for a moment) but it works fine.

Your picture is wrong, because the block "running effect from trigger" can potentially be infinitly long if waits are involved.
That is true but as I said the 300 will be GUI configurable as it will be a variable.
Also you only need the maximum time that a wait that runs from this event as that variable.
My system can handle 40k units before destroying the performance... 40k events.
You will never get 40 units in 5 minutes will ya?
Next to that... I just tested a 6 seconds wait timer while the system re-initializes every 5 seconds of game time. (DestroyTrigger() + CreateTrigger() etc)
It runs perfectly.

Really? Which one? All available DDS (Bribes, Cokes, Nestharus, mine and Weeps) use trigger conditions, for the provided reasons.
It seems that I must be more clear.
Event - A unit takes damage -> before damage
Event - A unit has taken damage -> after damage
Not hard to implement.
You could use the second for damage display for example because you want to get the damage that is actually removed from the units health...
If you change the attack-type, damage-type and armor value, the damage is different. Next to that if you use the same event, the display could occur before the damage is modified by other triggers.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
ok I can say one last thing, if you use wait, you limit yourself down to triggeractions.

Your system can handle 40k units? wacraft 3 cant handle 40k units, so I strongly doubt that.

There is nothing like "Event - A unit has taken damage" in GUI.

And I dont know if you are aware of this fact, but there is no way that anyone passes locals down the call stack.

The only reason why your wait works with the native damage handler is because Blizzard has source code of the game, and that code is ran, so they can propagate event variables down the call stack, but we cant.

This changes nothing on triggercondition, because even if it was triggeraction, if there is another damage event before your wait ends, the variables will be overriden and you would still need to fall down to variable shadowing.

So I come to conclusion that if you insist on using Waits, then you will have to write your own DDS.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007

Until you have no method, you have no method. As easy as that.


No but you said that I check if a unit is melee or ranged is wrong... I never showed you how I do it... How can you be so sure it is wrong?

You said "works fine for me" on a method that fails in million different ways until edo showed you (just one reason) why. If you would have used 3 seconds to think about it, you would have noticed this on your own. Same applies to your criticism here.

Do you mean that the code in the DDS after you set the event to 1 (or another integer) will also wait until the wait timer is over?
In that case I can tell you (I was afraid too for a moment) but it works fine.

The DDS has to wait with the cleanup until all waits are finished. You can't know whether a wait will trigger a new wait. So you can't know how long you have to wait. Not difficult to understand, right?


Next to that... I just tested a 6 seconds wait timer while the system re-initializes every 5 seconds of game time. (DestroyTrigger() + CreateTrigger() etc)
It runs perfectly.

The handle stack corruption bug is not really reproducable. You can't assume from testing it 5 minutes that its safe to delete a trigger that has actions with waits involved.

It seems that I must be more clear.
Event - A unit takes damage -> before damage
Event - A unit has taken damage -> after damage

Again: Which DDS has this? Hint: none.

Not hard to implement.

You really don't know what you are talking about, I end this discussion now. Good luck with your system.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
ok I can say one last thing, if you use wait, you limit yourself down to triggeractions.
That is true... so you mis 0.0001% performance?

Your system can handle 40k units? wacraft 3 cant handle 40k units, so I strongly doubt that.
I said events. DDS doesnt create units it creates events for every unit.
Mine can handle 40k "(unit) takes damage" events.

There is nothing like "Event - A unit has taken damage" in GUI.
There is also no event like "A unit takes damage" we make them ourselves.
Event -> A unit takes damage -> RealVariable1 becomes equal to 0
Event -> A unit has taken damage -> RealVariable2 becomes equal to 0

And I dont know if you are aware of this fact, but there is no way that anyone passes locals down the call stack.

The only reason why your wait works with the native damage handler is because Blizzard has source code of the game, and that code is ran, so they can propagate event variables down the call stack, but we cant.
My system is almost the same as LFH's. If I can than he can do it too.
I use exacly the same test as you and I don't have a problem.

This changes nothing on triggercondition, because even if it was triggeraction, if there is another damage event before your wait ends, the variables will be overriden and you would still need to fall down to variable shadowing.
You use a local variable after the wait...
It CANNOT be overridden.

So I come to conclusion that if you insist on using Waits, then you will have to write your own DDS.
If you havent noticed yet: I AM.
I am writing my own DDS.
It will have a worse peroformance but it will have extremely good features.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Level 31
Joined
Jul 10, 2007
Messages
6,306
lfh, my DDS has that capability, remember? :)

I don't support it because I want people to use phases of detection, but it can be done, and you even requested I do it. I personally find it to be pointless and nust be extra overhead. The same thing can be accomplished with less overhead with phases.

Also, your idea of before/after is limited. That's the start of phased events.

Events have undergone a few evolutions

Global Dynamic
Global Static
Global Static with Priorities
Fully Dynamic with Phases


You're doing the second evolution atm, which puts you years behind the community.

The DDS with the latest tech can do everything that's possible to do with DDS alone. The next step in combat systems, the step you want, is attack indexing.

Use Bonus to set damage to an instance, store actual values to that instance, and a DDS to apply real damage.

There is no way to do attack indexing for vanilla abilities, but it's trivial for vJASS

Attack indexing still has the problem of attack destruction though.

*edit*
Take a look at Trigger in Spells. Just open the map and run the labs. It'll show you how far behind you are.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I said events. DDS doesnt create units it creates events for every unit.
Mine can handle 40k "(unit) takes damage" events.

My system can handle 40k units before destroying the performance... 40k events.

This post made by you clearly states something else. There is massive difference between unit and unit damage event.

That is true... so you mis 0.0001% performance?

You are the only one talking about performance. Every half-solid vJass system, even Jass systems nowadays will use triggerconditions instead of triggeractions. And while the difference is not significat, do you think hundreds of systems will be changed just because you decided you will not use triggercondition at all cost?

There is also no event like "A unit takes damage" we make them ourselves.
Event -> A unit takes damage -> RealVariable1 becomes equal to 0
Event -> A unit has taken damage -> RealVariable2 becomes equal to 0

Again, there is massive difference between these two, and you are as ambiguous as 2 C++ functions with the same name and one taking int* and another taking char.

My system is almost the same as LFH's. If I can than he can do it too.
I use exacly the same test as you and I don't have a problem.


You use a local variable after the wait...
It CANNOT be overridden.

Show it then, I can also claim shit and have nothing.

Locals: obviously.

If you havent noticed yet: I AM.
I am writing my own DDS.
It will have a worse peroformance but it will have extremely good features.

That is completly fine. I doubt it will beat any of the existing ones in any aspect, but you are free to write whatever you want(I made 2 too, and they were both inferior to all existing ones).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You said "works fine for me" on a method that fails in million different ways until edo showed you (just one reason) why. If you would have used 3 seconds to think about it, you would have noticed this on your own. Same applies to your criticism here.
Yes I did... but there is no way I can detect melee units' basic attacks with this but not ranged unit's. So you could have figured that I used a different method.
Next to the one edo said... I don't really know of any reasons why it shouldnot work. (I never used it so I don't know much about it.)

How I detect if a melee attacker is attacking you I do this:
A unit takes damage.
If the attacker is still attacking the target.
And the attacker has not started attacking a unit since the last time he damaged a unit.
Then it is a melee attacker.
(The unit could also be a ranged attacker when he is standing next to his target. But that could be caught with "Is unit a melee attacker". I suppose.)

The DDS has to wait with the cleanup until all waits are finished. You can't know whether a wait will trigger a new wait. So you can't know how long you have to wait. Not difficult to understand, right?
  • Test Wait
    • Events
      • Game - DDS_Event_Unit_Takes_Damage becomes Equal to 0.00
    • Conditions
    • Actions
      • Custom script: local unit udg_TempUnit
      • Set TempUnit = DDS_Target
      • Wait 6.00 game-time seconds
      • Game - Display to (All players) the text: 6 seconds passed
JASS:
function Init_Damage_System takes nothing returns boolean
    call DisplayTextToForce(GetPlayersAll(), "Initialized the DDS")
    
    call DestroyTrigger(udg_DDS_Trigger)
    set udg_DDS_Trigger = CreateTrigger()
    
//Some more code in between
    
    call TriggerRegisterTimerEvent(t, 5, true)
    call TriggerAddCondition(t, Filter(function Init_Damage_System))
Display:
"DamageEvent = 1" (Called when a unit is taking damage)
"Initialized the DDS"
"6 seconds passed"


The handle stack corruption bug is not really reproducable. You can't assume from testing it 5 minutes that its safe to delete a trigger that has actions with waits involved.



Again: Which DDS has this? Hint: none.
I didn't say "Actions" I said "Events"
In your system it would be this:
JASS:
if rawAmount < 0.0 then
            call DisableTrigger(udg_PDD_damageEvent)
            call DealFixDamage(udg_PDD_source, udg_PDD_target, -rawAmount)
            if ( originalHealth - udg_PDD_amount < udg_PDD_UNIT_MIN_LIFE ) then
                call UnitRemoveAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
                call DealFixDamage(udg_PDD_source, udg_PDD_target, udg_PDD_amount)
                set udg_PDD_After_Damage = 1
                set udg_PDD_After_Damage = 0
            endif
            call EnableTrigger(udg_PDD_damageEvent)
        endif
Then people can use "Game - udg_PDD_After_Damage becomes Equal to 1"
To have an event "A unit has taken damage".

You really don't know what you are talking about, I end this discussion now.
Indeed I don't know what I am talking about... I never run tests, I never use JASS functions, I don't even know what WC3 is...
Thanks for the confidence.

Good luck with your system.
Thanks... I suppose
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Ok

Open the map here

http://www.hiveworkshop.com/forums/spells-569/trigger-v1-1-0-2-a-260933/?prev=status=p&u=Nestharus

Run the labs

Tell me where your ideas for your events are lacking after you do ;)


You can't support the best possible features in GUI. If you want the best tech and best features, you have to go beyond GUI.

Trigger is the de facto gold standard for event handling, and it only works with vJASS. The most you can do for GUI is priorities, which I already did in the pre-Trigger era.

Your method of detecting melee attacks won't work :(. You have to store the data on the attack itself. A DDS can only go so far ;).

There is another techbique for detecting spell damage. It's what we used to use. However, it slows units (buggy wc3) and crashes artillery attacks.


Don't learn from lfh or coke's or anything. If you are after the best tech, check DDS on github. As far as features and algorithms go, it puts the others to shame. Some algorithms were even ripped from it and used in the others ;).

In fact, run through the DDS labs too. It has some events like when a unit deals damage. The others just have when a unit takes damage ;).
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
This post made by you clearly states something else. There is massive difference between unit and unit damage event.
I said 40k events. Of course I didnt test it with units.
I tested it with 2 units with both 1 event and one unit (far away) with 400 more events every second... and then waiting until it starts to run slow.

You are the only one talking about performance. Every half-solid vJass system, even Jass systems nowadays will use triggerconditions instead of triggeractions. And while the difference is not significat, do you think hundreds of systems will be changed just because you decided you will not use triggercondition at all cost?
There are 4 differences between action and condition told to me.
1. A condition requires a boolean return value.
2. A condition is faster.
3. DestroyTrigger() is only considered safe if no sleeps are used within a callback. Otherwise you might get a handle stack corruption. The most natural and safest thing to ensure this is to use trigger conditions.
4. Conditions stop running when they see a TriggerSleepAction().

My thoughts:
1. Seems fair.
2. It might be 0.001 faster but then what?
3. That is if the wait timer is used in the action of the trigger that is removed. I do not so it is no problem.
4. That is not good.

So you tell me what other differences there are and why I should use conditions instead because I don't have the slightest idea why I should use it.

Again, there is massive difference between these two, and you are as ambiguous as 2 C++ functions with the same name and one taking int* and another taking char.
No it is not. The system creates a new event... a trigger uses that event...
You can name the event whatever you want but it has to be "RealVariable comparison to RealValue"

Show it then, I can also claim shit and have nothing.
I will as soon as I got it finished... Not longer than 7 days from now.
(I don't want to be overconfident saying that it is finished tomorrow but it could be.)

Trigger is the de facto gold standard for event handling, and it only works with vJASS. The most you can do for GUI is priorities, which I already did in the pre-Trigger era.

It only works with vJASS???
And how is that supposed to be?

The vJASS concept is the same as the GUI concept:
GUI is a button screen where you can click on actions that will be translated to JASS.
vJASS is a text file where you can write your functions that will be translated into JASS.

So how is something only achievable by vJASS?
Or is the information given to me about vJASS not right and is vJASS its own language?
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
lfh, my DDS has that capability, remember? :)

I don't support it because I want people to use phases of detection, but it can be done, and you even requested I do it.

Yes I remember that ;)
Though still no DDS has this feature and its definitly not "easy to implement" as stated by Wietlow.

How I detect if a melee attacker is attacking you I do this:
A unit takes damage.
If the attacker is still attacking the target.
And the attacker has not started attacking a unit since the last time he damaged a unit.
Then it is a melee attacker.
(The unit could also be a ranged attacker when he is standing next to his target. But that could be caught with "Is unit a melee attacker". I suppose.)

Completly unreliable. You really think we would use the runed bracers trick if it would be so easy? You don't consider things like spirit link, poison, splash, reflection and so on at all. Just pure ignorance.

Then people can use "Game - udg_PDD_After_Damage becomes Equal to 1"
To have an event "A unit has taken damage".

Thats not a real after damage event but (a very limited version) of priorities. Also nothing would prevent users from just modifing the damage amount within such an "after" damage event, making it pointless to have such a thing at all. You can have the same in PDDS with just ensuring that your damage events are executed in the correct order.


Indeed I don't know what I am talking about... I never run tests, I never use JASS functions, I don't even know what WC3 is...

The tone sometimes makes the difference, you know?
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
LFH's code won't get you what you want, but sure.

You won't have

A unit damages another unit
A unit is damaged
Any unit damages another unit

You will only have

Any unit is damged

You'll also break GetWidgetLife


Finally, you won't have special combat system events unique to items, like onDamageAbsorb :(. No DDS has these as they are unique to a map, but one DDS does alloew you to add new stages to it ;).

Finally, if you do your onDamageAfter, it won't run right. It has to run in reverse order, and your triggers won't let you do that.

I guess you'll make a list of triggers then...
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I said 40k events. Of course I didnt test it with units.
I tested it with 2 units with both 1 event and one unit (far away) with 400 more events every second... and then waiting until it starts to run slow.

no, you said 40k units. See the quote as well as the post it quotes.

Condition does not need to return anything, but pjass is buggy and so functions passed into Filter/Condition directly require boolean return type. If you take reference of the function, you no longer need to return anything.

I didnt want to admit this, but the main reason people use conditions instead of actions is the fact that it is that slight percentage faster(Please dont say 0.0001% before you measure, because this is basically spreading myths), but as I said, nowadays everyone uses it, and it also prevents you from using Waits, which are bad, so it is good thing.

In regards to GUI, event is somthing you can find inside the selection for events. There is nothing like "Event - Unit has taken damage", and the fact that you have trigger hooked to variable state change is completly redundant, it is not Event - Unit has taken damage event, since you can take the variable and change its value freely at any time.

How is something only achievable by vJass.

JASS:
native UnitAlive takes unit u returns boolean

function f takes nothing returns nothing
    local booelan b = UnitAlive(someunit)
endfunction

3 things in 5 Jass lines that can not be achieved with pure GUI(Custom script is not GUI per se). One line is unachievable without vJass at all.


I love how you Self propagates your system Nes, but well, I cant say these arent valid points(I cant say this about all, since I havent seen inners of DDS in long time)
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
A unit damages another unit
A unit is damaged
Any unit damages another unit

You will only have

Any unit is damged

I don't think he cares as the only difference this makes is a (very minor) performance gain with the tradeoff of a much higher overall complexity.

I know you lime the idea of not being able to modify damage, but I say just add a no modify phase.

Still no after damage event but just a convention the user has to obey. Not really a breakthrough compared with classical techniques.

You'll also break GetWidgetLife

Yes, thats the very big (and unique) advantage in your system. I really like that, but using a GetUnitLife wrapper isn't also a big deal.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
no, you said 40k units. See the quote as well as the post it quotes.
Yes I said units and events after that... I think that the tone would have made the difference.
Plain DDS (without any actions or calculations) can handle 70k - 73k events.
My DDS coud handle 40k events last time I tested it.

Condition does not need to return anything, but pjass is buggy and so functions passed into Filter/Condition directly require boolean return type. If you take reference of the function, you no longer need to return anything.
Good to know... If I actually understood what you said. :goblin_jawdrop:

I didnt want to admit this, but the main reason people use conditions instead of actions is the fact that it is that slight percentage faster(Please dont say 0.0001% before you measure, because this is basically spreading myths), but as I said, nowadays everyone uses it, and it also prevents you from using Waits, which are bad, so it is good thing.
I will stop saying any percentage but still... You said that there was a differnet reason than the performance... I still don't have it.
Disabling waits is not good. It is bad. As I said I also use waits sometimes.
If the effect is only visual I use it sometimes.

In regards to GUI, event is somthing you can find inside the selection for events. There is nothing like "Event - Unit has taken damage", and the fact that you have trigger hooked to variable state change is completly redundant, it is not Event - Unit has taken damage event, since you can take the variable and change its value freely at any time.

How is something only achievable by vJass.

JASS:
native UnitAlive takes unit u returns boolean

function f takes nothing returns nothing
    local booelan b = UnitAlive(someunit)
endfunction

3 things in 5 Jass lines that can not be achieved with pure GUI(Custom script is not GUI per se). One line is unachievable without vJass at all.
I didn't say that everything vJASS can can also be done in GUI...
I said that vJASS has the same concept of GUI: They both translate into JASS.
There is nothing that vJASS can do and JASS cannot.

------------------------------------------------------------------------------------------
Ok I will use some tricks from LFH's system to finish mine asap.
In my next post on this thread you will finally understand what I am trying to say.

So here is the the map that I have been working on.
There are still some things I have to add/change.
1. Difference between melee and ranged units.
2. Check if the timer of the damage of the unit has expired.
3. Test with abilities like "Defend" and "Hardened Skin".
4. Get unit's standard attack-type and damage-type. (For easier configuration and changing of those variables.)
5. Implement the standard attack-types of standard units.
6. Make armor reduction.
7. Either remove the Runed Bracers stuff or add the spell reduction to the calculations. (This totally depends on if I can manage to get ranged unit attack stuff.)
8. Fix damage loops. (for example when a unit takes damage it deals damage to a target and the event runs again... have to set variables right... will do it at the end when I know all variables.)
9. Make the coded damage stuff.
10. Add documentation, rules and instructions.

Anyway here is a test map.
Remember that it is still unfinished and has some leaks/bad code.

EDIT: Don't mind the 1.4... As a matter of fact I had a plain DDS for a long time and had it changed a few times to 1.4
Mythic might remember that time.
 

Attachments

  • Damage Detection System 1.4a.w3x
    49.3 KB · Views: 55
Level 23
Joined
Apr 16, 2012
Messages
4,041
I didn't say that everything vJASS can can also be done in GUI...
I said that vJASS has the same concept of GUI: They both translate into JASS.
There is nothing that vJASS can do and JASS cannot.

So how is something only achievable by vJASS?
Or is the information given to me about vJASS not right and is vJASS its own language?

JASS:
native UnitAlive takes unit u returns boolean

function f takes nothing returns nothing
    call UnitAlive(null)
endfunction

Good luck declaring and calling this function with JassHelper disabled
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
JASS:
native UnitAlive takes unit u returns boolean

function f takes nothing returns nothing
    call UnitAlive(null)
endfunction

Good luck declaring and calling this function with JassHelper disabled

This piece of code is translated to JASS when you compile the map.
Therefor it is also achievable in plain JASS but only written a bit different.
I don't know what it is in JASS because I don't use vJASS that much.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Yes I said units and events after that... I think that the tone would have made the difference.
Plain DDS (without any actions or calculations) can handle 70k - 73k events.
My DDS coud handle 40k events last time I tested it.
I have a question, where do you get those numbers?

===============

Condition does not need to return anything, but pjass is buggy and so functions passed into Filter/Condition directly require boolean return type. If you take reference of the function, you no longer need to return anything.
I think its the other way around, it's the vanilla parser that's fucked up.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
I have a question, where do you get those numbers?

Sorry I should have said that.
(Mythic might remember those stress tests.)
I have ran some stress tests with a complete empty Damage Detection System where there are 2 units that attack each other and a third that gains a number of "this unit takes damage" events every second.
So after a while it has 70k events. Then it runs slow.

Of course that is only the events.
Then you also have to think about the other stuff that is in your map.
So with numbers and stress tests like these you can find out how long the re-initialize interval may be so it will never run slow.

There is a second performance thing that is when a unit is actualy attacked.
In the map I posted I have 50 - 250 units attacking each other every second.
It also displays how many (maybe that trigger is disabled and you have to enable it)
But I will run stress test on it as soon as it is finished...
I don't assume that my system will have the best performance but I at least want 2k events and 800 unit attacks per second.
If that is met then I can say it is not too cpu consuming to not use it.
 
Status
Not open for further replies.
Top