Major Lag, Leaks?

THE_X

New Member
Reaction score
49
So when i enable these 5 triggers, the game starts to lag bad, i don't know if its a leak i don't see any but i know its these 4 triggers.

Code:
Create Ball
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Demon Ball 
    Actions
        Set Point[1] = (Position of (Triggering unit))
        Set Point[2] = (Target point of ability being cast)
        Set Point[3] = (Point[1] offset by 60.00 towards (Angle from Point[1] to Point[2]) degrees)
        Set MUI = (MUI + 1)
        Unit - Create 1 Demon Ball Dummy for (Owner of (Triggering unit)) at Point[3] facing Point[2]
        Unit - Set the custom value of (Last created unit) to MUI
        Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
        Set Ball_Timer[(Custom value of (Last created unit))] = 10.00
        Set Ball_Caster[(Custom value of (Last created unit))] = (Triggering unit)
        Custom script:   call RemoveLocation (udg_Point[1])
        Custom script:   call RemoveLocation (udg_Point[2])
        Custom script:   call RemoveLocation (udg_Point[3])

Code:
Slide Ball
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Set Group[1] = (Units of type Demon Ball Dummy)
        Unit Group - Pick every unit in Group[1] and do (Actions)
            Loop - Actions
                Set Unit[1] = (Picked unit)
                Set Point[1] = (Position of (Picked unit))
                Custom script:   set udg_Ball_Height[1] = GetLocationZ(udg_Point[1])
                Set Point[2] = (Point[1] offset by 18.00 towards (Facing of (Picked unit)) degrees)
                Custom script:   set udg_Ball_Height[2] = GetLocationZ(udg_Point[2])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Ball_Height[2] Greater than or equal to (Ball_Height[1] + 3.50)
                    Then - Actions
                        Unit - Create 1 Demon Ball Dummy for (Owner of (Picked unit)) at Point[1] facing ((Facing of (Picked unit)) x 2.00) degrees
                        Unit - Add a Ball_Timer[(Custom value of (Picked unit))] second Generic expiration timer to (Last created unit)
                        Unit - Set the custom value of (Last created unit) to (Custom value of (Picked unit))
                        Unit - Remove (Picked unit) from the game
                        Special Effect - Create a special effect at Point[1] using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                        Special Effect - Destroy (Last created special effect)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Ball_Timer[(Custom value of (Last created unit))] Less than or equal to 0.00
                            Then - Actions
                                Unit - Remove (Last created unit) from the game
                            Else - Actions
                    Else - Actions
                        Unit - Move (Picked unit) instantly to Point[2]
                        Destructible - Pick every destructible within 80.00 of Point[2] and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        ((Picked destructible) is alive) Equal to True
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Ashenvale Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Barrens Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Barrens Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Black Citadel Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Cityscape Fall Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Cityscape Snowy Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Cityscape Summer Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Cityscape Winter Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Cityscape Ruined Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Dalaran Ruins Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Dungeon Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Icecrown Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Icecrown Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Northrend Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Fall Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Snowy Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Outland Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Ruins Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Ruins Canopy Tree
                                                (Destructible-type of (Picked destructible)) Equal to Underground Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                                                (Destructible-type of (Picked destructible)) Equal to Village Tree Wall
                                    Then - Actions
                                        Set Point[3] = (Position of (Picked destructible))
                                        Unit - Create 1 Demon Ball Dummy for (Owner of (Picked unit)) at Point[1] facing ((Facing of (Picked unit)) x 2.00) degrees
                                        Unit - Add a Ball_Timer[(Custom value of (Picked unit))] second Generic expiration timer to (Last created unit)
                                        Unit - Set the custom value of (Last created unit) to (Custom value of Unit[1])
                                        Unit - Remove Unit[1] from the game
                                        Special Effect - Create a special effect at Point[1] using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                                        Special Effect - Destroy (Last created special effect)
                                        Custom script:   call RemoveLocation (udg_Point[3])
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Ball_Timer[(Custom value of (Last created unit))] Less than or equal to 0.00
                                            Then - Actions
                                                Unit - Remove (Last created unit) from the game
                                            Else - Actions
                                        Destructible - Kill (Picked destructible)
                                    Else - Actions
                        Set Group[2] = (Units within 50.00 of Point[2] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A ground unit) Equal to True)))
                        Unit Group - Pick every unit in Group[2] and do (Actions)
                            Loop - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Unit-type of (Picked unit)) Not equal to Demon Ball Dummy
                                    Then - Actions
                                        Set Point[3] = (Position of (Picked unit))
                                        Unit - Create 1 Demon Ball Dummy for (Owner of Unit[1]) at Point[1] facing ((Facing of (Picked unit)) x 2.00) degrees
                                        Unit - Add a Ball_Timer[(Custom value of Unit[1])] second Generic expiration timer to (Last created unit)
                                        Unit - Set the custom value of (Last created unit) to (Custom value of Unit[1])
                                        Unit - Remove Unit[1] from the game
                                        Special Effect - Create a special effect at Point[1] using Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
                                        Special Effect - Destroy (Last created special effect)
                                        Custom script:   call RemoveLocation (udg_Point[3])
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                Ball_Timer[(Custom value of (Last created unit))] Less than or equal to 0.00
                                            Then - Actions
                                                Unit - Remove (Last created unit) from the game
                                            Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                ((Picked unit) belongs to an enemy of (Owner of Unit[1])) Equal to True
                                            Then - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Custom value of (Picked unit)) Less than 1
                                                    Then - Actions
                                                        Set MUI = (MUI + 1)
                                                        Unit - Set the custom value of (Picked unit) to MUI
                                                    Else - Actions
                                                Set Slide_Angle[(Custom value of (Picked unit))] = (Angle from Point[3] to Point[2])
                                                Unit - Create 1 Dummy for (Owner of Unit[1]) at Point[2] facing Default building facing degrees
                                                Unit - Add Bouncy Ball Pushback  to (Last created unit)
                                                Unit - Set level of Bouncy Ball Pushback  for (Last created unit) to (Level of Demon Ball  for Ball_Caster[(Custom value of Unit[1])])
                                                Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
                                                Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                                                Unit - Create 1 Attacking Dummy for (Owner of Unit[1]) at Point[2] facing Default building facing degrees
                                                Unit - Add Demon Ball Posion  to (Last created unit)
                                                Unit - Order (Last created unit) to Attack (Picked unit)
                                                Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                                            Else - Actions
                                    Else - Actions
                        Custom script:   call RemoveLocation (udg_Point[2])
                        Custom script:   call RemoveLocation (udg_Point[1])
                        Custom script:   call DestroyGroup (udg_Group[2])
                        Set Unit[1] = No unit
        Custom script:   call DestroyGroup (udg_Group[1])

