how do I remove this leak?

Cokemonkey11

New Member
Reaction score
18
According to leakchecker this is a leak:

Code:
Set pointFootyLeaderLastPOS[(Integer B)] = (Position of unitFootyLeader[(Integer B)])

This is in a trigger that runs 100 times per second so it's important I get it fixed.

Thanks,
 

Azylaminaz

Vox Populi
Reaction score
91
call RemoveLocation (udg_pointFootyLeaderLastPOS[GetForLoopIndexB()])

Not much a reason for 0.01 second loop, 0.02 is not even a noticable change, but requires half the computing power.
 

THE_X

New Member
Reaction score
49
Code:
call RemoveLocation (udg_pointFootyLeaderLastPOS[GetForLoopIndexB()])


aww beat to the punch :(
 

Cokemonkey11

New Member
Reaction score
18
every other leak i've ever gotten into i could remove using variables (no "custom script" required)

Is this the only way to remove this leak?
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
every other leak i've ever gotten into i could remove using variables (no "custom script" required)

Is this the only way to remove this leak?

Yes. Why do you want it in another way? :nuts:
 

Artificial

Without Intelligence
Reaction score
326
every other leak i've ever gotten into i could remove using variables (no "custom script" required)
Umm... Special effects are like the only leaks GUI can handle without that Custom script line.

And in case you want to make it a bit faster than those two guys suggested:
Code:
Custom script:   call RemoveLocation(udg_pointFootyLeaderLastPOS[[i]bj_forLoopBIndex[/i]])
 

Cokemonkey11

New Member
Reaction score
18
every other leak i've experianced can be removed without the use of custom code and/or jass/scripts.

Let's get an example.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Rect centered at ((Position of Peasant 0000 <gen>) offset by ((Random real number between 15.00 and 25.00), (Random real number between -500.00 and 500.00))) with size (250.00, 250.00))) and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 500.00 towards (Facing of (Picked unit)) degrees)

this is possibly the leakiest trigger I know how to make.

5 leaks in 1 action. I can get 100x the leaks just by changing the event.

This can be removed by creating an using 5 variables.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set realX = (Real((Random integer number between -15 and 15)))
        Set realY = (Real((Random integer number between -500 and 500)))
        Set rectOffsetOfPeasant = ((Rect centered at (Position of Peasant 0000 <gen>) with size (250.00, 250.00)) offset by (realX, realY))
        Set unitGroupInRectAtPeasant = (Units in rectOffsetOfPeasant)
        Unit Group - Pick every unit in unitGroupInRectAtPeasant and do (Actions)
            Loop - Actions
                Set pointPositionOfPickedUnit = (Position of (Picked unit))
                Unit - Order (Picked unit) to Move To (pointPositionOfPickedUnit offset by 500.00 towards (Facing of (Picked unit)) degrees)

Hope that makes sense.

If you know of a way using GUI only (probably with variables such as these) to remove the leak let me know.
 

Squishy

You can change this now in User CP.
Reaction score
127
Just setting variables doesn't remove the leaks. You need custom values to remove all the variables you set at the end of the trigger.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
every other leak i've experianced can be removed without the use of custom code and/or jass/scripts.

Let's get an example.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Rect centered at ((Position of Peasant 0000 <gen>) offset by ((Random real number between 15.00 and 25.00), (Random real number between -500.00 and 500.00))) with size (250.00, 250.00))) and do (Actions)
            Loop - Actions
                Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 500.00 towards (Facing of (Picked unit)) degrees)

this is possibly the leakiest trigger I know how to make.

5 leaks in 1 action. I can get 100x the leaks just by changing the event.

This can be removed by creating an using 5 variables.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set realX = (Real((Random integer number between -15 and 15)))
        Set realY = (Real((Random integer number between -500 and 500)))
        Set rectOffsetOfPeasant = ((Rect centered at (Position of Peasant 0000 <gen>) with size (250.00, 250.00)) offset by (realX, realY))
        Set unitGroupInRectAtPeasant = (Units in rectOffsetOfPeasant)
        Unit Group - Pick every unit in unitGroupInRectAtPeasant and do (Actions)
            Loop - Actions
                Set pointPositionOfPickedUnit = (Position of (Picked unit))
                Unit - Order (Picked unit) to Move To (pointPositionOfPickedUnit offset by 500.00 towards (Facing of (Picked unit)) degrees)

Hope that makes sense.

If you know of a way using GUI only (probably with variables such as these) to remove the leak let me know.

Download the leak checker.. It helps.. And as far as i recall rects leak.. You have to destroy them. I think its DestroyRect or RemoveRect .. Most likely Destroy.

Also you did not remove the unit group here.. Also a leak.

Also you have to store "position of peasant" into a point variable and remove it at the end.. Point variables are the most common leaks.

And i don't know whats so hard about using custom scripts.. They're a mini version of JASS in GUI.
 

Cokemonkey11

