• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Things That Leak

Level 12
Joined
Apr 27, 2008
Messages
1,228
(Player group((Triggering player))) = GetForceOfPlayer(GetTriggerPlayer())

And then quote my previous 2 posts.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
ah, so, Number of units in "GoodGroup" = 0?

after setting it?

EDIT: it still lags.

  • Skip Player1
    • Events
      • Unit - A unit enters Move1 <gen>
    • Conditions
    • Actions
      • Wait 0.50 seconds
      • Set Creeps = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Control Tower) and ((Owner of (Matching unit)) Equal to Player 1 (Red))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Creeps) Equal to 0
        • Then - Actions
          • Set Start = (Random point in Start2 <gen>)
          • Unit - Move (Triggering unit) instantly to Start
          • Custom script: call RemoveLocation(udg_Start)
        • Else - Actions
      • Custom script: call DestroyGroup(udg_Creeps)

set the group like this
Set Creep = unit owned by player 1 (Red) of type (Control Tower)
No need for (Units in (Playable map area)

and use entering unit

Unit - Move (Entering unit) instantly to Start

i´m not sure will this fix lags but is your lag happening once or always?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
then the map is lagging because... (i wanna know. im not argueing stubbornly :p)

wtf...

Well, you do destroy the force like you should. The leaks occur due to a nice blizzard bug. There's 2 ways to fix it:

1) Use jass
2) Create a Player Group array at map initialization, with PG[1] = Player group (Player 1), etc.
Then use PG for Player(i) and never destroy the force.
 
Level 11
Joined
Dec 31, 2007
Messages
780
The leaks occur due to a nice blizzard bug

Wow thats nice (i dont know if it is even possible that a leak like that can screw a map so easily, because of the amount of leaks i needed to create for it to lag) so it lagged yours too.

in cases like this one, i use a group and i add and remove players from it without destroying the force... i think its ok, is it?
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
It didn't lag for me, probably because I didn't run it for long enough. But I saw the memory usage increase very fast, which led me to the only reasonable conclusion.

In cases like this one, I suggest you do something like:

  • Events
    • Map initialization
  • Actions
    • Set PG[1] = Player group (Player 1)
    • Set PG[2] = Player group (Player 2)
    • etc.
  • Events
    • ...
  • Actions
    • Game - Display to PG[2] the text: (String((Current movement speed of MSHero[(Player number of (Triggering player))])))
As long as your player group only contains 1 player, just use PG without ever cleaning or destroying those forces
 
Level 11
Joined
Dec 31, 2007
Messages
780
well this is a nice discovery... what i think is that any gui action to convert players to player groups leaks. Including "matching player" and any other gui action except for "All players" (ive tested it and every gui action gave me lag) with a 0.02s timer and a 500 loop...

should some of this be added to the first post?
 
Level 11
Joined
Dec 31, 2007
Messages
780
i quote Vexorian

function GetForceOfPlayer takes player whichPlayer returns force
local force f = CreateForce()
call ForceAddPlayer(f, whichPlayer)
return f
endfunction


They never set the f to null. So it leaks.
I think the optimizer fixes this leaks, but it is always better to move from GUI.

i was correct... it leaks xD
 
