Warcraft III resources & community, 2003–2006 · archived

Leaking question !!!

16 posts
#1

Leaking question !!!

Well im making a survival map and for that i need to create much units in waves kinda that:

>>>
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??? :

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....
#2
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.
#3
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? <<<
#4
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
#5
yea thats what i searched for. thanks for that :D
#6
one way to reduce lag is remove the corpses when a unit dies.
#7

one way to reduce lag is remove the corpses when a unit dies



EVENT: Unit - A unit Decays

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


Salamander he is doing that already. :?
Read futher up the post.
#8
Dr Super Good
Salamander he is doing that already. :? Read futher up the post.


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
#9
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.
#10
^^ 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
#11
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.
#12
hm... and does

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.
#13
Yes, it does.
#14
haha... ok :).
My map seems to be a whole great leak...
#15
Sunny_DBTW 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.