It's been around year since i have taken a break from working on my map, and a few days ago i've returned to working on it.
I have added new content and everything seemed to work fine... that's until i've tested the map for a while and it suddenly crashed to a memory leak.
After tracing the cause, i have found out that the slider system i have made for the map's plane units' movement is the cause to the leak, which i have found out after training a lot of planes and letting them chill with their idle slider circling movement, which has caused the game's memory consumption to constantly go up until the frame drops make it barely playable.
I have been trying to inspect the triggers as carefully as possible but to no avail, i can't seem to find the leak source.
Here are the triggers, any kind of help will be appreciated.
Here's the trigger for the idle sliding:
I have added new content and everything seemed to work fine... that's until i've tested the map for a while and it suddenly crashed to a memory leak.
After tracing the cause, i have found out that the slider system i have made for the map's plane units' movement is the cause to the leak, which i have found out after training a lot of planes and letting them chill with their idle slider circling movement, which has caused the game's memory consumption to constantly go up until the frame drops make it barely playable.
I have been trying to inspect the triggers as carefully as possible but to no avail, i can't seem to find the leak source.
Here are the triggers, any kind of help will be appreciated.
Here's the trigger for the idle sliding:
-
Slide
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Sliders and do (Actions)
-
Loop - Actions
- Set Loc1 = (Position of (Picked unit))
- Set Loc3 = ((Position of (Picked unit)) offset by ((Real((Custom value of (Picked unit)))) / PlaneSpeedModifier) towards ((Facing of (Picked unit)) + 3.00) degrees)
- Unit - Make (Picked unit) face Loc3 over 0.00 seconds
- Set Loc2 = (Loc1 offset by ((Real((Custom value of (Picked unit)))) / PlaneSpeedModifier) towards (Facing of (Picked unit)) degrees)
- Custom script: call SetUnitX( GetEnumUnit(), GetLocationX(udg_Loc2) )
- Custom script: call SetUnitY( GetEnumUnit(), GetLocationY(udg_Loc2) )
- Custom script: call RemoveLocation(udg_Loc3)
- Custom script: call RemoveLocation(udg_Loc2)
- Custom script: call RemoveLocation(udg_Loc1)
-
Loop - Actions
-
Unit Group - Pick every unit in Sliders and do (Actions)
-
Events
-
Slide2
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Sliders2 and do (Actions)
-
Loop - Actions
- Set Loc1 = (Position of (Picked unit))
- Set Loc2 = (Loc1 offset by ((Real((Custom value of (Picked unit)))) / PlaneSpeedModifier) towards (Facing of (Picked unit)) degrees)
- Custom script: call SetUnitX( GetEnumUnit(), GetLocationX(udg_Loc2) )
- Custom script: call SetUnitY( GetEnumUnit(), GetLocationY(udg_Loc2) )
- Custom script: call RemoveLocation(udg_Loc3)
- Custom script: call RemoveLocation(udg_Loc2)
- Custom script: call RemoveLocation(udg_Loc1)
-
Loop - Actions
-
Unit Group - Pick every unit in Sliders2 and do (Actions)
-
Events