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

Leaks, effects vs units

Status
Not open for further replies.
Level 13
Joined
Mar 16, 2008
Messages
941
Hey guys.
I don't even have a problem, just an idea I saw somewere ago.
We all know that effects leak, and that removed effects still keep some memory (leaks can't be cleaned completly) while units don't leak after being removed.
I thought of using dummy units for every effect...
Pro:
- Can be removed very easy due to expiration timers
- Units don't leak after being removed
Contra:
- Loading time increased dramaticly if many units are required
- I think unit creation is slower then effect creation (I can create more effects then units before it starts lagging, at least at my comp)
- Would "require" a small system: hashtable with string keys to get the unit ids

Comments? Or does it already exist?
Justify
 
Level 5
Joined
Dec 18, 2007
Messages
205
does it already exist? i don't know because i haven't looked it up or cared much of it.
but is it in use? hell, yeah, especially i use them a lot. not only because you can add units to a group whereas effects just can be summed up as an array. sure you have to create lots of units, but if there's a spell where you create a lot of special effects at once (good example is Spectre's Spectral Dagger from DotA where the Shadow Path appears --> they are obviously units and not effects) it is better (imo) to create units instead of sfx. Other spells with 1 sfx are no prob i think, if they are not there to be spammed like hell.
but i can't imagine a system i saw for that.

greetings
 
Level 11
Joined
Apr 29, 2007
Messages
826
No wonder you didn't find a system because all you have to do is create units instead of effects. I don't see where that would need any system at all. (Maybe removing units after x seconds, but there are systems for that)

Well another advantage of using units instead is that you can simply move them around (even in 3d)
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Effects don't leak memory, rather effects have a decay time, which is reconfigurable on the Gameplay Constants, that's why effects aren't recycled immediately. I think it was done to make effects display their death animations properly.

Loading time increased dramaticly if many units are required
True, but more related to slk data.

I think unit creation is slower then effect creation (I can create more effects then units before it starts lagging, at least at my comp)
True, units have more data stuffed onto them.

Actually, choosing between the two is pointless, since some effects are stationary and don't require the functionality of dummy units. The best thing to do is to decide which spells need a non-dynamic effect and which spells don't.

Look at Vexorian's XE module for more details on dynamic effects.
 
Level 8
Joined
Oct 3, 2008
Messages
367
Units DO leak after destruction. Irreversibly so. Unit creation is also very, very slow.

Using an effect attached to a recycled dummy unit gives you nearly the efficiency of effects with the ability to size, tint, and move units.
 
Status
Not open for further replies.
Top