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 ?
 

JuffoWup

New Member
Reaction score
6
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 ?
 
S

spazard1

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

JuffoWup

New Member
Reaction score
6
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 ?
 

emjlr3

Change can be a good thing
Reaction score
395
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
 

JuffoWup

New Member
Reaction score
6
Thnx alot ! That was a loadoff... My few most beloved custom hero abilities rest on "periodic event"
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
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.
 

emjlr3

Change can be a good thing
Reaction score
395
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
 

JuffoWup

New Member
Reaction score
6
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 ?
 

emjlr3

Change can be a good thing
Reaction score
395
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
 

Rad

...
Reaction score
228
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:
 

JuffoWup

New Member
Reaction score
6
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)))))))
 

Rad

...
Reaction score
228
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.
  • 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