New Member
Reaction score
18
squishy: it does remove leaks. because it's a periodic event it's using the same "variable" (the same point or leak if thats what u want to think of it as) each time it's ran. There is a variable that never gets deleted which can count as 1 "leak," but it will never multiply when the trigger is ran more than once.

920e029337479a2e0168f0b9e49dfac6.png


I do use it shinami - thats how I knew to bring up the leak in this thread in the first place. It's a great tool.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
squishy: it does remove leaks. because it's a periodic event it's using the same "variable" (the same point or leak if thats what u want to think of it as) each time it's ran. There is a variable that never gets deleted which can count as 1 "leak," but it will never multiply when the trigger is ran more than once.

920e029337479a2e0168f0b9e49dfac6.png


I do use it shinami - thats how I knew to bring up the leak in this thread in the first place. It's a great tool.

Remove the things i said.. Because that thing doesn't find all the leaks actually.
 

Cokemonkey11

New Member
Reaction score
18
there are no leaks dude

i know because i've played 40 minute games that would otherwise end in a lagfest.

if there are leaks the way i do it, its has to be a shitload better than before.. i can tell with lag reduction.
 

UndeadDragon

Super Moderator
Reaction score
447
Please read this.
 

Cokemonkey11

New Member
Reaction score
18
okay lets forget everything about custom scripts

just assume im a sarcastic rude impatient stubborn kid that wants it done his way.

Is there a way to do it that you guys know of or not?

If not, I don't believe you. Theres a way for every other trigger i've ever made.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
>okay lets forget everything about custom scripts
You cannot remove most leaks without using custom scripts. Let's go back to the example trigger you posted, that still leaks.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set realX = (Real((Random integer number between -15 and 15)))
        Set realY = (Real((Random integer number between -500 and 500)))
        Set rectOffsetOfPeasant = ((Rect centered at (Position of Peasant 0000 <gen>) with size (250.00, 250.00)) offset by (realX, realY))
        Set unitGroupInRectAtPeasant = (Units in rectOffsetOfPeasant)
        Unit Group - Pick every unit in unitGroupInRectAtPeasant and do (Actions)
            Loop - Actions
                Set pointPositionOfPickedUnit = (Position of (Picked unit))
                Unit - Order (Picked unit) to Move To (pointPositionOfPickedUnit offset by 500.00 towards (Facing of (Picked unit)) degrees)
It still leaks, alot. Here's a corrected version, using custom scripts.

Code:
faketrig
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set realX = (Real((Random integer number between -15 and 15)))
        Set realY = (Real((Random integer number between -500 and 500)))
        Set rectOffsetOfPeasant = ((Rect centered at (Position of Peasant 0000 <gen>) with size (250.00, 250.00)) offset by (realX, realY))
        Set unitGroupInRectAtPeasant = (Units in rectOffsetOfPeasant)
        Unit Group - Pick every unit in unitGroupInRectAtPeasant and do (Actions)
            Loop - Actions
                Set pointPositionOfPickedUnit = (Position of (Picked unit))
                Unit - Order (Picked unit) to Move To (pointPositionOfPickedUnit offset by 500.00 towards (Facing of (Picked unit)) degrees)
                [B]Custom Script:     call RemoveLocation(udg_pointPositionOfPickedUnit)
        Custom Script:     call DestroyGroup(udg_unitGroupInRectAtPeasant)[/B]
The bolded parts are required to remove the leaks. It also might leak a rect, but I don't know the function to fix that off the top of my head.
Just adding variables will only speed up your code a bit, since it just has the check the data within the variable rather then find the (Position of (Picked unit)) again, but there are still many leaks that you didn't remove.

See the part on your screenshot that says "- Removed: No"? That means you kept the variables, so they just keep overwriting and leaking.

And also, these two lines are useless. Reals don't leak.
Code:
        Set realX = (Real((Random integer number between -15 and 15)))
        Set realY = (Real((Random integer number between -500 and 500)))
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
its Custom script: call RemoveRect(udg_Your_Variable)
 

Cokemonkey11

New Member
Reaction score
18
addind realx and realy stopped leak checker from telling me the previous was a leak.

So my question is, if my triggers are still leaking, how come they don't lag.

I stress test all my maps to check for lag or long load times or long memory cache cleaning (end of map) times.

Is it because my leaks are "better" or because theres less or what?


Thank you for all the help by the way.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
addind realx and realy stopped leak checker from telling me the previous was a leak.

So my question is, if my triggers are still leaking, how come they don't lag.

I stress test all my maps to check for lag or long load times or long memory cache cleaning (end of map) times.

Is it because my leaks are "better" or because theres less or what?


Thank you for all the help by the way.

There are some leaks or just minor leaks that cause such little lag that u can't even see it.. still lag tough.... and leaks might cause other problems.. which i don't exactly know.

IF youre trigger leaks at every freakin line then it will lag.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top