| 04-14-2006, 08:38 PM | #1 |
In my halo map, the game start correctly, all triggers are working. only problem, some people are lagging.. but, afther like 10-15 mins, problems start to occur: some triggers stop functionning, or funcion half of the time, and the longer the game last,more triggers are being screwed up. plus, this seems to cause alot of lag to some players. afther like 30 mins: shield regenerates only 1/4 of the time, sometime players dont respawn when killed, sometime reloading dont give you any ammos, sometime you can equip 2 weapons at the same time(in the same hand, giving you abilities of both), then, overheat totaly stop functionning,and, like if it wasn;t enough, lag make the game unplayable (not for me but for alot of players) the first 10 mins is perfect,all triggers are working, all functions are 100 % operative(but lag). ive heard leak cannot disable triggers. if its not leak, then what is it? id be glad if anyone could help me |
| 04-14-2006, 09:06 PM | #2 |
Leak shouldn't stop triggers from occuring, but if they are clogging your computer's resources so badly that its choking and sputtering, I would think it's possible for periodic events/checks/etc. to start getting missed... This is just speculation though :| |
| 04-14-2006, 09:28 PM | #3 | |
Quote:
exactly, triggers in wich i have the MOST problems are the triggers with Event: Every 0.0X Seconds of game time |
| 04-14-2006, 09:47 PM | #4 |
Periodic event triggers do not leak by themselves. The reason for this is not the trigger itself that is leaking, but the code that it runs leaks memory. So in periodic events, your code leaks again and again every 0.0X seconds, which adds up pretty quickly. Post your code, and people will be able to help you figure out where your memory leaks are occuring. |
| 04-14-2006, 10:01 PM | #5 |
[quote=Vuen]Periodic event triggers do not leak by themselves. The reason for this is not the trigger itself that is leaking, but the code that it runs leaks memory. So in periodic events, your code leaks again and again every 0.0X seconds, which adds up pretty quickly.QUOTE] main problem is not the LEAK, its the fact of having my triggers disable or only half-functionning. as for my code, i have absolutly no clue what's causing leak, and i have many 0.0x triggers. all of them use variables, and "call DestroyXXXX (udg_variable)" to avoid leak. |
| 04-14-2006, 10:16 PM | #6 | |
Quote:
That is...bad...very bad. I have none, in any of my maps (ok, in some cinematic maps). Sometimes I use 0.0x temp triggers for pushback type effects, but they use timers which are paused when not needed. |
| 04-14-2006, 11:32 PM | #7 | |
Quote:
Yes, and I'm telling you they become half-functional or disabled because they leak. When you leak too much memory, your computer starts churning away trying to sort it all, which takes a lot of CPU power. So it can't run your triggers every 0.0X seconds anymore because it just doesn't have enough power; they get ran when Warcraft gets the chance, which could take many seconds since you're leaking so much memory. It quite simply can't keep up, because it's too busy pageing leaked memory. Fix the leaks, and your triggers will keep working. |
| 04-14-2006, 11:52 PM | #8 |
Mine ARE needed. for all AMMO-MOVING triggers,flag detection and all shield-detection triggers. |
| 04-15-2006, 12:44 AM | #9 |
Yes...but you need to make sure all your leaks are cleaned up. That's what's causing your problems, as Vuen just explained.. |
| 04-15-2006, 12:55 AM | #10 |
it's not always leaks, I suggest if you find all leaks are cleared and this is driving you nuts, just try and find another way to do it, more than likely the second way will fix the problem, just dont make it similar. You don't always have to know what a problem is to fix it. The method is a bit crude but much better than waiting for one us to help you :P |
| 04-15-2006, 02:51 AM | #12 |
Actually, you still have several bad leaks in there: Trigger: Unit - Cause (Random unit from (Units within 75.00 of TempPoint3 matching ((Unit-type of (Matching unit)) Equal to Missile - Flames))) to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type FireYou're leaking a unit group there, with the "Units within ..." command. Unit groups are the worst kind of leaks; this is the kind that will make Warcraft crawl. You handled the other groups perfectly. Don't forget this one. Here's another leak: Trigger: Unit - Create 1 Trigger Caster for (Owner of (Random unit from (Units within 80.00 of TempPoint3 matching ((Unit-type of (Matching unit)) Equal to Missile - Flames)))) at (Position of (Picked unit)) facing Default building facing (270.0) degreesAnother bad unit group leak (Units within 80.00...), with a location leak (Position of...) to boot. The second trigger leaks a special effect. Special effects attached to units leak very little actual memory, but the meshes hang around, so as they add up they make your graphics card crawl. A good way to do this would be to attach the handle of the special effect to the unit with a gamecache, that way when you create a second special effect on the same unit you can destroy the first one. Fix those up, and check your other triggers for leaks again (mainly the "Units within range" function) and try it out again to see if your triggers still stop working after a while. |
| 04-15-2006, 09:36 AM | #13 |
Also, in the first trigger you set TempPoint3 inside the second loop, but don't destroy it within the loop. Also, it might be very useful to try and convince someone to convert those into JASS and make them more efficient, because you are doing a hell of a lot every 0.05 seconds in that one trigger alone. |
| 04-15-2006, 01:52 PM | #14 | |
Quote:
i have 7 triggers like that, some have a 0.02 delay too..(sniper) BUT! the trigger is turned ON everytimes a unit shoot, and OFF when the last unit of type "Missile - Flames" Die. so its ONLY used when required. |
| 04-15-2006, 02:22 PM | #15 |
what about now? Trigger: Flame Move
![]() Conditions
![]() Actions
![]() ![]() Set TempGroup = (Units of type Missile - Flames)
![]() ![]() Unit Group - Pick every unit in TempGroup and do (Actions)
![]() ![]() ![]() Loop - Actions
![]() ![]() ![]() ![]() Set TempPoint1 = (Position of (Picked unit))
![]() ![]() ![]() ![]() Set TempPoint2 = (TempPoint1 offset by (Random real number between 16.00 and 22.00) towards (Facing of (Picked unit)) degrees)
![]() ![]() ![]() ![]() Unit - Move (Picked unit) instantly to TempPoint2
![]() ![]() ![]() ![]() Set BulletOwner = (Owner of (Picked unit))
![]() ![]() ![]() ![]() Set TempGroup2 = (Units within 75.00 of TempPoint2 matching ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) and (False Equal to False))))
![]() ![]() ![]() ![]() Unit Group - Pick every unit in TempGroup2 and do (Actions)
![]() ![]() ![]() ![]() ![]() Loop - Actions
![]() ![]() ![]() ![]() ![]() ![]() Set TempPoint3 = (Position of (Picked unit))
![]() ![]() ![]() ![]() ![]() ![]() Set TempGroup5 = (Units within 75.00 of TempPoint3 matching ((Unit-type of (Matching unit)) Equal to Missile - Flames))
![]() ![]() ![]() ![]() ![]() ![]() Unit - Cause (Random unit from TempGroup5) to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Fire
![]() ![]() ![]() ![]() ![]() ![]() Trigger - Run Shield Get hit <gen> (checking conditions)
![]() ![]() ![]() ![]() ![]() ![]() Set TempPoint5 = (Position of (Picked unit))
![]() ![]() ![]() ![]() ![]() ![]() Unit - Create 1 Trigger Caster for (Owner of (Random unit from TempGroup5)) at TempPoint5 facing Default building facing (270.0) degrees
![]() ![]() ![]() ![]() ![]() ![]() Unit - Add Test2 to (Last created unit)
![]() ![]() ![]() ![]() ![]() ![]() Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Picked unit)
![]() ![]() ![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint3)
![]() ![]() ![]() ![]() ![]() ![]() Custom script: call DestroyGroup (udg_TempGroup5)
![]() ![]() ![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint5)
![]() ![]() ![]() ![]() Custom script: call DestroyGroup (udg_TempGroup2)
![]() ![]() ![]() ![]() Custom script: call DestroyGroup (udg_TempGroup5)
![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint1)
![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint2)
![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint3)
![]() ![]() ![]() ![]() Custom script: call RemoveLocation (udg_TempPoint5)
![]() ![]() Custom script: call DestroyGroup (udg_TempGroup) |
