• 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.

Unit Group Leaks

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2007
Messages
189
I just have a quick question. Unit groups leak if not destroyed right? so if for example i make a trigger that calls the units in the group say every .00000001 of a second im about to experience an unhappy computer?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You can go lower than 0.01, you just have to use arithmetic function in GUI:

  • Untitled Trigger 108
    • Events
      • Time - Every (0.01 / 2.00) seconds of game time
    • Conditions
    • Actions
      • Set Temp_Real_4 = (Temp_Real_4 + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real_4 Equal to 1000.00
        • Then - Actions
          • Game - Display to (All players) the text: (String(Temp_Real_4))
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Untitled Trigger 108 Copy
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Real_3 = (Temp_Real_3 + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real_3 Equal to 1000.00
        • Then - Actions
          • Game - Display to (All players) the text: (String(Temp_Real_3))
          • Trigger - Turn off (This trigger)
        • Else - Actions
Temp_Real_4 will display the text a lot sooner.
 
Last edited:
You can go lower than 0.01, you just have to use arithmetic function in GUI:

  • Untitled Trigger 108
    • Events
      • Time - Every (0.01 / 2.00) seconds of game time
    • Conditions
    • Actions
      • Set Temp_Real_4 = (Temp_Real_4 + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real_4 Equal to 1000.00
        • Then - Actions
          • Game - Display to (All players) the text: (String(Temp_Real_4))
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Untitled Trigger 108 Copy
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Real_3 = (Temp_Real_3 + 1.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Temp_Real_3 Equal to 1000.00
        • Then - Actions
          • Game - Display to (All players) the text: (String(Temp_Real_3))
          • Trigger - Turn off (This trigger)
        • Else - Actions
Temp_Real_4 will diplay the text a lot sooner.

oh.. never thought it would accept that value...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
WC3 uses 32 bit floats I believe which means they have limited accuracy. 0 is a perfectly valid time. However it still has a delay as I believe it runs the timer next internal update cycle.

Unit groups do not leak by them selves, they only leak if you make new ones and then lose the pointers to them before destroying them (something WC3.'s garbage collector could easilly catch but does not). Generally I advise making a constant group and then just using the enums on it as they only alter the contense of the group and do not make new groups. This is the most efficent way as you only have like 1 group used by many systems which is never destroyed and always reused meaning no wasted time in object allocation / deallocation.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

Hmm don't matches the topic - but I didn't know what Maker says so I want to test it.
After I try something else ( don't know why ) but the editor do some mistakes. Take a look for your self.
( The event-time isn't to fast because he do the same thing with 0.10 seconds and 0.25 seconds. )

  • TriggerReal
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set TempReal1 = (TempReal1 + 0.01)
      • Game - Display to (All players) the text: (String(TempReal1))


bgbuuioi7jof1gmyv.gif


After some time he change the 9 into a 7 after into a 6 and so on ...
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
WC3 uses 32 bit floats I believe which means they have limited accuracy. 0 is a perfectly valid time. However it still has a delay as I believe it runs the timer next internal update cycle.

Unit groups do not leak by them selves, they only leak if you make new ones and then lose the pointers to them before destroying them (something WC3.'s garbage collector could easilly catch but does not). Generally I advise making a constant group and then just using the enums on it as they only alter the contense of the group and do not make new groups. This is the most efficent way as you only have like 1 group used by many systems which is never destroyed and always reused meaning no wasted time in object allocation / deallocation.

are you refering to Risens GroupUtils?
 
Status
Not open for further replies.
Top