Code:
Slide Ball Target
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        Set Group[1] = (Units in (Entire map) matching (((Matching unit) has buff Demon Ball [Slide] ) Equal to True))
        Unit Group - Pick every unit in Group[1] and do (Actions)
            Loop - Actions
                Set Point[1] = (Position of (Picked unit))
                Set Point[2] = (Point[1] offset by 10.00 towards Slide_Angle[(Custom value of (Picked unit))] degrees)
                Unit - Move (Picked unit) instantly to Point[2]
                Special Effect - Create a special effect at Point[2] using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
                Special Effect - Destroy (Last created special effect)
        Custom script:   call DestroyGroup (udg_Group[1])
        Custom script:   call RemoveLocation (udg_Point[1])
        Custom script:   call RemoveLocation (udg_Point[2])
Code:
Ball Timer
    Events
        Time - Every 0.01 seconds of game time
    Conditions
    Actions
        Set Group[1] = (Units of type Demon Ball Dummy)
        Unit Group - Pick every unit in Group[1] and do (Actions)
            Loop - Actions
                Set Ball_Timer[(Custom value of (Picked unit))] = (Ball_Timer[(Custom value of (Picked unit))] - 0.01)
        Custom script:   call DestroyGroup (udg_Group[1])

Code:
Remove Balll
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Demon Ball Dummy
    Actions
        Unit - Remove (Triggering unit) from the game
 

