• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Things That Leak

Level 2
Joined
Mar 16, 2008
Messages
12
Intialization triggers also sort of leak, but by destroying them with "call DestroyTrigger(GetTriggeringTrigger())" after a trigger you do not need anymore this seems to help my maps a lot

Razorbrain, I know it works for you, it should. Leaks are not whether it's working or not, the full name is memory leaks. It's when (example) you create a special effect at the position of a unit. If that location (the position of unit) is not destroyed, it will stay there and take some memory, so when you create lots of these locations, your map will lag like hell. Imagine it like this, try putting 10000 units on a map and test it, it bet it'll lag because each unit takes some memory, and causes the game to leak. Same for Unit Groups, if you go pick every unit, then WE creates a group so he can do what you said, but if that group isn't destroyed, it will leak.

These are what don't leak: integer, real, boolean, string (in JASS code doesn't leak also)

Blizzard should have made a garbage collector for that, though I'm not sure how that works

http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242

thank you guys so much! Just the first page of this thread has been extremely helpful. I have bee teaching myself how to use the GUI for 5 months now, and I just learned something new.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Intialization triggers also sort of leak, but by destroying them with "call DestroyTrigger(GetTriggeringTrigger())" after a trigger you do not need anymore this seems to help my maps a lot

I don't think it's necessary to do that since there is always only one map initialization trigger (there is no point in having more) and one trigger leak is really unnoticeable, it's an extremely small leak that doesn't make a difference.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
I agree - One time triggers (unless very messy) do not make any difference in lag even if they leak.
But still unless you clean up, it won't be perfect :p
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Noone can eventually understand how Im glad to be recodnized as Spammer
it fills my vains with energy and happiness

Hmm if we think deeper
Leak and Bug are the same
in both you get pwnt
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Depends on Point u use
X of Unit is fine

X of Position Of Unit you leak a position

set loc = Position of Unit
X of loc
remove loc
fine
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Well, people say that killing a unit (in JASS with KillUnit() or in GUI with Unit - Kill unit) causes leaks because the unit isn't removed from the game. The conclusion is that adding an expiration timer will kill it, remove it from the game and it will still look like it's killed (it will play its "death" animation), but it won't leak.

I'm not sure if just killing a unit with no expiration timer leaks, but I believe those guys so I suggest you kill units with expiration timers (or if you don't want the unit to look like it has been killed, simply remove it from the game with the appropriate action).
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Well, first of all, your language is half english and half german, and this forum supports english only.

How are we supposed to know what leaks/lags in your map? Only a person with your map can know that.....

If you didn't get that, it implies you, but it can imply us also if you send us the map.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Goddamn it...... What good does the freaking protected map do? How can I see where the problem is if the map is protected? If I wanted to find out why your map lags, I would have to look in your triggers and how should I do that if the map is protected? One of the main features of map protecting is that you can't open it in WE.

Btw, I can't look at the map myself, because I don't have wc3, I was just saying that you should send the map if someone else is able/interested to help.
 
Level 8
Joined
Nov 29, 2007
Messages
371
Hmm do you mean i should send in unprotecz or an normal version of my map?

the protected ver http://www.hiveworkshop.com/forums/resource.php?t=82228&prev=u=hand%20of%20blood

picard-headesk.jpg

Also: grammar! Learn to use it.
Also: spelling! If you don't use correct grammar and spelling how do you expect people to take you seriously.
 
Level 8
Joined
Nov 29, 2007
Messages
371
If you wanted it to be private you could have used the pastebin. I'll just have a peek in your map to see anyways...

[EDIT] It seems you posted it in the map section. That is for finished maps only. Use the attachment function or the pastebin instead. Your map was removed by the way, you probably have a PM about that now.
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
hand of blood: Go and read a tutorial, everyone who knows about leaks have learnt it that way. It's not that hard. If you still have problem open a new thread in the WEHZ with your problem with proper english.

By the way, when you kill a unit with an expiration timer it does NOT leak.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Didn't I said that? Yeah, read some tutorials hand of blood.....stop stealing my thoughts emperor :p.