Level 3
Joined
Jun 19, 2009
Messages
37
Help me guys...location leaks in my spell, even with "removelocation..."
  • Spell trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Leaking Bottle
    • Actions
      • Custom script: local unit udg_proptrig
      • Custom script: local effect udg_propfire
      • Set proppkt = (Target point of ability being cast)
      • Set proptrig = (Triggering unit)
      • Special Effect - Create a special effect at proppkt using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
      • Set propfire = (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at proppkt using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Unit - Cause proptrig to damage circular area after 0.00 seconds of radius 100.00 at proppkt, dealing 50.00 damage of attack type Chaos and damage type fire
      • Special Effect - Destroy propfire
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 0.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 45.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 90.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 135.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 180.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 225.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 270.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 315.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Unit - Cause proptrig to damage circular area after 0.00 seconds of radius 200.00 at proppkt, dealing 150.00 damage of attack type Chaos and damage type fire
      • Custom script: call RemoveLocation(udg_proppkt)
When I use it one after another then sth breaks with the proppkt variable...any suggestions??
I destroyed only 1 effect, because others just dissapear after aproximatly 10 sec or so...
 

Attachments

  • spell.w3x
    87.1 KB · Views: 129
Level 21
Joined
Aug 21, 2005
Messages
3,699
Level 10
Joined
Jun 1, 2008
Messages
485
Help me guys...location leaks in my spell, even with "removelocation..."
  • Spell trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Leaking Bottle
    • Actions
      • Custom script: local unit udg_proptrig
      • Custom script: local effect udg_propfire
      • Set proppkt = (Target point of ability being cast)
      • Set proptrig = (Triggering unit)
      • Special Effect - Create a special effect at proppkt using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
      • Set propfire = (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at proppkt using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Unit - Cause proptrig to damage circular area after 0.00 seconds of radius 100.00 at proppkt, dealing 50.00 damage of attack type Chaos and damage type fire
      • Special Effect - Destroy propfire
      • Wait 1.00 seconds
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 0.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 45.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 90.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 135.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 180.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 225.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 270.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Create a special effect at (proppkt offset by 100.00 towards 315.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Unit - Cause proptrig to damage circular area after 0.00 seconds of radius 200.00 at proppkt, dealing 150.00 damage of attack type Chaos and damage type fire
      • Custom script: call RemoveLocation(udg_proppkt)
When I use it one after another then sth breaks with the proppkt variable...any suggestions??
I destroyed only 1 effect, because others just dissapear after aproximatly 10 sec or so...
You NEVER destroy the special effect. You must destroy it or it will leak...
 
Level 8
Joined
Sep 24, 2007
Messages
300
  • NetMovement 1
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set NETinteger = (NETinteger + 3.00)
      • Set NETtempposition = (Position of NETtarget)
      • Unit - Move NETtarget instantly to (NETcaster offset by NETinteger towards NETinteger degrees)
      • Animation - Change NETtarget flying height to ((Current flying height of NETtarget) + 3.00) at 0.00
This trigger is turned on by another one. DO I have to remove loc in this one or I can do it in the other one? I can't remove NETtempposition here because I need the same value in another trigger.


So basically, do you have to remove loc in the same trigger you define it or you can remove it somewhere else?
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
  • NetMovement 1
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set NETinteger = (NETinteger + 3.00)
      • Set NETtempposition = (Position of NETtarget)
      • Unit - Move NETtarget instantly to (NETcaster offset by NETinteger towards NETinteger degrees)
      • Animation - Change NETtarget flying height to ((Current flying height of NETtarget) + 3.00) at 0.00
This trigger is turned on by another one. DO I have to remove loc in this one or I can do it in the other one? I can't remove NETtempposition here because I need the same value in another trigger.


So basically, do you have to remove loc in the same trigger you define it or you can remove it somewhere else?

Better remove it in same trigger
 
Level 8
Joined
Jun 1, 2008
Messages
341
wondering..
does:
  • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
actually destroy the floating text the same way as:
  • Floating Text - Destroy (Last created floating text)
??
If so.. Then how can a floating text be destroyed after the fadeing age when there are arround 100 Floating Text's being created at the same time..? e.g for a damage system?..
 
Level 3
Joined
Jun 19, 2009
Messages
37
hi...i changed my spell a little bit and now only thing that breaks if used by 2 or more guys at the same time is Cloud of Fog special effect...it stays even though i remove it o_O
First is map initalization...i don't know if it is requiried:
  • map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set metanid = 0
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set proptrig[(Integer A)] = No unit
          • Custom script: call RemoveLocation(udg_proppkt[GetForLoopIndexA()])
Second, the guy uses ability which turns on another trigger and increases index:
  • metan init
    • Events
      • Jednostka - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal Metan cylinder
    • Actions
      • Set metanid = (metanid + 1)
      • Set proptrig[metanid] = (Triggering unit)
      • Set proppkt[metanid] = (Target point of ability being cast)
      • Trigger - Run metan loop <gen> (ignoring conditions)
Third, Effects created, Damage done & i tried to reset index for future use, but i dunno if it's ok:
  • metan loop
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set proplvl[(Integer A)] = (Level of Metan cylinder for proptrig[(Integer A)])
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at proppkt[(Integer A)] using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
          • Set prop[(Integer A)] = (Last created special effect)
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at proppkt[(Integer A)] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj[(Integer A)] = (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • proplvl[(Integer A)] Equal 1
            • Than - Actions
              • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 20.00 damage of attack type Chaos and damage type Fire
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 2
                • Than - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 40.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
          • Special Effect - Destroy prop[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj[(Integer A)]
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 0.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_2[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 45.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_3[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 90.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_4[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 135.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_5[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 180.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_6[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 225.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_7[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 270.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_8[(Integer A)] = (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 315.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Set prop_Kopiuj_9[(Integer A)] = (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • proplvl[(Integer A)] Equal 1
            • Than - Actions
              • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 30.00 damage of attack type Chaos and damage type Fire
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 2
                • Than - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 90.00 damage of attack type Chaos and damage type Fire
          • Special Effect - Destroy prop_Kopiuj_2[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_3[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_4[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_5[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_6[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_7[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_8[(Integer A)]
          • Special Effect - Destroy prop_Kopiuj_9[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • metanid Not equal 0
              • proptrig[(Integer A)] Not equal No unit
            • Than - Actions
              • Custom script: call RemoveLocation(udg_proppkt[udg_metanid])
              • Set metanid = (metanid - 1)
            • Else - Actions
              • Do nothing
 
Level 4
Joined
Jun 12, 2009
Messages
57
Leak?

Does this Trigger leak? I wasn't sure if I had to use that custom script function for every time or just for the last one. Leak Check says it is alright but this is my first time trying to fix a leak and I wanted to make sure I had it down properly. Thanks!
  • Actions
    • Set StartPoint = (Center of Meteor <gen>)
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Meteor Strike <gen>
    • Camera - Pan camera for Player 1 (Red) to StartPoint over 2.00 seconds
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Unit - Create 1 Meteor Strike for Neutral Passive at StartPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Wait 2.00 seconds
    • Unit - Remove (Last created unit) from the game
    • Special Effect - Create a special effect at StartPoint using Abilities\Weapons\FragDriller\FragDriller.mdl
    • Special Effect - Destroy (Last created special effect)
    • Wait 3.00 seconds
    • Destructible - Create a Fire at (StartPoint offset by (50.00, 20.00)) facing (Random angle) with scale 1.00 and variation 0
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Wait 0.50 seconds
    • Unit - Create 1 Red Blood Cell (Unit) for Player 1 (Red) at StartPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Game - Display to (All players) the text: There is a grace pe...
    • Wait 4.00 seconds
    • Visibility - Disable (Last created visibility modifier)
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Does this Trigger leak? I wasn't sure if I had to use that custom script function for every time or just for the last one. Leak Check says it is alright but this is my first time trying to fix a leak and I wanted to make sure I had it down properly. Thanks!
  • Actions
    • Set StartPoint = (Center of Meteor <gen>)
    • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across Meteor Strike <gen>
    • Camera - Pan camera for Player 1 (Red) to StartPoint over 2.00 seconds
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Unit - Create 1 Meteor Strike for Neutral Passive at StartPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Wait 2.00 seconds
    • Unit - Remove (Last created unit) from the game
    • Special Effect - Create a special effect at StartPoint using Abilities\Weapons\FragDriller\FragDriller.mdl
    • Special Effect - Destroy (Last created special effect)
    • Wait 3.00 seconds
    • Destructible - Create a Fire at (StartPoint offset by (50.00, 20.00)) facing (Random angle) with scale 1.00 and variation 0
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Wait 0.50 seconds
    • Unit - Create 1 Red Blood Cell (Unit) for Player 1 (Red) at StartPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_StartPoint)
    • Game - Display to (All players) the text: There is a grace pe...
    • Wait 4.00 seconds
    • Visibility - Disable (Last created visibility modifier)


You used across Meteor Strike <gen> instead your variable point (StartPoint)

you don´t need to remove variable point until you want to change it

set POINT = center of region 1
create Box for player 1 at POINT
create Footman for Player 1 at POINT
Custom Script:call RemoveLocation(udg_POINT)

you must use RemoveLocation before waits if you are sure that you may need to change the variable between wait time
if you are sure it will not be changed between wait just remove it at the end


and btw
when you remove location you must set it again to use it

you cannot do this
Custom script: call RemoveLocation(udg_StartPoint)
Unit - Create 1 Meteor Strike for Neutral Passive at StartPoint facing Default building facing degrees
Custom script: call RemoveLocation(udg_StartPoint)


you don´t need to remove location leaks if your position is unit on map - some unit 0023 <gen>
 
....you don´t have to do that -.- ,its not a function too,and there is an event - unit comes within range of unit for witch is not using remove location or anything like that,besides my map never did´t lag...
there is also no need to use it in destructible that is already in map (in WE)

Wrong again. What you've said is this:
you don´t need to remove location leaks if your position is unit on map - some unit 0023 <gen>
So, what do you want to say with this? Since you spoke about a location leak, you're talking about this:
  • Random - Do something at <Position of <Unit 0023<gen>>>
And yes, THIS leaks and creates a location.

If you're talking about something else, explain it to me please :)
The less I have to remove, the better it is. Everyone can still learn :)

By the way, just a question: am I right when I'm thinking that I don't have to null
timers from TimerUtils? Since they never get destroyed (okay, when the max count is
reached, but that never happens) there is no need of handle id recycling, or?
JASS:
function Foo takes nothing returns nothing
    local timer t = NewTimer()
... do some stuff
    call ReleaseTimer(t)
    //No need for nulling here?
endfunction
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
what do you mean by Random - Do something at <Position of <Unit 0023<gen>>>
if it is random unit than it is a function and needs to remove leaks


but i know that if it is Variable - Paladin 0000 <gen> that there should be no need to remove location

y i think nothing could happen if you don´t null

EDIT > Silvenon already said.....
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
What I'm talking about is, that "Paladin 0000 <gen>" isn't a location but a unit. How du you get its position (a location) without "Position of unit"? I just don't get what you're talking about.

The timer utils thingy is great :D
you have Position of unit but it is not a function like center of region.....

im moving about 5 units every 0.1 sec to position of unit (that is already in WE) and its not making any lags
 
Increased memory usage doesn't cause an instant lag.
Position of unit IS a function like center of region, just convert it to the custom text and see it.
The leak is only increadibly small:
You need around 10000 locations to create a leak of around 3.6 mb, and 3.6 mb doesn't cause a normal computer to lag. With your values, this would take over 3 minutes.
Reference: (German site, but the test values are readable)

EDIT: By the way, "Unit 0000 <gen>" are just normal globals, but they're generated automaticly. It's not a direct reference but a global variable.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
Justify - "The leak is only increadibly small:"

Yes but i don´t know does it exist at all,i moved 20 units every 0.10 sec at position of another unit (that is already in WE) and nothing happens

i also didn't destroy group and the unit was moving around the map all the time

for 30 minutes nothing happens and im sure nothing would happen for 5 hours
 
Yes, you do. You already leak two points; it should be done like this:
Set Point1 = (Your point)
Set Point2 = (Point1 offset by 50.00 towards Angle Degrees)
Set Temp_Rect = (Region centered at (Point2) with size 50.00, 50.00) [Those 50.00 values are way small]
Custom script: call RemoveLocation (udg_Point1)
Custom script: call RemoveLocation (udg_Point2)
Custom script: call RemoveRect (udg_Temp_Rect)
 
Nulling doesn't give any memory advantages and not nulled handles does NOT leak.
It has been said so often... there is a handle id counter, that counts how many variables point onto a handle id. When for example a location is destroyed, its handle id should be recycled so it can be used again. As long as there are still variables pointing on it, this won't happen.
In theory this is completly useless, because higher handle ids change nothing.
The problem is, that some systems use this ids as an index, and when this index gets to high the systems "crash".
Also, lower indexes are more performant, due to the fact that vexorians method for increasing the 8191 array limit just uses a lot of if-conditions to get the high indexes, what could get skipped with lower ones.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
btw i wonder how much unit groups and locations leak you have to have to see that it leaks/that your map lags.Maybe 10000000000 ?

i never had lags when i didn't remove leaks.....

only thing i had is when i created 500+ special effects IN SAME PLACE than i had some big "sky" of that effect that was not turning off
and no lags :D
 
that is bullshit everyone is saying that and i know in one map there is more than 1000 units removed and nothing happens

The point is, that you don't understand leaks...
A map isn't leaking when it laggs on YOUR computer.
A map (a map can't actually leak, you know what I mean) is leaking when the memory usage of warcraft increases due to unremoved handles (strings? I've heard it. The memory usage of warcraft increased with the time a bit without doing anything, but this isn't the problem).
Warcraft is very old and I bet that you got a pretty nice computer when you can create around 500 special effects without lagging.
The problem is, that there are many many and maaaany old computer that will lag with a few leaks, so you take care of them to reduce their CPU load.
 
Top