Draphoelix

It's not the wintercold that's killing me
Reaction score
132
Haven't looked in entire trigger.

But you keep picking in Group[1] which may cause lag if it's many units in it and it runs every 0.01 second on one trigger..
 

THE_X

New Member
Reaction score
49
that trigger does nothing but set a number so i should not lag, and also i know that does not leaks at all
 

THE_X

New Member
Reaction score
49
well you would think that but its not :( iv put it in a diffrent map and its just fine, all it is, is a sliding trigger, and creates a new unit if it comes into contact with a wall,tree or unit
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
using Group[1] for multiple triggers is a bad idea - especially in such a short use of action.
try changing ur index so the triggers won't collide each other and it should work (i think)
 

THE_X

New Member
Reaction score
49
well that cant be it because in the triggers the groups have no units in them whatsoever, there are no units with the buff when get game starts and there are no units of the type when the game starts, it just laggs right off the bat
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
could u try a sec make different groups and see for urself?
im pretty sure that's ur problem
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k that's gonna be pretty hard to find the right one so could u try disabling them all and enabling them one by one when u get a lag from a certain trigger disable it and keep onthe rest of triggers then in the end tell me which triggers caused u lags while enabled
 

Kazuga

Let the game begin...
Reaction score
110
When does it start lag? Immediately? After a while? If it's within 10 min and you don't let any 0.03 event triggers create 1 leak each time it shouldn't be leaks.

I have encountered this before, a trigger lags when it shouldn't since it really does nothing that should create lag. Best thing you could try is to convert it/rewrite it in Jass/vJass.
 

THE_X

New Member
Reaction score
49
yea i did that, and the more i disabled the better the lag got, but still theres a lag, :( its every single one doing it, but there not leaking grr, it works just fine in my other maps, i dont know why it wont work in this one
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
can u try increasing those timers to 1,3 and 4 seconds instead of the current?
 

THE_X

New Member
Reaction score
49
yea lol i set them to every 4 seconds, and that helped like very, very little
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
few Notes:
*what's the point of making expiration timer if u remove them after 0.03 second?

*also Ball_Timer is kind of a constant variable and seem useless i suggest to get rid of it and just put a 10.00

*again i say there is no point removing the unit with Ball_Timer when u already got expiration timer and also timer cannot go below 0

*your points are probably leaking since u lose their values during other triggers interference try using a different variables for each trigger saving numbers there won't help u much

*setting Unit[1] to picked unit is not helping and useless (units don't leak)

*also just now i noticed that u actually made a manual Timer with real type variable and no offence but it's kinda stupid (why make a timer manually when u there is already one made for that purpose?) and also the fact that expiration timer has a timer of it's own running.

*why removing ball after it dies? u don't want it to decay mabye? anyway i think it should stack with expiration timer.
noted done pretty much - try fixing what u need and see how it goes
 

vypur85

Hibernate
Reaction score
803
Not sure what are you trying to do with the trigger here but creating a lot of units concentrated in one point will cause very terrible lag. Also, as mentioned in the past, a loop in another loop will cause lag depending on how big the loop is. Imagine if the Z value is low, then a lot of units will be created depending on the destructible number or unit number around the dummy. Try giving the dummy units food cost of 1 and see how many units are create per cast. If the number is high, then the lag is caused by units number.

Also, try as best to play around with conditions efficiently. Don't create something and then decide later whether the unit is needed or not. You should decide whether the unit is needed or not, then only create the units.


> why removing ball after it dies?

Yeah. To remove corpse. It reduces lag greatly. Units die via timer will still leave corpse (this depends, though), which could lag the game.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top