Formulas create leaks?

Frozenwind

System maker
Reaction score
99
I've got a trigger which I made leakless (removed unitgroup leak and location leak). Don't worry about those leaks, I know how to remove that.
Although it gets laggy slowly...

So:
Do you guys think formula's cause leaks?

My trigger contains lotta formula's like:
360.00/(real_var/20.00)

Shall wc3 use part of your RAM in order to calculate, but forget to remove the used space?
 
Reaction score
456
No. Don't worry about those.

BUT! Of course this is clearly a leak:
360.00/(GetLocationX(GetUnitLoc(GetTriggerUnit()))/20.00)
 

Frozenwind

System maker
Reaction score
99
1) BUT! Of course this is clearly a leak:
360.00/(GetLocationX(GetUnitLoc(GetTriggerUnit()))/20.00)

2) That hits the operation limit. The "formula" doesn't leak.
1) I know that leaks, but real_var hasn't anything to do with a location.

2) So I should try to remove the formula's out of my periodic event?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
There is no need to remove those formulas. The thing hitting OP limit would be adding an integer loop from 1 to 10,000.
 

Frozenwind

System maker
Reaction score
99
I got a loop from 0 to 'variable -1'.
When testing the variable was 1, so it would be a loop which ran once.
So it shudn't hit the limit?
 

Frozenwind

System maker
Reaction score
99
I don't think it will, since I removed all location & group leaks.

Code:
SpinTrig
    Events
        Time - Every 0.15 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 0 to (Ori_N_WispWheels_InMap - 1), do (Actions)
            Loop - Actions
                Set Ori_StartingAngle[(Integer A)] = (Ori_StartingAngle[(Integer A)] + ((360.00 / (60.00 / Ori_NumberOfRotatesPerMinute[(Integer A)])) / (1.00 / 0.15)))
                Set Ori_angle_var = Ori_StartingAngle[(Integer A)]
                Set Ori_dist_var = Ori_DistanceBetweenWisp[(Integer A)]
                Set LEAK_locationvar1 = (Position of Ori_CenterWisp[(Integer A)])
                Unit Group - Pick every unit in Ori_Wispgroup[(Integer A)] and do (Actions)
                    Loop - Actions
                        Set LEAK_locationvar2 = (LEAK_locationvar1 offset by Ori_dist_var towards Ori_angle_var degrees)
                        Unit - Move (Picked unit) instantly to LEAK_locationvar2
                        Custom script:   call RemoveLocation (udg_LEAK_locationvar2)
                        Set Ori_dist_var = (Ori_dist_var + Ori_DistanceBetweenWisp[(Integer A)])
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Ori_dist_var Greater than (Ori_DistanceBetweenWisp[(Integer A)] x (Real(Ori_N_WispsPerArm[(Integer A)])))
                            Then - Actions
                                Set Ori_angle_var = (Ori_angle_var + (360.00 / (Real(Ori_N_Arms[(Integer A)]))))
                                Set Ori_dist_var = Ori_DistanceBetweenWisp[(Integer A)]
                            Else - Actions
                Custom script:   call RemoveLocation (udg_LEAK_locationvar1)

This creates a cross wispwheel:
___________O
___________O
___________O
___________O
___________O
O O O O O O X O O O O O O
___________O
___________O
___________O
___________O
___________O
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
I removed all location & group leaks.

You sure?

Code:
Unit Group - Pick every unit in Ori_Wispgroup[(Integer A)] and do (Actions)

You leak one group. This is the first one that jumped in my eyes, maybe there are others.
 

Frozenwind

System maker
Reaction score
99
Nop, I don't.
When I would do "call DestroyGroup (udg_LEAK_unitgroupvar1)"
my units get removed out of the group.
Problem: the units shouldn't EVER get removed during the game.
With other words, the trigger only works the first time it runs (when adding the custom script)
 

vypur85

Hibernate
Reaction score
803
The trigger doesn't leak. The increase of Ori_N_WispWheels_InMap and number of units in Ori_Wispgroup makes the game lag, I think. How's the increment pattern like? If they increase gradually throughout the game, then it makes sense if the game becomes laggier.
 

Frozenwind

System maker
Reaction score
99
When testing I didn't raise any of those.
The only trigger running during testing was this trigger.
What doesn't change here, doesn't change at all.

I think I'm gunna let the map run for like 20min and observe... with my stopwatch
 

vypur85

Hibernate
Reaction score
803
> ... with my stopwatch

Lol...

But I can tell you that the formula definately did not leak. Not to the extent of causing lag. I have 0.01 periodic triggers (about 2 or 3 of them) running in a map almost all the time with formula more complicated than that and yet it doesn't lag that much. By the way, how many units are there? A big loop in a another loop can be quite painful sometimes.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
What about posting the triggers that add the units to the group and set the values...
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
Question... during the execution ,if you move the camera to some other part of the map, far away from the wisps, does it lags anymore?
 

Frozenwind

System maker
Reaction score
99
By the way, how many units are there? A big loop in a another loop can be quite painful sometimes.
20 units


Smith_S9 said:
during the execution ,if you move the camera to some other part of the map, far away from the wisps, does it lags anymore?
worth a try

AdamGriffith said:
What about posting the triggers that add the units to the group and set the values...
Simply
Code:
Unit Group - Add Wisp 0013 <gen> to Ori_Wispgroup[0]
I know, it's a noob-way, but I've got a reason to do so.

EDIT:
Checked 2.5minutes, at the midle of the wispwheel and in the far corner of my map.
Far corner of my map is 100% lagless.
In the wispwheel the only problem is that it ain't smooth, but that is easy to fix: speed up periodic event.

I think my RAM was close to full when testing yesterday or something...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • 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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top