Bad memory leak or... ?

JuffoWup

New Member
Reaction score
6
I am working on massive Hero arena and There are few "periodic event" based abilities that check the game heroes with certain Buffs. Now the actual game starts when every player has picked hero, and when this happens there is short period where... I dunno game lags for a short moment. Should I be worried or what ?
 
Hmm ... Now that u mentioned, When the trigger that checks every second if Heroes ( variable that shows how many heroes are in map ) is equal to (amount of players in game) sets game on, it runs action that removes every hero tavern from map. Could this cause the "laggy" effect ?
 
i think you could change the event on this trigger to "unit - A unit sells a unit" that way it wouldn't have to run every second. just keep the condition the same (the one that checks if there are enough heros). as far as the lag goes, i wouldn't worry about it. most maps that involve picking heros and then removing units hesitate a little bit while the trigger is being run. if it only happens once, it shouldn't be a big deal.
 
It happens only once, but now that were on the subject: How bad mem. leaks "periodic event" causes ? I think I read some other thread that it shouldn't be used often as it can generate sh*tload of trouble. Is this true ?
 
you shoudl only run a few triggers at once, like maybe 15 or so tops I'd say

periodic events adds to that, try and make em so they dont run at the same time

such as make one run ever 1 sec, another run every 1.1sec, etc.

thsi will make sure they only ovelap and run at the same time every so often, whic h it hink should reduce any lag created, but since periodic events dont leak, there is no memory lost, the only prob would be with ppl with slow comps who cant handle a bunch of triggers firing all at once

and 1 second of lag once at beggining isnta big deal I dont think, as long as its only once
 
Thnx alot ! That was a loadoff... My few most beloved custom hero abilities rest on "periodic event"
 
I've seen a couple

Every 0.01 seconds:
Pick every unit in (entire map)
- IF ((Picked unit) has <buff>) equal to true THEN


That's the kind of stuff you shouldn't do.

Other than that... well.
I know of at least one pretty big map that uses several "a unit is attacked" with no problems at all.
 
JuffoWup said:
Thnx alot ! That was a loadoff... My few most beloved custom hero abilities rest on "periodic event"

FYI yu don.t have to have these running always, like if an abiltiy lasts 10 seconds, turn on the periodic trigger at the beginnig of the time and turn it off at the end, you dont need to have it always running, and since the abiltiy wont be running always, there should be no problem
 
Well I got example like this:

One of my abilities drains Hp and when u turn it on it moves the casting unit
into certain unit group. There is periodic event that reduces Hp every second for units in this unit group. Does this cause trouble or am I fine ?
 
have a trigger that when teh ability is on, add unit to unit group and start periodic trigger, when effect stop, turn periodic trigger off and remove unit from unit group ( ofcourse is this can be used by more then 1 unit, then you will jsut have to suffer with the trigger on always, if that is the case, make sure it only runs tops at like every .25 or .5 secs)
now as long as you use what is shown in the Memory Leak guides to pick your unit in the unit group and remove them,there should be no memory leak or lag
 
Moving the casting unit, picking units from a group, spawning units at un-specified locations (Random/center points of regions) can cause memory leaks. Just yesterday me and Mr Hulk submitted 2 new tutorials for Memory Leaks (Hulks Tutorial).

Post a few sample triggers that you think might be causing them. In code tags, of course... Not to many that it takes up the entire page though :eek:
 
This is the trigger that causes dmg to my Pipsquek hero when he has unholy armor activated

Code:
Unholy Armor damage
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in UnholyArmor and do (Actions)
            Loop - Actions
                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - (2.00 + (0.25 x (Real((Level of (Picked unit)))))))
 
My memory leak tutorial said:
Groups: These are fairly easy to remove, so long as they do not use waits as well. It was suggested to only use waits in integer loops by a few people higher than me.

Leak:

Code:
Unit Group - Pick every unit in (Units owned by (Player 1)) and do (Unit - Kill (Picked unit))


Fix:

Code:
Unit Group - Pick every unit in (Units owned by (Player 1)) and do (Unit - Kill (Picked unit)) 
Custom Script: call DestroyGroup(GetLastCreatedGroup())

http://www.thehelper.net/forums/showthread.php?t=27242
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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