Isn't this thread, like, made for you to learn how to clean leaks? I don't think Ralle meant that you should ignore the first post and blindly ask questions that have already been answered so many times. If you don't understand/like this thread, there are tons of them throughout the forum, you just gotta search man. We don't feel like repeating everything one thousand times.
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
  • B Attack
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Attack (Blademaster)
    • Actions
      • -------- ---------- --------
      • Set Location[0] = (Position of (Casting unit))
      • Unit Group - Pick every unit in (Units in (Region centered at (Location[0] offset by 150.00 towards (Facing of (Casting unit)) degrees) with size (250.00, 250.00)) matching (((Matching unit) is alive) Equal to True)) and do (Unit Group - Add (Picked unit) to AttackGroup[(Player number of (Owner of (Casting unit)))])
      • Custom script: call RemoveLocation(udg_Location[0])
      • -------- ---------- --------
      • Player Group - Pick every player in (All allies of (Owner of (Casting unit))) and do (Unit Group - Remove all units of (Units owned by (Picked player)) from AttackGroup[(Player number of (Owner of (Casting unit)))])
      • Unit Group - Pick every unit in (Random 1 units from AttackGroup[(Player number of (Owner of (Casting unit)))]) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Casting unit) to damage (Picked unit), dealing (Real((Agility of (Casting unit) (Include bonuses)))) damage of attack type Normal and damage type Normal
          • Set Attack_Damage = (Agility of (Casting unit) (Include bonuses))
          • Set Attack_Target = (Picked unit)
          • Unit - Create 1 Blademaster Sound Dummy for Neutral Passive at (Position of (Casting unit)) facing (Position of (Picked unit))
          • Unit - Order (Last created unit) to Attack Once (Picked unit)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Human\HumanBlood\HumanBloodFootman.mdl
          • Special Effect - Destroy (Last created special effect)
          • Trigger - Run Show Damage <gen> (checking conditions)
      • Unit Group - Remove all units from AttackGroup[(Player number of (Owner of (Casting unit)))]
      • Wait 0.01 seconds
      • Unit - Order PLAYER[(Player number of (Owner of (Casting unit)))] to Stop
If I make it as an array is it just "call RemoveLacation(udg_Location[0])" or do I need different custom script? :/
 
Level 12
Joined
Aug 20, 2007
Messages
866
No, integers and reals always clear themselves properly at the end of a function

The only problem, is integer/real globals arrays, would never be removed that way, but I don't think you need to clear them, they will always carry information (zero is a number too)
 
Level 12
Joined
Aug 20, 2007
Messages
866
Uhhh.... I don't know about how exactly bytes work, but I don't think so. I don't want to say your right, because I have no way of knowing (and for some reason everybody I speak to about the subject say don't bother)
 
Level 12
Joined
Aug 20, 2007
Messages
866
Yeah, I seriously doubt global reals are the cause, because they are insanely small compared to the conventional special effect leak (somewhere around 8B to 20,000B), you'd need a few hundred un-cleared array slots to cause significant memory usage
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
The thing with globals is that they leak a fixed amount of memory from the begging of the game till the end(talking only about pointers and basic variables, not what pointers are pointing at).
 
whats the leak?

im makin my own lil jump spell, not so efficient, doesnt have to be MUI, so here..

  • Leap1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Leap
    • Actions
      • Set Jumper[1] = (Triggering unit)
      • Set Jumploc[1] = (Position of Jumper[1])
      • Set Jumpland[1] = (Target point of ability being cast)
      • Set Jumpangle[1] = (Facing of Jumper[1])
      • Set Maxdistance[1] = (Distance between Jumploc[1] and Jumpland[1])
      • Unit - Add Crow Form to (Triggering unit)
      • Unit - Remove Crow Form from (Triggering unit)
      • Trigger - Turn on air1 <gen>
      • Unit - Turn collision for Jumper[1] Off
      • Animation - Change (Triggering unit) flying height to (Maxdistance[1] x 0.80) at (Maxdistance[1] / 0.55)
      • Countdown Timer - Start Airtime[1] as a One-shot timer that will expire in ((1.10 x Maxdistance[1]) / 1000.00) seconds
  • air1
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Jumploc[1] = (Position of Jumper[1])
      • Set Jumpforward[1] = (Jumploc[1] offset by 13.64 towards Jumpangle[1] degrees)
      • Unit - Move Jumper[1] instantly to Jumpforward[1]
      • Custom script: call RemoveLocation(udg_Jumploc[1])
      • Custom script: call RemoveLocation(udg_Jumpforward[1])
  • Fall1
    • Events
      • Time - Airtime[1] expires
    • Conditions
    • Actions
      • Animation - Reset Jumper[1]'s animation
      • Animation - Change Jumper[1] flying height to 0.00 at (Maxdistance[1] / 0.55)
      • Countdown Timer - Start Falltime[1] as a One-shot timer that will expire in ((1.10 x Maxdistance[1]) / 1000.00) seconds
  • Land1
    • Events
      • Time - Falltime[1] expires
    • Conditions
    • Actions
      • Unit - Turn collision for Jumper[1] On
      • Trigger - Turn off air1 <gen>
      • Set Jumper[1] = No unit
      • Custom script: call RemoveLocation(udg_Jumpland[1])
 
Top