- Joined
- Aug 20, 2009
- Messages
- 1,552
Anyone mind explaining how Unit recycling works?
and how can it be applied?
i wanted to use this on projectile system,
anyone has it? is it a function? or is it a system?
GUI/JASS is fine by me.
and how can it be applied?
i wanted to use this on projectile system,
anyone has it? is it a function? or is it a system?
Why do I want to recycle projectiles anyway?
Every time you create a new unit and destroy it, WC3's memory use goes up and doesn't seem to come back down. It causes performance degradation over time even if you don't leak.
Creating units is just about the slowest thing possible in WC3, too. If you try to make a machine gun that fires 20 bullets per second by creating dummy units, you will lag. With unit recycling, I have made a machine gun that can fire over 200 bullets per second before the framerate starts to dip (and I am sure it was because of the 200 bullets traveling, not because of creating 200 bullets). And if 200 bullets per second sounds excessive, just imagine that as 10 players each firing the 20 bullet per second machine guns.
Whether you notice any improvement in a particular map is going to depend on how many projectiles it creates over time and what interval they're created at. I highly recommend unit recycling for any shooter-type map that has guns firing at a high frequency. For other types of games, unit recycling should be optional.
GUI/JASS is fine by me.