• 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.

Leaking question !!!

Status
Not open for further replies.
Level 6
Joined
Sep 17, 2005
Messages
276
Well im making a survival map and for that i need to create much units in waves kinda that:

>>>
Code:
Unit - Create 5 Soldat for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing (270.0) degrees
<<<

And i have many of this functions.

So what i want to know is if this causes memory leaks and if yes can i fix it whith following function??? :

Code:
EVENT:    Unit - A unit Decays

ACTIONS:        Wait 5.00 seconds
                         unit - remove (decaying unit) from the game

need help because after a while the game starts lagging more and more....
 
Level 10
Joined
Jul 2, 2004
Messages
690
im not very sure about this, but does Turning Off and Turning On triggers help?
lets say you dont need a trigger yet, so it will be initially turned off.
just a suggestion. no gurantees.
 
Level 6
Joined
Sep 17, 2005
Messages
276
Hm... ye thanks for the tip so i have now not all at init on. the lagg decreased well. :D

But i meant if the create units function causes memory leak.

And if so how can i prevent memory leak?

BTW another quest:

>>> How can i use the custom value function? What is it for and what i can do with it? <<<
 
Level 7
Joined
Feb 15, 2005
Messages
183
yes, that does cause memory leaks. Whenever you call for a point, that leaks into memory if it is not properly removed and nullified.

What you need to do, is set a point equal to the center of the map, call that point, and then remove and nullify that point.

local location temploc
set temploc = (Center of (Playable map area))
Unit - Create 5 Soldat for Player 1 (Red) at (temploc) facing Default building facing (270.0) degrees
call removelocation (temploc)
set temploc = null
 
Level 6
Joined
Sep 17, 2005
Messages
276
[quote="Dr Super Good]
Salamander he is doing that already. :? Read futher up the post.[/quote]

Well thats ok, as i said im not used to that leaking things and i wanted to know if i can prevent leak with the above func.

So if you use is as well... great - i'll use too. One lagg less on my map. :D

Thanks a lot
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Laging IS NOT leaking

Leaks are when something like a location/group/effect leak onto the ram memory for the rest of the game causing it to use up more procesing power to fetch the variable value so that the more leaked the more it lags when you create/fetch/handle a value (well atleast thats what my experiments proved). To stop leaks you must deastroy the variable value after you use it.

Lag is caused when your computer can not cope with the number of culuclations it is being ordered to perform per second. LEAKING DOESNT CAUSE LAG DIRECTLY! Leaking increases the processor load of you axcesing variales thuses making it lag worse the more the leaking function is run.
 
Level 6
Joined
Sep 17, 2005
Messages
276
^^ ok. i just meant that my leaks (at beginning there were much of them) caused some heavy laggs on my maps after some time.

Im not used to fixing leaks but i know the difference ^^.

Well i think i fixed it anyway i destroyed or nullified all variables as i dont use em. Hope this is all i had to do.

ty anyway :D
 
Level 3
Joined
Jul 12, 2005
Messages
48
yes, that does cause memory leaks. Whenever you call for a point, that leaks into memory if it is not properly removed and nullified.

What you need to do, is set a point equal to the center of the map, call that point, and then remove and nullify that point.

local location temploc
set temploc = (Center of (Playable map area))
Unit - Create 5 Soldat for Player 1 (Red) at (temploc) facing Default building facing (270.0) degrees
call removelocation (temploc)
set temploc = null

Actually, center of playable map doesnt leak, since that location never changes.
 
Level 6
Joined
Sep 17, 2005
Messages
276
hm... and does

Code:
pick every unit owned by player12 and do actions
     order picked unit to attack-move to random point in rect

leak? cz i called that func sometimes too.
 
Level 7
Joined
Aug 5, 2005
Messages
218
Sunny_D said:
BTW another quest:

>>> How can i use the custom value function? What is it for and what i can do with it? <<<
A custom value is basically a variable attached to a unit. You can set a unit's custom value and it will remain on that unit until changed or the unit is removed, and you can refer to that number. I find it very useful.
 
Status
Not open for further replies.
Top