• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

New Style

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Is it the new style of coding in Warcraft III that we have to remove unit once we're done with it ?
I see many new users do this, especially dummies.
Usually I just kill the dummy and remove it from Unit Group, but now I see people kill it then remove from group AND remove it from the map (RemoveUnit).

Is it really does affect your game performance if we don't remove the unit (just kill it) ?

The thing is, I am making my dummy to move (missile) from Point A to Point B.

Once it reaches Point B, it's suppose to play its death animation (kill - by default, will play its death animation).

So, by removing that unit, I can't see the animation any longer and I don't want to create a more advance system just to handle this animation.

That's why I opened this thread, to ask if the RemoveUnit function to dummy unit does has big impact on the game performance.

If you give your opinion, please prove with some experiments and benchmarking, don't simply put words, thank you.
 
Level 12
Joined
Oct 16, 2010
Messages
680
well I don't know if it leaks or not but you can remove the unit at point B, just to make sure it won't couse anything

make a special effect at point B with the units death animation.
than you can simply remove it.

Sorry if this is not the answer you are here for, tought it could help
 
Level 11
Joined
Jun 20, 2009
Messages
880
As you said, killing the unit will play the death animation. And if you remove it too, the death animation will not be played, therefore it doesn't cause anything graphical and doesn't stress your graphics card.

The results can only be notice with a low-end graphics card.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
make a special effect at point B with the units death animation.
than you can simply remove it.
Just for the sake to show it, I'm gonna need SFX ?
I think not.

As you said, killing the unit will play the death animation. And if you remove it too, the death animation will not be played, therefore it doesn't cause anything graphical and doesn't stress your graphics card.

The results can only be notice with a low-end graphics card.
I'm not talking about some computers can't handle the graphic dealt by the animation itself, because some people say that by removing your unit (mostly dummies) will clean unit leak, because "dead units" stays there until you remove it.

But I find it hard to believe this "rumors".
Therefore, is it a requirement these days to have your dummy remove right after usage ?
If that so, dead unit should also be removed from the map (excluding Heroes) ?

There would be many time of occurrence for the trigger to register death Event, that would be more less efficient I think (to register many units death at once - for long period of time).
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
The killed unit is removed once it finishes playing it's death animation or a few moments later, but Killing Units sometimes implies a Dying sound or animation they don't want.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Necro on this thread since I don't get a clear vision yet.

The killed unit is removed once it finishes playing it's death animation or a few moments later
Usually, people would do this to "clean" dummy unit leak;
  • Melee Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Unit - Remove (Triggering unit) from the game
You see ?
The trigger is instant, therefore when the unit dies, it will be instantly be removed from the game before it gets to play its death animation which I don't support at all, because I don't want my unit to abruptly disappears from sight, it should die and slowly fades/etc.

The thing is, is it really a necessary to remove dummy units from game ?
Because I'll be posting future resources (including spells), I'm afraid it won't gets approved if I don't "obey" this new "trend".
And please, provide your reason with a solid backup to your answers.

Thank you.
 
Add wait 2 sec before Remove action and it will still work perfectly fine :)

But you don't need to remove it, killed unit will be removed after 50-60 seconds, depending on gameplay constants.
If you don't believe me, add 300 sec wait there are try to for example ping that unit location using GetUnitX(GetTriggerUnit()), value will be 0, because triggering unit won't exist anymore.

This is warcraft, we care about fast and optimized code in systems that run in backgrounds or fire often (timer 0.03 sec and so on), everything else is acceptable.

I moderated maps guided with those rules.

EDIT:

Oh 1 last thing, some things won't be removed from map even with such commands, so if possible in cases where you use 5 or more dummies for single spell then try to recycle them.
Create units at initialization and use them each time you need something, trust me it will be far more efficient that constantly creating same unit over and over again :)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Oh 1 last thing, some things won't be removed from map even with such commands, so if possible in cases where you use 5 or more dummies for single spell then try to recycle them.
Create units at initialization and use them each time you need something, trust me it will be far more efficient that constantly creating same unit over and over again :)
What is the dummy unit, acting as Special Effects of a spell ?
You're fked up =,="

You can't recycle units which you do not know how many dummy units to be generated via the spell cast.

BUT, if you are telling me to recycle the unit, let's say the unit act as a dummy caster casting a spell, that, we can recycle, because by setting unit's animation cast bla bla to 0.00 seconds will make it cast instantly, you can even have 1 Dummy Caster per map to handle all types of instant spell effect abilities.

But how do we deal with units acting as Special Effect ?
 
So, do you support the trend to remove the dummy unit once it has done its job ?
Like for example, unit acting as Special Effect ?
Yes, because frames per second and lag in general is generated with more animated objects you display on the screen at same time. Creating 10 animated objects will act more or less same as creating 100 static ones.

When unit die, wait few seconds and remove it after that.

I will give you another example, in tower defense maps there is "rule" to remove bones decay and expiration time to reduce lag. I just explained why, decay animations last up to 60 seconds, and when you have even dead 50 units on the screen lag is greater than having 10 alive units (Test it if you don't believe I should be right, use /fps command to see). That's why we can place over 200-300 doodads and display them at the same time on the screen without any lag, but if we place just 10 cinematic doodads (fire for example) it start to lag.
 
Status
Not open for further replies.
Top