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

Why there is still an end-game delay despite I had removed the leaked memory?

Status
Not open for further replies.
Level 10
Joined
Jan 18, 2010
Messages
79
  • Untitled Trigger 001
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Group_A = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Set Point_A = ((Position of (Picked unit)) offset by 15.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Point_A
          • Custom script: call RemoveLocation(udg_Point_A)
      • Custom script: call DestroyGroup(udg_Group_A)
I used every 0.01 second coz I want to test the map with the fastest result to be seen...

Yea, i forget to mention that there is only 6 units in the map. It still delay when I quit the game. What is the causes? Is there still memory leaks?
 
  • Untitled Trigger 001
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set Group_A = (Units in (Playable map area))
      • Unit Group - Pick every unit in Group_A and do (Actions)
        • Loop - Actions
          • Set Point_A = (Position of (Picked unit))
          • Set Point_B = (Point_A) offset by 15.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Point_B
          • Custom script: call RemoveLocation(udg_Point_A)
          • Custom script: call RemoveLocation(udg_Point_B)
      • Custom script: call DestroyGroup(udg_Group_A)
 
Level 10
Joined
Jan 18, 2010
Messages
79
Gosh i overlooked it. >.<

BTW if I m using hashtable, and I am attaching some integer, real and boolean to some units periodically, would this causes memory leak too when i remove the unit (handler)? Since real, integer n boolean should be the native data to computers.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Also, in the "I want to see result as fast as I can", once every 0.03 seconds is enough
0.01 is TOO laggy, it performs a check 100 per second, compared to 0.03s, it performs check a 33 times per second
0.03 is sufficient for our naked eyes, trust me

As far as I know, Integer/Real doesn't leak
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
It depends, if the unit is not cleaned up, it WILL leak
Like dummy, you must add its Expiration Timer (usually people set it to 0.50 seconds, just for casting purposes)
Example:
  • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
(Last created unit) will always be referred as your Dummy Unit
 
Level 10
Joined
Jan 18, 2010
Messages
79
Yeah...not only I kill them, but I removed them from the game. =)
Anyway...I have another question:


  • Untitled Trigger 003
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in GrowingPlants and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
              • Set Real_A = (0.00 + ((Real((Custom value of (Picked unit)))) x ((100.00 / GrowTime) x 0.60)))
              • Animation - Change (Picked unit)'s vertex coloring to (Real_A%, 100.00%, 0.00%) with 0.00% transparency
            • Else - Actions
              • Unit Group - Remove (Picked unit) from GrowingPlants

Would this action created many "unit group" objects which causes leaks, or it is just only 1 "unit group" all the time, which is contained in a pointer variable (Growing Fruit)...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You must set a variable of Unit Group type once every 0.05 seconds
And every 0.05 seconds, you must clean the leaks too
Real_A does not leak I think because Integer/Real doesn't leaks as I've told you (or maybe I was wrong)
Example trigger:
  • Untitled Trigger 003
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set GrowingPlants = SomethingYouKnowAbout (this is your UnitGroup)
      • Unit Group - Pick every unit in GrowingPlants and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
              • Set Real_A = (0.00 + ((Real((Custom value of (Picked unit)))) x ((100.00 / GrowTime) x 0.60)))
              • Animation - Change (Picked unit)'s vertex coloring to (Real_A%, 100.00%, 0.00%) with 0.00% transparency
            • Else - Actions
              • Unit Group - Remove (Picked unit) from GrowingPlants
      • Custom script: call DestroyGroup(udg_GrowingPlants)
 
Level 10
Joined
Jan 18, 2010
Messages
79
Oh yeah...I had just figured it out too...but I m not too sure. Haha. Yeah what you said is excalty correct. =D I get your point. So I have done it this way:

  • Untitled Trigger 003
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = GrowingPlants
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
              • Set Real_A = (0.00 + ((Real((Custom value of (Picked unit)))) x ((100.00 / GrowTime) x 0.60)))
              • Animation - Change (Picked unit)'s vertex coloring to (Real_A%, 100.00%, 0.00%) with 0.00% transparency
            • Else - Actions
              • Unit Group - Remove (Picked unit) from GrowingPlants
      • Custom script: call DestroyGroup(udg_TempGroup)
Gonna try if it works. Haha. Any probs I would post again. =D
 
Level 10
Joined
Jan 18, 2010
Messages
79
  • Untitled Trigger 003
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Add all units of GrowingPlants to TempGroup
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Picked unit)) Less than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
              • Set Real_A = (0.00 + ((Real((Custom value of (Picked unit)))) x ((100.00 / GrowTime) x 0.60)))
              • Animation - Change (Picked unit)'s vertex coloring to (Real_A%, 100.00%, 0.00%) with 0.00% transparency
            • Else - Actions
              • Unit Group - Remove (Picked unit) from GrowingPlants
      • Custom script: call DestroyGroup(udg_TempGroup)

Hmmm...This should work i think? gonna test it again. =/
 
Level 10
Joined
Jan 18, 2010
Messages
79
Yeah, I want them to groe in time. But in facts is every 2 seconds. But I wanna test its leaks, so i changed it to 0.05. Haha.

Anyway my new method does not work too. When I destroy the TempGroup, it destroyed the GrowingPlants too...I wonder why. Even I use "Add all units in group to group", but still bugged. =\
 
Level 12
Joined
Apr 4, 2010
Messages
862
I kill for you's trigger (first) is correct, however, if theres the call DestroyGroup there, it will make the group be destroyed, and u have to create the group again.
We should only destroy temporary groups. (used once only)
example: pick every unit in playable map ( it leaks )
  • Actions
    • Set Variable - TempGroup1 = Unit in playable map
    • Unit Group - pick every unit in TempGroup1
      • Unit - Kill picked unit.
    • Custom script: call DestroyGroup(udg_TempGroup1)
Note: This is wut u do to a temporary group.
endif.
-That is how u do eeetttttt :D

Edit: Wait a min.... lol, which one do u want???
You want to make a permanent group or a temp group???
 
Status
Not open for further replies.
Top