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?
 
No. Don't worry about those.

BUT! Of course this is clearly a leak:
360.00/(GetLocationX(GetUnitLoc(GetTriggerUnit()))/20.00)
 
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?
 
There is no need to remove those formulas. The thing hitting OP limit would be adding an integer loop from 1 to 10,000.
 
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?
 
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
 
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.
 
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)
 
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.
 
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
 
> ... 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.
 
What about posting the triggers that add the units to the group and set the values...
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top