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

I'm back!
Reaction score
460
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...
 

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.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top