The Unfindable Leak vs Safeness

newtonrox

Member
Reaction score
2
Well, my map leaks... (godamnit!)and it's impossible to figure out why (been months searching it).

When I test my map I push it very hard when compared to the actual game I intend ppl to play.

My map is a footman frenzy-like with 12 player and lots of units...
So I make sure that there is always at least 700 alive units in the map when testing it.
And so, I run the leaky trigger that handles with all units in the map 10x faster than in the normal gameplay.
I'd say that in one hour the trigger runs 240 times, and deals with units 168.000 times.

After 4 hours of game running, the game crashes because of the "not enough memory" problem...

By the way, at normal game speed, the leaky trigger would run 24 times...

The questions are:
So, can I conclude that it will be safe for ppl playing it without wasting effort of some hours of gameplay?
If this just happens after 4 hours of intensive trigger processing, do you think it's possible that is just a normal leak that's within "Warcraft 3" itself and not my programming?


thx for reply...
 

tooltiperror

Super Moderator
Reaction score
231
Why don't you make a leak checking trigger and just use that to see? (1)
 

tooltiperror

Super Moderator
Reaction score
231
Well, how do you even know that you're leaking, other than the fact that you're lagging? How do you know this isn't just your computer? Could you post the leaking trigger?
 

newtonrox

Member
Reaction score
2
JASS:
/=======================  Filtro do GroupEnumUnitsInRect()==================//
// Adds the FilterUnit to group udg_ALLMAP or to group udg_ALLMAP2 or to no group, depending on the conditions below:

function Filter_Chuva_On takes nothing returns boolean
local unit F = GetFilterUnit()


if( GetUnitState(F, UNIT_STATE_LIFE) > 0 ) then


   if  ( GetUnitAbilityLevelSwapped('A01W',F ) > 0)  then
   set F = null
   return true
   else
       if ( GetUnitAbilityLevelSwapped('A01X',F ) > 0) then
          call GroupAddUnit(udg_ALLMAP2, F)
          set F = null
          return false
       endif
   endif

endif

set F = null
return false

endfunction
//===========================================================================//




//==================== Adiciona ChuvaTodos =======================================//
function Trig_Chuva_On_T takes nothing returns nothing

     call UnitAddAbility(GetEnumUnit(), 'A003')

endfunction
//===========================================================================//




//==================== Adiciona ChuvaNaga =======================================//
function Trig_Chuva_On_N takes nothing returns nothing

     call UnitAddAbility(GetEnumUnit(), 'A002')

endfunction
//===========================================================================//



function Trig_Chuva_On_Copy_Actions takes nothing returns nothing

      call GroupEnumUnitsInRect(udg_ALLMAP,udg_PlayableArea,Filter(function Filter_Chuva_On) )
         
      call ForGroup(udg_ALLMAP, function Trig_Chuva_On_T )
      call ForGroup(udg_ALLMAP2, function Trig_Chuva_On_N )


      call GroupClear(udg_ALLMAP)
      call GroupClear(udg_ALLMAP2)

endfunction



//===========================================================================
function InitTrig_Chuva_On_Copy takes nothing returns nothing
    set gg_trg_Chuva_On_Copy = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Chuva_On_Copy, function Trig_Chuva_On_Copy_Actions )
endfunction


and

JASS:
//=======================  Filtro do GroupEnumUnitsInRect()==================//
function Chuva_off_Filter takes nothing returns boolean
local unit F = GetFilterUnit()


if( GetUnitState(F, UNIT_STATE_LIFE) > 0 ) then


   if  ( GetUnitAbilityLevelSwapped('A003',F ) > 0)  then
   set F = null
   return true
   else
       if ( GetUnitAbilityLevelSwapped('A002',F ) > 0) then
          call GroupAddUnit(udg_ALLMAP2, F)
          set F = null
          return false
       endif
   endif
endif

set F = null
return false

endfunction
//===========================================================================//





//==================== Remove ChuvaTodos =======================================//
function Chuva_off_T takes nothing returns nothing

         call UnitRemoveAbility( GetEnumUnit(),'A003')

endfunction
//===========================================================================//



//==================== Remove ChuvaNaga =======================================//
function Chuva_off_N takes nothing returns nothing

    call UnitRemoveAbility( GetEnumUnit(),'A002')

endfunction
//===========================================================================//






function Trig_Chuva_off_Actions takes nothing returns nothing

    call GroupEnumUnitsInRect(udg_ALLMAP,udg_PlayableArea, Filter(function Chuva_off_Filter) )            

    call ForGroup(udg_ALLMAP, function Chuva_off_T )
    call ForGroup(udg_ALLMAP2, function Chuva_off_N)

    call GroupClear(udg_ALLMAP)
    call GroupClear(udg_ALLMAP2)

endfunction

//===========================================================================
function InitTrig_Chuva_off takes nothing returns nothing
    set gg_trg_Chuva_off = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Chuva_off, function Trig_Chuva_off_Actions )
endfunction



What I figure out so far is that those triggers leak when all the 700 units are killing themselves and spawning.
There must be death for it to leak.
When I run the map with the units but I let them be at their base (that means no fighting,no death,no spawning), I can run the map indefinetely (I tested it for 12 hours and them I quit the game myself)...
 

tooltiperror

Super Moderator
Reaction score
231
[LJASS]ForGroup[/LJASS] leaks, just filter the units and do your actions in there.
 

tooltiperror

Super Moderator
Reaction score
231

newtonrox

Member
Reaction score
2
JASS:
//=======================  Filtro do GroupEnumUnitsInRect()==================//
// Adds the FilterUnit to group udg_ALLMAP or to group udg_ALLMAP2 or to no group, depending on the conditions below:

function Filter_Chuva_On takes nothing returns boolean
local unit F = GetFilterUnit()


if( GetUnitState(F, UNIT_STATE_LIFE) > 0 ) then


   if  ( GetUnitAbilityLevelSwapped('A01W',F ) > 0)  then



       call UnitAddAbility(F, 'A003')





   else
       if ( GetUnitAbilityLevelSwapped('A01X',F ) > 0) then
 

             call UnitAddAbility(F, 'A002')



       endif
   endif

endif

set F = null
return false

endfunction
//===========================================================================//




//==================== Adiciona ChuvaTodos =======================================//
function Trig_Chuva_On_T takes nothing returns nothing

     call UnitAddAbility(GetEnumUnit(), 'A003')

endfunction
//===========================================================================//




//==================== Adiciona ChuvaNaga =======================================//
function Trig_Chuva_On_N takes nothing returns nothing

     call UnitAddAbility(GetEnumUnit(), 'A002')

endfunction
//===========================================================================//



function Trig_Chuva_On_Copy_Actions takes nothing returns nothing

      call GroupEnumUnitsInRect(udg_ALLMAP,udg_PlayableArea,Filter(function Filter_Chuva_On) )

endfunction



//===========================================================================
function InitTrig_Chuva_On_2 takes nothing returns nothing
    set gg_trg_Chuva_On_2 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Chuva_On_2, function Trig_Chuva_On_Copy_Actions )
endfunction



JASS:
//=======================  Filtro do GroupEnumUnitsInRect()==================//
function Chuva_off_Filter takes nothing returns boolean
local unit F = GetFilterUnit()


if( GetUnitState(F, UNIT_STATE_LIFE) > 0 ) then


   if  ( GetUnitAbilityLevelSwapped('A003',F ) > 0)  then
        
       call UnitRemoveAbility( F,'A003')

   else
       if ( GetUnitAbilityLevelSwapped('A002',F ) > 0) then
         

          call UnitRemoveAbility( F,'A002')

       endif
   endif
endif

set F = null
return false

endfunction
//===========================================================================//




function Trig_Chuva_off_Actions takes nothing returns nothing

    call GroupEnumUnitsInRect(udg_ALLMAP,udg_PlayableArea, Filter(function Chuva_off_Filter) )            

endfunction

//===========================================================================
function InitTrig_Chuva_off_Copy takes nothing returns nothing
    set gg_trg_Chuva_off_Copy = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Chuva_off_Copy, function Trig_Chuva_off_Actions )
endfunction


I modified the triggers according to Jesus4life and Exid (group less enumerating).
after some hours this is what I got:



its written "not enough memory to process this command"
 

tooltiperror

Super Moderator
Reaction score
231
You are probably leaking somewhere else, then.
 

newtonrox

Member
Reaction score
2
that's what i thought but if I turn off those 2 triggers the game will never crash...
that's why I say it's unfindable T_T
 

tooltiperror

Super Moderator
Reaction score
231
Well you're leaking somewhere, you just need to find it. Review every trigger, or ask a JASS Master to read your code and look themselves.
 

newtonrox

Member
Reaction score
2
Ok guys thx for motivating lol XD

As I said before the error just happens when the units kill themselves, so it be could something related to spawning right?

here's my spawn trigger:

JASS:
function Trig_SpawnUnits_Actions takes nothing returns nothing
local integer OwnerN = udg_TierOwner
local unit U = udg_Farm[OwnerN]
local location A  = GetUnitLoc(U)
local location L = GetUnitRallyPoint(U) 


       set udg_TierOwner = 0





 


if ( GetPlayerState(udg_Players[OwnerN], PLAYER_STATE_RESOURCE_FOOD_USED) < 70   ) then

       call CreateNUnitsAtLocFacingLocBJ( 1, udg_TierUnit[OwnerN], udg_Players[OwnerN], A, A )
       set udg_Spawned_Unit = GetLastCreatedUnit()



       call IssuePointOrderLocBJ( udg_Spawned_Unit, "move", L )


endif






call RemoveLocation (A)
call RemoveLocation(L)
set L = null
set U = null
set A = null
endfunction

//===========================================================================
function InitTrig_SpawnUnits takes nothing returns nothing
    set gg_trg_SpawnUnits = CreateTrigger(  )
    call TriggerAddAction( gg_trg_SpawnUnits, function Trig_SpawnUnits_Actions )
endfunction
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
tsk tsk, too many BJs.
Too many inefficiencies.

And a little too much white space ._.
Isn't there a way to get a RallyPoint's X-Y instead of a loc?
JASS:
set u = CreateUnit(/*Stuff*/)
call IssuePointOrder(u, "move", GetLocX(), GetLocY())
 

tooltiperror

Super Moderator
Reaction score
231


I'm pretty sure that line leaks. Also,

JASS:
//!  newtonrox
       call CreateNUnitsAtLocFacingLocBJ( 1, udg_TierUnit[OwnerN], udg_Players[OwnerN], A, A )
       set udg_Spawned_Unit = GetLastCreatedUnit()


--->

JASS:
//!  tooltiperror
       set udg_Spawned_Unit=CreateUnitAtLoc(udg_Players[OwnerN],udg_TierUnit[OwnerN],Location(GetLocX(A),GetLocY(A)),0.00)


While I'm at it,

JASS:
//!  tooltiperror
       call IssuePointOrder(CreateUnit(/*Stuff*/), "move", GetLocX(), GetLocY())


edit: Inlining for dummies, anyone?

editedit: You should also follow conventions.
localVariables
CONSTANTS
FunctionNames
GlobalVariables
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top