#Does removing units after death improve performance?

1 messages · Page 1 of 1 (latest)

winged iron
#

I've been told that removing units after they die with UTIL_Remove would free them up from the memory and thus improve performance. I'm not sure how true this is, so I would appreciate if anyone could shed some light on the topic.

solar monolith
#

They are removed automatically.

#

You don't need to be removing them manually unless you gave them weird modifiers or something

winged iron
#

Thanks, that's what I suspected. Made little sense to remove them because they're already dead anyway

solar monolith
#

I mean, they die, play their death animation, then go below the ground, where they are removed completely

winged iron
#

Yeah. I'd assume it would only be an issue if a modifier the unit has isn't removed on death, but alas

solar monolith
#

They might not be removed if you give them SetUnitCanRespawn

#

as they're waiting to be resurrected essentially

winged iron
#

That's a good point, makes sense, will keep it in mind

minor gorge
#

npc_dota_thinker units a.k.a. thinkers are sometimes not removed automatically. That's why you can see Valve examples (siltbreaker, aghs lab etc.) use UTIL_Remove very often for thinkers. I use ForceKill for thinkers because it's safer. So the person that told you 'that removing units after they die with UTIL_Remove would free them ' probably thought of thinkers instead of normal units.

autumn mantle
craggy jay
#

They not removed if have permanent modifiers for example

winged iron
solar monolith
fickle wrenBOT
#

Found 1 function for createmodifierthinker

🇸 CreateModifierThinker(caster: CDOTA_BaseNPC|nil, ability: CDOTABaseAbility|nil, modifierName: string, paramTable: table|nil, origin: Vector, teamNumber: DOTATeam_t, phantomBlocker: bool): CDOTA_BaseNPC
Create a modifier not associated with an NPC.

solar monolith
#

Seems like the description is a lie lol.

winged iron
#

Oh right, I've seen it before but I never use it, so I guess it's not something I have to worry about then?

#

I only use StartIntervalThink

solar monolith
#

It's useful for things that are placed on a location, e.g. Disruptor's Static Storm - you make a modifier that ticks and does the damage and has an aura that silences/mutes enemies inside, yada yada yada

#

The StartIntervalThink is not relevant to this discussion

winged iron
#

I just create units manually and kill them afterwards

#

I suppose that's inefficient but oh well

solar monolith
#

It's the same as doing this, really

#

The best thing to do is actually to find a solution that has nothing to do with a modifier

#

For instance you could just have a timer/context thinker deal damage in that area while the particle and sound are playing

#

This way you're not spawning units at all which is what Dota's engine is so terrible with

winged iron
#

Right, that makes sense

solar monolith
#

I remember Dota IMBA implemented Batrider's Firefly thing and that always caused immense lags whenever people used it in a game

#

It created a modifier thinker every 0.5 seconds IIRC which made up the trail of fire

#

And each of those were auras for debuffing units to take damage periodically

#

And of course there was a talent to extend the duration even more