"Periodic" lag

CBBPhoenix

New Member
Reaction score
1
Hi guys

One of heroes in the map I am working on has an ability which requires some periodic events.

The events are used for checking whether an enemy unit has a buff that comes from an auto-attack orb effect (based on Black Arrow) and orders a dummy unit to cast a spell on the target. The problem is that when many units are in the map at the same time, which happens very early in the game (it is a 3v3v3v3 footmen frenzy style map), the game becomes laggy every 1 second, which is the time fro the periodic checking event.

I have already increased the time from 0.4 to 1, but it still becomes laggy; are there any solutions for this?

Thanks in advance :)
 

Rushhour

New Member
Reaction score
46
I guess the trigger creates one or more units every 1 seconds?
Maybe you can just create one unit and move it (Set UnitX /SetUnitY).

If it's getting more and more laggy over time you probably have some leaking variables too, show the trigger ;)
 

kaboo

New Member
Reaction score
45
try to explain the skill more detaily, and also show the trigs.


from what u've posted, you say it's like footmen frenzy, so everyone has more than 20 units, that's more than 240 units at a time on the map, and you want to create a dummy unit on all of them every second? thats a bit crazy and proly the reason of lags ... x)
 

CBBPhoenix

New Member
Reaction score
1
Triggers

My trigger deos not create a unit for each enemy unit :p I have not made this yet but I intended that when the hero that requires the trigger is picked (1 of each hero-type) the required (15; 3 skills which can be leveled up to level5) dummy units should be created at center of map. Currently the units have been placed already since I have not yet made Taverns; the triggers are currently fit for these pre-placed units.
The periodic event should only cause them to check whether a unit has the initiating buff, which should help them recognize the unit and target it with the spell (for example Silence). Posting triggers as requested:
Trigger:
  • Time - Every 1.00 seconds of game time
    • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) has buff Paralyzing Arrows ) Equal to True)) and do (Set stunarrowtarget = (Picked unit))
    • If ((Level of Paralyzing Arrows for (Random unit from (Units in (Playable map area) matching ((Level of Paralyzing Arrows for (Matching unit)) Greater than 0)))) Equal to 1) then do (Unit - Order REALSTUNEFFECTER 0094 <gen> to Human Mountain King - Storm Bolt stunarrowtarget) else do (Do nothing)
    • Wait 0.25 seconds
    • Set stunarrowtarget = No unit



stunarrowtarget is a unit variable, and as you mgiht have guessed, the target of the orb affected attack from the hero itself. (The orb effect itself does nothing) REALSTUNEFFECTER is the dummy unit which has a storm bolt based ability without damage and 10000 cast range and missile speed.

I hope this solves something :p
 

Rushhour

New Member
Reaction score
46
ehm, as far as I see your stunarrowtarget is a Unit variable. (Edit: you said so, didn't see it :D) How do you expect to put more than one unit in a non-array unit variable?
Do you know some jass? Then you could set all these units to a unitgroup and do a ForGroup Action (which actually is a loop that does actions for each unit in this group)

To do it in normal GUI, you can try to combine the actions :

Custom Script(set bj_wantDestroyGroup =true) (fixes the groupleak, not sure about the units)
Pick every unit...has buff Paralyzing Arrows) Equal to True)) and do (I don't get your condition, you have to include that somewhere here) Unit-Order Realstuneffecter 0094<gen> to Human Mountain King - Storm Bolt <Picked Unit>)
 

kaboo

New Member
Reaction score
45
ok, now i see it like this:
-you want a trigger that will stun the unit(s) that are affected by paralyzing arrow

if im right then u dont need to check it every second, just do this
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to paralyz arrow
    • Actions
      • Unit - Create 1 dummy for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Add Real Stun to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)


also some expiration timer would be great >)
 

CBBPhoenix

New Member
Reaction score
1
Erm sorry Rushhour but I don't know any Jass :(. Neither do I exactly get the unit array thing. What does it do?

My condition just checks to make sure which level the hero's ability is so that the right dummy unit uses the right ability, to ensure that the target unit won't be stunned for 4 secs at lvl 1 but at lvl 5.

The problem with the trigger suggested by kaboo is that it works perfectly when actively using the arrow, but not on autocast which really annoys me. If you know how to make it work on autocast the periodic problem would be fixed :D
 

PrisonLove

Hard Realist
Reaction score
78
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to paralyz arrow
    • Actions
      • set TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 dummy for (Owner of (Triggering unit)) at (TempPoint) facing 270.00 degrees
      • Unit - Add Real Stun to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Custom Script: call RemoveLocation(udg_TempPoint)


That will give you your leak-less dummy trigger.
 

kaboo

New Member
Reaction score
45
i hope this will solve the autocast problem:

1. - trigger that detects activation of autocast paralyz arrow
Trigger:
  • activate {initially on}
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(neutral dark ranger - activate black arrow))
    • Actions
      • Trigger - Turn on use activated &lt;gen&gt;
      • Set darkranger = (Ordered unit)


