| 06-11-2004, 06:15 PM | #1 |
I have been making allot of trigger based spell for an AOS type map i'm working on. Now the thing is almost every hero spell is a trigger and that means the trigger is running constantly. I have read the memory leak FAQs and have done the following: - Destroy unit groups when finished with them - Destroy points when finished with them - Destroy special effects - Destroy one time use triggers Also about half of the spells involve creating a temporary unit then having them cast the spell and for this i made sure they are killed and then removed. When i test the map online the trigger run time is still really bad. Along with the spells i also have a random weather system but i remove all of the environment effect when they finish. Am i doing something wrong or is my map doomed to run slow because of the 45 or so trigger based spells :\ (excluding the really small ones that just use a special effect) I made all of the triggers with WEU and used all the remove and destroy commands with that program. Also i really suck with JASS so there is none of that in the map. One last thing, one of my spells creates ALOT of units in a large circular motion and then explodes them the moment they are made to deal damage. Would i have to remove the units after they explode to save some memory? |
| 06-11-2004, 08:01 PM | #2 |
In a word, yes. As far as I know, you need to delete units as well as everything else so they don't leak at the end. I dont know much about JASS/memory leaks, but try deleting the units and see if it speeds up. |
| 06-11-2004, 08:14 PM | #3 |
well, the triggers don't cause lag at all.. they take the least loading time when loading the game anyway. just what you do in the triggers that counts. my advice, have as least of those "every .2 seconds" triggers as possible, if you have any, or at least do it in a function create unit groups into a variable and destroy it in that variable after you done just know that terrain matters and the map will lag if you have 3k + of doodads if some peopls comps aren't all great the amount of units will also obviously lag the game I don't know how much is true, can somebody varify? If you make a lot of custom units/abilities/items.. will it take longer to load or will it lag inside the game? |
| 06-11-2004, 09:41 PM | #4 |
There are some specific stuff that cause lag without dealing with triggers, like a lot of units, will cause model lag, and units with really low scale value do cause lag, also heavy models as projectiles and the such |
| 06-12-2004, 02:27 PM | #5 |
Yup, you gotta make sure that you aren't confusing together Graphical Lag and Memory Leak lag, cuz memory leak lag doesn't happen untill you leak a whole astronominous sum of memory, and you aren't doing that if you cleaned up your worst sources. There is then also lag related to heavy triggers, but I doubt you're getting that. Try running your map in SinglePlayer/whatever, and as the map starts, alt-tab out and check the task-manager to see your memory status is, write it down even. Then play your map for like... 3 hours, or however long your map is played at most. Then alt-tab out again and check the task manager. If it jumped up really high compared to your computer's Memory Size (that is, with 256 mb ram, it normally didn't go higher than 50 megs untill it began loading it onto the hard drive, but now on 512 megs, it can go higher by a few hundreds megs before it starts loading to the hard drive). Just don't freak out too much at your leaked ammount, I mean, even 10-30 megs leaked is often quite fine (doesn't affect game play that seriously). It's only if you filled your memory, and start to lag in-game (or have really long exiting times) that you know you're leaking a bit too much. ~Cubasis |
