Question for advanced users

Yoww89

New Member
Reaction score
0
My map has a trigger that will run basicly every time a hero damages another unit making a dummy unit to add an effect to the Hero's attack.
Which is better/faster:

Option 1: Create a dummy for each run of the trigger adding an expiration timer to it.

Option 2: Have one dummy created for each hero and stored in an unit array so for each run of the trigger I'll just move it instantly to the triggering hero's location and add the effect.

Or maybe another option better than both of these?
 

vypur85

Hibernate
Reaction score
803
Either way is just as fast. But of course Option 2 would be better because you don't create too many units that will burden the performance. Then again, it still depends on what you are doing. Showing the trigger or describe the ability would help a bit (in case alternatives can be suggested).
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
The first one will be worse performance wise because creating units is the most time consuming task in a wc3 map.
If you tell us exactly what kind of effect the dummy does you might even need no more then 1 dummy unit on the map.
 

Yoww89

New Member
Reaction score
0
Well I'm adding orbs/buff placers to Hero's attacks using a dummy unit to avoid the wc3 limitations.
1 dummy unit on the map is impossible since the delay between ordering it to attack the target and the attack actually hitting is always 0.110 (even with instant attack, damage point = 0.00 and ms = 0)
I guess I'll have to stick with option 2 too since option 1 would leave the Hero's dummy somewhere on the map attacking/aquiring targets. The worker classification leaves that damn idle workers icon on the screen and the attack-once order doesn't trigger all orb effects, only spells based on searing/poison/... arrows.
The only way I see option 1 working would be making the dummy a neutral victim and using timers to move the dummy immediatly after the first attack to stop the consequent attacks.
In fact, as I wrote, it began to look like a good option, although I would need to use a hashtable since I don't use vJass.
What do you guys think?
 

tommerbob

Minecraft. :D
Reaction score
110
If you are using a dummy caster to simply add buffs to units, you only need 1 in your map. And why would you give it the worker classification? Also, your dummy caster should not be attacking units, if it is, you set it up wrong.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
If you are using a dummy caster to simply add buffs to units, you only need 1 in your map. And why would you give it the worker classification? Also, your dummy caster should not be attacking units, if it is, you set it up wrong.

Maybe he is talking about buffs which are only given by passive abilities which trigger when attacking. Although i currently cannot think of any by heart.
 

Yoww89

New Member
Reaction score
0
Maybe he is talking about buffs which are only given by passive abilities which trigger when attacking. Although i currently cannot think of any by heart.

Exactly. But even if I were using spells instead of attacks to apply the buff the delay between the order been issued and the spell actually hitting is still 0.110 seconds (I think).

And I am using attack buff placers mostly because there's no spell to apply a frost/cold/slowed buff that you can specify the % of slow for each level and still get the blue color effect. For -armor buff placers, faerie fire gives you vision of the unit, inner fire makes the buff positive, howl of terror is an area of effect spell and acid bomb causes too many damages events (3 on cast and the DoT).
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Exactly. But even if I were using spells instead of attacks to apply the buff the delay between the order been issued and the spell actually hitting is still 0.110 seconds (I think).
Thats wrong. If you set the animation times in the object editor you can make it absolutely instant. Same goes for attacks.

And I am using attack buff placers mostly because there's no spell to apply a frost/cold/slowed buff that you can specify the % of slow for each level and still get the blue color effect.
This is most likely a bug in the wc3 engine because the way the frost-slow effect was scripted it should always use the global constants. wc3 is not the best product to show off for blizzards developers.

For -armor buff placers, faerie fire gives you vision of the unit, inner fire makes the buff positive, howl of terror is an area of effect spell and acid bomb causes too many damages events (3 on cast and the DoT).
I cannot think of any right now either but you could always simulate that with a passive armor reduction ability given to the target.
 

Slapshot136

Divide et impera
Reaction score
471
you can enter negative values for armor buff on inner fire, that or use acid bomb and remove the poison/splash
 

Yoww89

New Member
Reaction score
0
Thats wrong. If you set the animation times in the object editor you can make it absolutely instant. Same goes for attacks.

Please point me out what's wrong at this map then.

you can enter negative values for armor buff on inner fire, that or use acid bomb and remove the poison/splash

In my previous post I just explained why I don't want to use either of these spells.

EDIT: Press esc and see the delay between issuing the order and the damage actually being applied.
 

Attachments

  • test.w3x
    24.2 KB · Views: 251

Slapshot136

Divide et impera
Reaction score
471
there seems to be some sort of built-in delay, look at this modified map - the delay should be 0, as the trigger does the damage instantly, but there is still a delay of about .1 on average

you might need to create the dummy when the attack is issued, and remove the effect if the attack is cancelled and does not connect, in order to sync the two
 

Attachments

  • test-2.w3x
    24.5 KB · Views: 249

Yoww89

New Member
Reaction score
0
there seems to be some sort of built-in delay, look at this modified map - the delay should be 0, as the trigger does the damage instantly, but there is still a delay of about .1 on average

WOW!
Actually the damage is being dealt instantly, you can easily check it. But the TestTimer is just going nutz! o.o'
It displays the 0.000 for the first run but then it gets completely insane and starts shooting random number from 0.750~3.500 (always with the 0.025 multiplier ofc) from what I noticed.

Can any mod give us some enlightment here?

EDIT: It's deffinely some kind of bug with TimerGetElapsed() and the 0.000 elapsed time!

