• 🏆 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!

[General] Remove Unit

Status
Not open for further replies.

EdgeOfChaos

E

EdgeOfChaos

But then they explode.
I've never heard of remove unit leaking
 
Level 12
Joined
Dec 11, 2014
Messages
662
Maybe set the gameplay constant to 0?
 

Attachments

  • Screenshot_1.jpg
    Screenshot_1.jpg
    5.1 KB · Views: 36

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
1. Using the remove unit leaks
Actually it is removing any unit leaks. Or in other words units always leak. This was tested long ago so it is possible it has been fixed in 1.28. Basically if a unit gets removed by decaying, exploding or by RemoveUnit call it always leaves something in memory.

This leak can be considered trivial. It takes well over 10,000 units before it even starts to be considered problematic, and if your map uses so many units chances are the problem is with your map design and not units leaking. If one needs to create a lot of dummy units for triggered abilities then consider recycling the dummies rather than making them new each time. Simply caching a few of each type of dummy unit is more than enough for 99.9% of play cases the dummy is needed.
I was thinking that hiding the unit on death, maybe that would also hide the decay effect?
It might pause decay by removing it from appropriate sub systems, thus making an actual unit object leak and not some leftover memory from a unit object.
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Maybe set the gameplay constant to 0?
No. This would affect other units as well.

Actually it is removing any unit leaks. Or in other words units always leak. This was tested long ago so it is possible it has been fixed in 1.28. Basically if a unit gets removed by decaying, exploding or by RemoveUnit call it always leaves something in memory.

This leak can be considered trivial. It takes well over 10,000 units before it even starts to be considered problematic, and if your map uses so many units chances are the problem is with your map design and not units leaking. If one needs to create a lot of dummy units for triggered abilities then consider recycling the dummies rather than making them new each time. Simply caching a few of each type of dummy unit is more than enough for 99.9% of play cases the dummy is needed.

It might pause decay by removing it from appropriate sub systems, thus making an actual unit object leak and not some leftover memory from a unit object.

But then they explode.
I've never heard of remove unit leaking

Well in GUI we always use the expiration timer instead of the remove unit, thought it was because it leaked.
 
Status
Not open for further replies.
Top