2. - trigger for stuns when activated auto cast
Trigger:
  • use activated {initially off}
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to darkranger {variable declared in activation}
    • Actions
      • Unit - Create 1 dummy for (Owner of darkranger) at (Position of (Attacked unit)) facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Real Stun to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)


3. -trigger for detection of deactivation of auto cast
Trigger:
  • deactivate {initially on}
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(neutral dark ranger - deactivate black arrow))
    • Actions
      • Trigger - Turn off use activated &lt;gen&gt;


also keep the one that works when u target units yourself >)
 

CBBPhoenix

New Member
Reaction score
1
To PrisonLove: Isn't that trigger only going to work on active ordering?

To kaboo: hmm that sounds really good :D gonna check it and return. Just one thing, (and probably also antoher problem for another thread): the Hero has 3 skills based on black arrow and one based on cold arrows. The order strings will override each other (which they already do now when activating og actively casting the arrows). I have tried changing the order string but WE seems to not bother about this at all.

Anyways if this works for a single black arrow (if the Hero had no other black arrow based abilities) I'm definately going to approve :p

EDIT: By the way, when using your trigger, (if it works) I don't have to use black arrows for all skills (used them for buff identification for the dummy), might just use searing arrow and for instance incinerate for the two other skills currently being black arrow-based. So np then :D

EDIT: One word: Evasion. That is going to be a problem since a unit is detected as attacked even though it is not hit. So either I must accept that the effect will always work even though the attack is evaded or else something very difficult must be done T_T
 

Rushhour

New Member
Reaction score
46
I didn't read through all the posts above sorry, is your problem solved? ^^

For the order string thingy: There are only little skills where you can freely choose the Order-ID. I use Channel for all my skills, since you can set the grafic effects, the target type (point target, unit target, ...) and much more. But then channel is only a "dummy" ability that does nothing but activating a trigger when cast.

If you still need to solve the first problem I could write it, but maybe the triggers above already helped you.
 

CBBPhoenix

New Member
Reaction score
1
Testing done

OKay I've tested your trigger and it kinda works as intended (added some waiting time so that the target doesn't get stunned immediately). Problems are: the target gets stunned even though the Hero doesn't have enough mana for the spell, and it also requires for the ability to have no cooldown, (which it of course does have :banghead:(I don't like everstun:)))
It might be able to add a real condition saying something about mana of "darkranger" equal to (required amount), and then action, but I don't know if this trigger can be tricked some way and taken advantage of to cause imbaness ingame :-/

And for cooldown and evasion problems; I am clueless :(

But thanks for the trigger, I think that is a good way of solving the autocast problem, just needs some troubleshooting :-/
 

kaboo

New Member
Reaction score
45
-evasion - i will think about it and tell you tommorrow
-cooldown - how long is the cooldown?
-mana - thats simple (hope it will work)


Trigger:
  • use activated {initially off}
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to darkranger {variable declared in activation}
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Attacking unit)) Greater than or equal to xxx {xxx=mana cost of black arrow}
        • Then - Actions
          • Unit - Create 1 dummy for (Owner of darkranger) at (Position of (Attacked unit)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Real Stun to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
        • Else - Actions
 

Light Alkmst

New Member
Reaction score
20
I just read the beginning, but if you just want to check when the buff is applied, use Unit is Damaged events. One trigger detects whenever a unit enters the map and adds the Unit is Damaged event for that unit to the second trigger. The second trigger just checks if the damaged unit has the buff, removes it, and activates accordingly. I'm not sure how laggy it would be in a Footman Frenzy map with lots of attacks, but it's worked very well so far...

Periodic check:
Must run through all units
Effect will have delay

Damage check:
A little messy code-wise
No effect delay
 

CBBPhoenix

New Member
Reaction score
1
To Light Alkmyst: I am not sure what you mean, can you give a trigger example?

To kaboo: The cooldown should be 2.5 sec minus 0.3 sec/level
 

kaboo

New Member
Reaction score
45
this should work for the cooldown
Trigger:
  • use activated {initially off}
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to darkranger {variable declared in activation}
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mana of (Attacking unit)) Greater than or equal to xxx {xxx=mana cost of black arrow}
        • Then - Actions
          • Unit - Create 1 dummy for (Owner of darkranger) at (Position of (Attacked unit)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Unit - Add Real Stun to (Last created unit)
          • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Target unit of ability being cast)
          • Trigger - Turn off (This trigger)
          • Wait xxx{cooldown} seconds
          • Trigger - Turn on (This trigger)
        • Else - Actions

and to the evasion - i dont think that its possible to check if attack was evaded or not, and if its, i dont know how to do it
 

CBBPhoenix

New Member
Reaction score
1
Okay

Sounds good. Just one question, when the trigger is turned off, won't it restart over and over, since no matter how low the cooldown will be (even 0 sec) it will still turn off the trigger and on again. Don't know if this is true, I am going to check it :p
 

kaboo

New Member
Reaction score
45
when the spell will reach CD 0 just turn of this trig forever and run another that will be the same as this except the turning off and on >)
 

CBBPhoenix

New Member
Reaction score
1
thanks for your help

I have kinda given up but I really thank you for your help and trigger suggestions. :D
 
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