- Joined
- Jan 7, 2005
- Messages
- 2
I'm using Kattana's Waypoint System and I am having some trouble with a memory leak. The waypoint system is excellent, so I imagine that the trouble is somewhere in my code.
I copied the waypoint system's code in its entirety over into the proper area, the custom script code that executes before all the triggers.
I have all non-waypoint related triggers disabled, and I create 8 units on both sides of the map. They move down 4 separate paths toward each other. Each path is composed of a line of 15 waypoints. One set moves from 108-167, one from 113-166, one from 114-160, and the final one from 109-168. The ones on the other side of the map take the reverse course. These waypoints aren't sequentially connected(108 to 109 to 110, etc.), for example one path is 108-133-136-144-145-146-147-153-161-162-155-156-163-164-167.
After sending those 16 units, they attack eachother approx in the middle and only a few units remain to reach the end of their journey. Once they stop at their destination waypoint, memory stops increasing. At this point, that one trip of 16 units has consumed approx 15mb. Sending another 16 units results in an additional 15mb being used up.
Here is the trigger I use to move the units:
And this is the trigger that I use to initialize the waypoints. 0-107 are all the waypoints on the map, 108+ are the same waypoints, with some of the extraneous ones removed, so that I could make 4 separate paths that are not connected to each other.
I really like using this system, and I am hoping that it is something wrong with the way I am using it, because I'm not too fond of the idea of scrapping it and going back to using regions, or some other method of pathing the units.
Zak_
I copied the waypoint system's code in its entirety over into the proper area, the custom script code that executes before all the triggers.
I have all non-waypoint related triggers disabled, and I create 8 units on both sides of the map. They move down 4 separate paths toward each other. Each path is composed of a line of 15 waypoints. One set moves from 108-167, one from 113-166, one from 114-160, and the final one from 109-168. The ones on the other side of the map take the reverse course. These waypoints aren't sequentially connected(108 to 109 to 110, etc.), for example one path is 108-133-136-144-145-146-147-153-161-162-155-156-163-164-167.
After sending those 16 units, they attack eachother approx in the middle and only a few units remain to reach the end of their journey. Once they stop at their destination waypoint, memory stops increasing. At this point, that one trip of 16 units has consumed approx 15mb. Sending another 16 units results in an additional 15mb being used up.
Here is the trigger I use to move the units:
JASS:
function Trig_Send_Units_Test_Custom_Actions takes nothing returns nothing
set bj_forLoopBIndex = 1
set bj_forLoopBIndexEnd = 4
loop
exitwhen bj_forLoopBIndex > bj_forLoopBIndexEnd
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 2
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call UnitGotoWaypoint( (CreateUnit(Player(0), 'H00A', -8863.00, -9351.00, bj_UNIT_FACING)), 167, true)
call UnitGotoWaypoint( (CreateUnit(Player(0), 'H009', -8863.00, -9351.00, bj_UNIT_FACING)), 166, true)
call UnitGotoWaypoint( (CreateUnit(Player(0), 'H007', -8863.00, -9351.00, bj_UNIT_FACING)), 160, true)
call UnitGotoWaypoint( (CreateUnit(Player(0), 'H00B', -8863.00, -9351.00, bj_UNIT_FACING)), 168, true)
call UnitGotoWaypoint( (CreateUnit(Player(1), 'H00A', 8511.00, 8439.00, bj_UNIT_FACING)), 108, true)
call UnitGotoWaypoint( (CreateUnit(Player(1), 'H009', 8511.00, 8439.00, bj_UNIT_FACING)), 113, true)
call UnitGotoWaypoint( (CreateUnit(Player(1), 'H007', 8511.00, 8439.00, bj_UNIT_FACING)), 114, true)
call UnitGotoWaypoint( (CreateUnit(Player(1), 'H00B', 8511.00, 8439.00, bj_UNIT_FACING)), 109, true)
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopBIndex = bj_forLoopBIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Send_Units_to_Attack_Custom_Copy takes nothing returns nothing
set gg_trg_Send_Units_to_Attack_Custom_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Send_Units_to_Attack_Custom_Copy, Player(0), "move", true )
call TriggerAddAction( gg_trg_Send_Units_to_Attack_Custom_Copy, function Trig_Send_Units_Test_Custom_Actions )
endfunction
And this is the trigger that I use to initialize the waypoints. 0-107 are all the waypoints on the map, 108+ are the same waypoints, with some of the extraneous ones removed, so that I could make 4 separate paths that are not connected to each other.
JASS:
function InitWaypoints takes nothing returns nothing
call NewWaypoint( 8936 , -8529 ) //0
call NewWaypoint( -9070 , -9050 ) //1
call NewWaypoint( -8261 , -8059 ) //2
call NewWaypoint( -8989 , -5145 ) //3
call NewWaypoint( -7811 , -3868 ) //4
call NewWaypoint( -8989 , -3198 ) //5
call NewWaypoint( -8989 , -550 ) //6
call NewWaypoint( -8175 , -250 ) //7
call NewWaypoint( -7978 , 3387 ) //8
call NewWaypoint( -8023 , -8538 ) //9
call NewWaypoint( -8285 , -8167 ) //10
call NewWaypoint( -6479 , -6680 ) //11
call NewWaypoint( -7505 , -5624 ) //12
call NewWaypoint( -6139 , -5108 ) //13
call NewWaypoint( -6435 , -3887 ) //14
call NewWaypoint( -6006 , -771 ) //15
call NewWaypoint( -7897 , 563 ) //16
call NewWaypoint( -6321 , 2625 ) //17
call NewWaypoint( -6820 , 4487 ) //18
call NewWaypoint( -5858 , -7596 ) //19
call NewWaypoint( -5172 , -6630 ) //20
call NewWaypoint( -4991 , -1837 ) //21
call NewWaypoint( -5428 , 4097 ) //22
call NewWaypoint( -5872 , 6420 ) //23
call NewWaypoint( -5792 , 8464 ) //24
call NewWaypoint( -4953 , -9050 ) //25
call NewWaypoint( -4306 , -7356 ) //26
call NewWaypoint( -3453 , -6840 ) //27
call NewWaypoint( -3618 , -4557 ) //28
call NewWaypoint( -4156 , -2789 ) //29
call NewWaypoint( -4391 , 1597 ) //30
call NewWaypoint( -4301 , 7763 ) //31
call NewWaypoint( -3145 , -8472 ) //32
call NewWaypoint( -3426 , -3458 ) //33
call NewWaypoint( -3663 , -1647 ) //34
call NewWaypoint( -3824 , 910 ) //35
call NewWaypoint( -4169 , 3683 ) //36
call NewWaypoint( -3530 , 5272 ) //37
call NewWaypoint( -2308 , -4539 ) //38
call NewWaypoint( -2587 , -2738 ) //39
call NewWaypoint( -1690 , -1600 ) //40
call NewWaypoint( -2966 , 4825 ) //41
call NewWaypoint( -2765 , 7579 ) //42
call NewWaypoint( -2808 , 5643 ) //43
call NewWaypoint( -1184 , -9050 ) //44
call NewWaypoint( -1409 , -5344 ) //45
call NewWaypoint( -1856 , 631 ) //46
call NewWaypoint( -645 , 1845 ) //47
call NewWaypoint( -224 , -8598 ) //48
call NewWaypoint( 532 , -4921 ) //49
call NewWaypoint( -304 , -3172 ) //50
call NewWaypoint( -117 , -943 ) //51
call NewWaypoint( 990 , 254 ) //52
call NewWaypoint( -267 , 4626 ) //53
call NewWaypoint( -43 , 8314 ) //54
call NewWaypoint( 1448 , -1991 ) //55
call NewWaypoint( 2077 , 40 ) //56
call NewWaypoint( 1009 , 1979 ) //57
call NewWaypoint( 2078 , 3061 ) //58
call NewWaypoint( 1209 , 3742 ) //59
call NewWaypoint( 2084 , 4417 ) //60
call NewWaypoint( 1264 , 5151 ) //61
call NewWaypoint( 1314 , 8725 ) //62
call NewWaypoint( 2599 , -5661 ) //63
call NewWaypoint( 3091 , -6416 ) //64
call NewWaypoint( 3208 , -8122 ) //65
call NewWaypoint( 3521 , -8466 ) //66
call NewWaypoint( 3663 , -4634 ) //67
call NewWaypoint( 2689 , -3755 ) //68
call NewWaypoint( 2999 , -3485 ) //69
call NewWaypoint( 3102 , 1036 ) //70
call NewWaypoint( 3786 , 1558 ) //71
call NewWaypoint( 4047 , 2714 ) //72
call NewWaypoint( 3226 , 3562 ) //73
call NewWaypoint( 3787 , 5198 ) //74
call NewWaypoint( 3605 , 7007 ) //75
call NewWaypoint( 2977 , 8386 ) //76
call NewWaypoint( 5275 , -8487 ) //77
call NewWaypoint( 4410 , -6358 ) //78
call NewWaypoint( 4914 , -3408 ) //79
call NewWaypoint( 5179 , -1769 ) //80
call NewWaypoint( 4564 , -250 ) //81
call NewWaypoint( 5564 , 686 ) //82
call NewWaypoint( 4867 , 1727 ) //83
call NewWaypoint( 4455 , 7294 ) //84
call NewWaypoint( 4777 , 8725 ) //85
call NewWaypoint( 4915 , 6428 ) //86
call NewWaypoint( 6418 , -6842 ) //87
call NewWaypoint( 6008 , -4978 ) //88
call NewWaypoint( 6431 , -3103 ) //89
call NewWaypoint( 6320 , -2557 ) //90
call NewWaypoint( 5546 , 3504 ) //91
call NewWaypoint( 6752 , 4335 ) //92
call NewWaypoint( 5957 , 4906 ) //93
call NewWaypoint( 6232 , 6539 ) //94
call NewWaypoint( 5973 , 7455 ) //95
call NewWaypoint( 7808 , 8258 ) //96
call NewWaypoint( 8204 , -3614 ) //97
call NewWaypoint( 7826 , -3019 ) //98
call NewWaypoint( 7943 , 21 ) //99
call NewWaypoint( 8931 , 641 ) //100
call NewWaypoint( 8931 , 2992 ) //101
call NewWaypoint( 7709 , 3733 ) //102
call NewWaypoint( 8931 , 5078 ) //103
call NewWaypoint( 7200 , 5072 ) //104
call NewWaypoint( 8120 , 7940 ) //105
call NewWaypoint( 8931 , 7682 ) //106
call NewWaypoint( 7879 , 8725 ) //107
call NewWaypoint( -9070 , -9050 ) //108
call NewWaypoint( -8261 , -8059 ) //109
call NewWaypoint( -8989 , -550 ) //110
call NewWaypoint( -8175 , -250 ) //111
call NewWaypoint( -7978 , 3387 ) //112
call NewWaypoint( -8023 , -8538 ) //113
call NewWaypoint( -8285 , -8167 ) //114
call NewWaypoint( -7505 , -5624 ) //115
call NewWaypoint( -6435 , -3887 ) //116
call NewWaypoint( -7897 , 563 ) //117
call NewWaypoint( -6321 , 2625 ) //118
call NewWaypoint( -6820 , 4487 ) //119
call NewWaypoint( -5858 , -7596 ) //120
call NewWaypoint( -5872 , 6420 ) //121
call NewWaypoint( -5792 , 8464 ) //122
call NewWaypoint( -4306 , -7356 ) //123
call NewWaypoint( -3453 , -6840 ) //124
call NewWaypoint( -3618 , -4557 ) //125
call NewWaypoint( -4156 , -2789 ) //126
call NewWaypoint( -4301 , 7763 ) //127
call NewWaypoint( -3426 , -3458 ) //128
call NewWaypoint( -3663 , -1647 ) //129
call NewWaypoint( -1690 , -1600 ) //130
call NewWaypoint( -2765 , 7579 ) //131
call NewWaypoint( -2808 , 5643 ) //132
call NewWaypoint( -1184 , -9050 ) //133
call NewWaypoint( -1856 , 631 ) //134
call NewWaypoint( -645 , 1845 ) //135
call NewWaypoint( -224 , -8598 ) //136
call NewWaypoint( -117 , -943 ) //137
call NewWaypoint( 990 , 254 ) //138
call NewWaypoint( -43 , 8314 ) //139
call NewWaypoint( 2077 , 40 ) //140
call NewWaypoint( 1009 , 1979 ) //141
call NewWaypoint( 2078 , 3061 ) //142
call NewWaypoint( 1314 , 8725 ) //143
call NewWaypoint( 2599 , -5661 ) //144
call NewWaypoint( 3091 , -6416 ) //145
call NewWaypoint( 3208 , -8122 ) //146
call NewWaypoint( 3521 , -8466 ) //147
call NewWaypoint( 3102 , 1036 ) //148
call NewWaypoint( 4047 , 2714 ) //149
call NewWaypoint( 3226 , 3562 ) //150
call NewWaypoint( 3787 , 5198 ) //151
call NewWaypoint( 3605 , 7007 ) //152
call NewWaypoint( 5275 , -8487 ) //153
call NewWaypoint( 4455 , 7294 ) //154
call NewWaypoint( 6431 , -3103 ) //155
call NewWaypoint( 6320 , -2557 ) //156
call NewWaypoint( 5546 , 3504 ) //157
call NewWaypoint( 6752 , 4335 ) //158
call NewWaypoint( 5973 , 7455 ) //159
call NewWaypoint( 7808 , 8258 ) //160
call NewWaypoint( 8204 , -3614 ) //161
call NewWaypoint( 7826 , -3019 ) //162
call NewWaypoint( 7943 , 21 ) //163
call NewWaypoint( 8931 , 641 ) //164
call NewWaypoint( 7200 , 5072 ) //165
call NewWaypoint( 8120 , 7940 ) //166
call NewWaypoint( 8931 , 7682 ) //167
call NewWaypoint( 7879 , 8725 ) //168
call ConnectWaypoints( 108 , 133 ) //Far Left Path
call ConnectWaypoints( 133 , 136 )
call ConnectWaypoints( 136 , 144 )
call ConnectWaypoints( 144 , 145 )
call ConnectWaypoints( 145 , 146 )
call ConnectWaypoints( 146 , 147 )
call ConnectWaypoints( 147 , 153 )
call ConnectWaypoints( 153 , 161 )
call ConnectWaypoints( 161 , 162 )
call ConnectWaypoints( 162 , 155 )
call ConnectWaypoints( 155 , 156 )
call ConnectWaypoints( 156 , 163 )
call ConnectWaypoints( 163 , 164 )
call ConnectWaypoints( 164 , 167 )
call ConnectWaypoints( 113 , 120 ) //Center Left Path
call ConnectWaypoints( 120 , 123 )
call ConnectWaypoints( 123 , 124 )
call ConnectWaypoints( 124 , 125 )
call ConnectWaypoints( 125 , 128 )
call ConnectWaypoints( 128 , 130 )
call ConnectWaypoints( 130 , 137 )
call ConnectWaypoints( 137 , 138 )
call ConnectWaypoints( 138 , 140 )
call ConnectWaypoints( 140 , 148 )
call ConnectWaypoints( 148 , 149 )
call ConnectWaypoints( 149 , 157 )
call ConnectWaypoints( 157 , 158 )
call ConnectWaypoints( 158 , 165 )
call ConnectWaypoints( 165 , 166 )
call ConnectWaypoints( 114 , 115 ) //Center Right Path
call ConnectWaypoints( 115 , 116 )
call ConnectWaypoints( 116 , 126 )
call ConnectWaypoints( 126 , 129 )
call ConnectWaypoints( 129 , 134 )
call ConnectWaypoints( 134 , 135 )
call ConnectWaypoints( 135 , 141 )
call ConnectWaypoints( 141 , 142 )
call ConnectWaypoints( 142 , 150 )
call ConnectWaypoints( 150 , 151 )
call ConnectWaypoints( 151 , 152 )
call ConnectWaypoints( 152 , 154 )
call ConnectWaypoints( 154 , 159 )
call ConnectWaypoints( 159 , 160 )
call ConnectWaypoints( 109 , 110 ) //Far Right Path
call ConnectWaypoints( 110 , 111 )
call ConnectWaypoints( 111 , 117 )
call ConnectWaypoints( 117 , 118 )
call ConnectWaypoints( 118 , 112 )
call ConnectWaypoints( 112 , 119 )
call ConnectWaypoints( 119 , 121 )
call ConnectWaypoints( 121 , 122 )
call ConnectWaypoints( 122 , 127 )
call ConnectWaypoints( 127 , 132 )
call ConnectWaypoints( 132 , 131 )
call ConnectWaypoints( 131 , 139 )
call ConnectWaypoints( 139 , 143 )
call ConnectWaypoints( 143 , 168 )
call ConnectWaypoints( 1 , 25 ) //Connecting All Waypoints
call ConnectWaypoints( 1 , 9 )
call ConnectWaypoints( 1 , 2 )
call ConnectWaypoints( 2 , 10 )
call ConnectWaypoints( 2 , 3 )
call ConnectWaypoints( 3 , 10 )
call ConnectWaypoints( 3 , 4 )
call ConnectWaypoints( 3 , 5 )
call ConnectWaypoints( 4 , 5 )
call ConnectWaypoints( 5 , 6 )
call ConnectWaypoints( 6 , 7 )
call ConnectWaypoints( 7 , 15 )
call ConnectWaypoints( 7 , 16 )
call ConnectWaypoints( 15 , 21 )
call ConnectWaypoints( 16 , 17 )
call ConnectWaypoints( 17 , 8 )
call ConnectWaypoints( 8 , 18 )
call ConnectWaypoints( 18 , 30 )
call ConnectWaypoints( 18 , 36 )
call ConnectWaypoints( 18 , 23 )
call ConnectWaypoints( 18 , 22 )
call ConnectWaypoints( 22 , 23 )
call ConnectWaypoints( 22 , 30 )
call ConnectWaypoints( 22 , 36 )
call ConnectWaypoints( 30 , 36 )
call ConnectWaypoints( 30 , 35 )
call ConnectWaypoints( 35 , 34 )
call ConnectWaypoints( 35 , 46 )
call ConnectWaypoints( 35 , 40 )
call ConnectWaypoints( 34 , 29 )
call ConnectWaypoints( 34 , 39 )
call ConnectWaypoints( 34 , 40 )
call ConnectWaypoints( 34 , 46 )
call ConnectWaypoints( 29 , 33 )
call ConnectWaypoints( 29 , 28 )
call ConnectWaypoints( 29 , 14 )
call ConnectWaypoints( 14 , 12 )
call ConnectWaypoints( 14 , 27 )
call ConnectWaypoints( 14 , 28 )
call ConnectWaypoints( 12 , 10 )
call ConnectWaypoints( 10 , 9 )
call ConnectWaypoints( 10 , 11 )
call ConnectWaypoints( 11 , 9 )
call ConnectWaypoints( 11 , 20 )
call ConnectWaypoints( 11 , 13 )
call ConnectWaypoints( 9 , 25 )
call ConnectWaypoints( 9 , 19 )
call ConnectWaypoints( 26 , 27 )
call ConnectWaypoints( 27 , 28 )
call ConnectWaypoints( 28 , 33 )
call ConnectWaypoints( 33 , 39 )
call ConnectWaypoints( 33 , 50 )
call ConnectWaypoints( 39 , 40 )
call ConnectWaypoints( 39 , 49 )
call ConnectWaypoints( 40 , 50 )
call ConnectWaypoints( 40 , 69 )
call ConnectWaypoints( 40 , 51 )
call ConnectWaypoints( 46 , 47 )
call ConnectWaypoints( 49 , 67 )
call ConnectWaypoints( 51 , 55 )
call ConnectWaypoints( 51 , 52 )
call ConnectWaypoints( 55 , 69 )
call ConnectWaypoints( 50 , 68 )
call ConnectWaypoints( 67 , 78 )
call ConnectWaypoints( 67 , 68 )
call ConnectWaypoints( 68 , 69 )
call ConnectWaypoints( 23 , 24 )
call ConnectWaypoints( 24 , 31 )
call ConnectWaypoints( 31 , 37 )
call ConnectWaypoints( 31 , 43 )
call ConnectWaypoints( 37 , 41 )
call ConnectWaypoints( 41 , 36 )
call ConnectWaypoints( 41 , 53 )
call ConnectWaypoints( 53 , 59 )
call ConnectWaypoints( 59 , 58 )
call ConnectWaypoints( 58 , 57 )
call ConnectWaypoints( 58 , 70 )
call ConnectWaypoints( 58 , 71 )
call ConnectWaypoints( 58 , 76 )
call ConnectWaypoints( 57 , 47 )
call ConnectWaypoints( 57 , 52 )
call ConnectWaypoints( 47 , 52 )
call ConnectWaypoints( 52 , 56 )
call ConnectWaypoints( 56 , 70 )
call ConnectWaypoints( 70 , 71 )
call ConnectWaypoints( 70 , 81 )
call ConnectWaypoints( 81 , 80 )
call ConnectWaypoints( 81 , 71 )
call ConnectWaypoints( 80 , 79 )
call ConnectWaypoints( 80 , 88 )
call ConnectWaypoints( 79 , 69 )
call ConnectWaypoints( 79 , 88 )
call ConnectWaypoints( 88 , 87 )
call ConnectWaypoints( 88 , 97 )
call ConnectWaypoints( 71 , 72 )
call ConnectWaypoints( 72 , 73 )
call ConnectWaypoints( 72 , 74 )
call ConnectWaypoints( 72 , 91 )
call ConnectWaypoints( 73 , 91 )
call ConnectWaypoints( 73 , 74 )
call ConnectWaypoints( 91 , 74 )
call ConnectWaypoints( 91 , 92 )
call ConnectWaypoints( 74 , 75 )
call ConnectWaypoints( 75 , 84 )
call ConnectWaypoints( 84 , 95 )
call ConnectWaypoints( 95 , 96 )
call ConnectWaypoints( 92 , 104 )
call ConnectWaypoints( 104 , 105 )
call ConnectWaypoints( 105 , 103 )
call ConnectWaypoints( 105 , 106 )
call ConnectWaypoints( 105 , 96 )
call ConnectWaypoints( 105 , 94 )
call ConnectWaypoints( 94 , 96 )
call ConnectWaypoints( 94 , 86 )
call ConnectWaypoints( 94 , 93 )
call ConnectWaypoints( 96 , 107 )
call ConnectWaypoints( 96 , 85 )
call ConnectWaypoints( 43 , 42 )
call ConnectWaypoints( 42 , 54 )
call ConnectWaypoints( 54 , 61 )
call ConnectWaypoints( 54 , 62 )
call ConnectWaypoints( 61 , 60 )
call ConnectWaypoints( 62 , 76 )
call ConnectWaypoints( 62 , 85 )
call ConnectWaypoints( 85 , 107 )
call ConnectWaypoints( 107 , 106 )
call ConnectWaypoints( 106 , 103 )
call ConnectWaypoints( 103 , 102 )
call ConnectWaypoints( 103 , 101 )
call ConnectWaypoints( 102 , 101 )
call ConnectWaypoints( 101 , 100 )
call ConnectWaypoints( 100 , 99 )
call ConnectWaypoints( 99 , 82 )
call ConnectWaypoints( 99 , 90 )
call ConnectWaypoints( 82 , 83 )
call ConnectWaypoints( 90 , 89 )
call ConnectWaypoints( 89 , 98 )
call ConnectWaypoints( 98 , 97 )
call ConnectWaypoints( 97 , 87 )
call ConnectWaypoints( 87 , 77 )
call ConnectWaypoints( 77 , 66 )
call ConnectWaypoints( 66 , 78 )
call ConnectWaypoints( 66 , 65 )
call ConnectWaypoints( 65 , 64 )
call ConnectWaypoints( 64 , 63 )
call ConnectWaypoints( 63 , 48 )
call ConnectWaypoints( 48 , 45 )
call ConnectWaypoints( 48 , 44 )
call ConnectWaypoints( 45 , 38 )
call ConnectWaypoints( 44 , 32 )
call ConnectWaypoints( 44 , 25 )
call ConnectWaypoints( 32 , 25 )
endfunction
//===========================================================================
function InitTrig_Init_Waypoints takes nothing returns nothing
set gg_trg_Init_Waypoints = CreateTrigger( )
call TriggerAddAction( gg_trg_Init_Waypoints, function InitWaypoints )
endfunction
I really like using this system, and I am hoping that it is something wrong with the way I am using it, because I'm not too fond of the idea of scrapping it and going back to using regions, or some other method of pathing the units.
Zak_