EDIT2: After a hell lot os tests I have the results!! And I'll be posting them as a new thread in the case someone go into this problem, making it easier to find the answers.
 

tommerbob

Minecraft. :D
Reaction score
110
I still don't understand why you are having a dummy unit attack a unit. Why can't you detect when your real unit does the attack instead?
 

Yoww89

New Member
Reaction score
0
I still don't understand why you are having a dummy unit attack a unit. Why can't you detect when your real unit does the attack instead?

I already do that, but how would I apply the buff without a dummy unit??
 

tommerbob

Minecraft. :D
Reaction score
110
I get the feeling we are on separate pages, lol. If I understand you correctly, you have one of three options:

1. You apply the debuff to the target directly with a dummy caster and a fake ability. An example of this is using Acid Bomb for negative effects, or Inner Fire for positive effects. No orb effect needed.

2. You give the dummy ability to your unit. This is based on an orb effect, such as "Item Attack Corruption Bonus" for applying a negative armor debuff. Then detect when the unit deals attack damage, and remove the ability. If the ability has an icon, you can hide it inside a spell book.

3. You use auras. For example, if you want a unit to have a negative armor debuff, you can use a Devotion Aura with negative values. Simply add/remove it from the unit. No orb effect needed. A note about auras: When you remove an aura, the buff will stay for another 1-2 seconds. You need to manually remove the buff also if you want it instantly gone.

In any of these cases, you do not need to detect when an attack occurs.
 

Yoww89

New Member
Reaction score
0
1. You apply the debuff to the target directly with a dummy caster and a fake ability. An example of this is using Acid Bomb for negative effects, or Inner Fire for positive effects. No orb effect needed.

Then again
For -armor buff placers, faerie fire gives you vision of the unit, inner fire makes the buff positive, howl of terror is an area of effect spell and acid bomb causes too many damages events (3 on cast and the DoT).


2. You give the dummy ability to your unit. This is based on an orb effect, such as "Item Attack Corruption Bonus" for applying a negative armor debuff. Then detect when the unit deals attack damage, and remove the ability. If the ability has an icon, you can hide it inside a spell book.

What about the unit having more than one orb effect? I'm doing these to avoid the wc3 orb/buff placers limitations as I said in post number 3.
Even IF I would use just the first orb effect on inventory for each unit, when the damage event triggers, removing the other orbs won't affect the attack. Just like adding damage when the unit takes damage event triggers - it's too late, the amount of damage is already set as well as the orb that will override the others. These calculations are made when the unit actually ATTACKS, but are only applied with the DAMAGE.

3. You use auras. For example, if you want a unit to have a negative armor debuff, you can use a Devotion Aura with negative values. Simply add/remove it from the unit. No orb effect needed. A note about auras: When you remove an aura, the buff will stay for another 1-2 seconds. You need to manually remove the buff also if you want it instantly gone.

Yea, sure. It's a possibility for the corruption orb.
But, in addition to the problems that I would have to control all durations throught timers and trigger purge to remove the aura, the real issue is the 2 auras of the same level bug (like my corruption orb-aura based level 2 not stacking with a legit Devotion Aura level 2)

In any of these cases, you do not need to detect when an attack occurs.

It's an attack orb/buff placer. So it's placed ON ATTACK damage.
HOW would I not need to detect when the attack occurs??
 

Slapshot136

Divide et impera
Reaction score
471
how about this: when a unit takes damage, give them an ability based off the item ability + armor, that has negative values to reduce the armor, set the level, create a timer, save the unit, and then in 2-3 seconds remove the ability
 

Yoww89

New Member
Reaction score
0
The only problem with that Slapshot would be the lack off a debuff, for both the visual and the easy "purgeability" if you get what I mean.

But you guys gave me so much ideas that I think I finnaly got it. Back to testing! :)
 

tommerbob

Minecraft. :D
Reaction score
110
It's an attack orb/buff placer. So it's placed ON ATTACK damage.
HOW would I not need to detect when the attack occurs??

No, you should detect it on taking damage, not attacking. Those are two distinct events. You need a damage detection system for this. Also, it introduces a whole new set of problems if you want to distinguish between spell and attack damage. But if you want it accurate, this is the only way to go.
 

Yoww89

New Member
Reaction score
0
Well, it's definely a communication problem. Maybe I did not make it clear enough.

Let me try again:

>>I am already using the damage event

>>NONE of my triggers use the attack event

Also, it introduces a whole new set of problems if you want to distinguish between spell and attack damage. But if you want it accurate, this is the only way to go.

I know that, that's why all my spell's damage is triggered.

Anyway, making the buff placer trought a dummy unit's attack has proven to be quite bad. Since there's a notable delay between the trigger order action and the actual damage event as I proved here: http://www.thehelper.net/forums/showthread.php/171051-Delay-for-Attack-Attack-Orders

The buff placer trought spells it's the more viable way, since:
It's in fact instant;
Don't require me to stop the dummy after every single attack order;
Even allow me to disable the dummy's attacks so it won't be acquiring targets trough the map.

BUT it has cons too:
Finding the best spell to fit the buff placer I want. (They always have some undesired effects as I described on post 3);
The fact that the buff placer from the dummy won't stack with the base ability I used.
The -amor issue, where the first attack will place the buff but won't take the -armor in count for the damage calculation.

I hope this time I was clear enough :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top