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

[General] Projectile recycle vs unit expiration timer for dummy.

Status
Not open for further replies.
Level 8
Joined
Mar 10, 2009
Messages
213
Does a dead unit occupy that much memory? Can it be removed from the memory at all?

Which method of dealing with the issue is more cost-efficient? By that I mean memory resources spent on reusing/checking conditions/playing sound/hiding/unhiding/relocating etc. the said dummy unit or simply on keeping a dead unit as is.

I fear that the WC3 might dedicate just as much 'effort' to running any, even the best recycle system.

Before posting this question I've spent at least an hour reading the archived messages on this topic through /search.

However, I still don't understand, whether the dummy recylcing system is an absolute must-have requirement for a lengthy playthrough. This resource Triggers - Memory Leaks and Custom Scripts states that adding an expiration timer doesn't create leaks, but many hive users stated otherwise.

Using only the expiraiton timer, I have launched my map in test mod, forcing each unit to emit 100 dummy projectiles (emulating gatling laser, minigun, fatman, nuka-launcher etc) every 3 sec, let it run for 2 hours and after that I observed no visible lag, compared to that, let's say, of Castle Wars unit pile-up. I fear that no matter what I do, I won't be able to avoid every tiny leak, and the game will eventually bug. Given that my map requires at least several hours to be completed, should I let it go and focus on other things? Or should I implement any dummy recycling system? (Doesn't matter which, there are plenty on hive.)
 
Level 8
Joined
Jul 10, 2018
Messages
383
Every map has a tiny leak, it's understandable but for the greater good so even if you have a tiny leak doesn't mean that it will lag that much
You should focus on other things.

I myself have very few leaks but i cannot do anything about it it's Natural so Good luck.:)
 
Level 8
Joined
Mar 10, 2009
Messages
213
You should focus on other things.
Thank you. That's such a relief. I tend to become a maniac when it comes to those things. Gonna take your advice seriously and focus on the rest of the dev. process.

Update:
I tried to implement a recycling system for the sheer empirical purpose, eventually in my case it is a bit taxing on resources, to say the least.
Algorithm:
1. Create immune locust dummies per ammo type (20+ types) and list index
2. Hide (or store, whatever) and move dummies
3. When needed - move instantly and unhide
4. Use projectiles
5. Hide and move
Created number = max rounds per attack turn x shots per round (100x100 x ammo type dummy (at least 20, => 200 000 to store at all times, reduced to 2000, if recycling within recycling))
=> takes way too much resources to keep in memory permanently.

Expiration timer is a preferable option for such a situation. Lfie duration of each is 0.03-0.08 sec. No decay, no lag. So, as Veldris said, not worth focusing on this, unless you use only a very limited number of projectiles (like for normal spells, not bullets/ammo), then the recycling procedure pays off.

TLDR: Kinda "solved", I guess.
 
Last edited:
Status
Not open for further replies.
Top