| 08-14-2003, 06:46 PM | #1 |
Hello, I have a map that had been suffering from extreme lag after about 45 mins of play. I could not find the source, but I suspected some special effects -- there were 3 units with special effects attached to them for the whole game. I disabled the triggers which created the effects and the lag seems to be gone. My question then is, do special effects always cause lag, and must they be removed (destroyed) rather than left permanently. I really wanted to keep those units with the effects on them, but if that isn't possible...oh well. What do you guys think? |
| 08-14-2003, 08:09 PM | #2 |
Yes, special effects are kept in memory until they are destroyed and exzessive use of them they causes lag. But I don´t think, that you have to remove the special effects from your units. Are the effects created once or repeatedly ? |
| 08-14-2003, 08:13 PM | #3 |
They are created once, and are attached to the model. For instance, one unit (a hero) has a flame attached to his weapon. It goes on at his creation and stays the whole game. After disabling this effect (and two similar ones) the map performance seemed to improve...could I be mistaken though? |
| 08-14-2003, 08:56 PM | #4 |
hmm...I couldn´t think of any reason why that should decrease performance, but then: I´m no expert on such things. Let´s try some theory. In my map I used special effects to visualize the AoE for certain attacks, e.g. full-auto fire from a chaingun. These effects were fired multiple times per second. After testing the impact on game performance with 2 heroes firing continously for 10 minutes I learned 2 things. 1. special effects that are not destroyed after use seem to stack in memory, even if they are identical. 2. when I left the test-area with all units performance went back almost to normal again. Going back to the test area without firing still caused lag again. So, special effects seem to be linked to the area, where they were created and do not only stack in memory but seem to have an active or inactive status. Now, thinking of a special effect on your heroes weapon I could imagine that the fire effect (cinematic doodad ?) is practically created and stored for every point on the map that your hero ever visits. (Sorry for my english in case that is not understandable. Just ask, if it´s unclear) So you MIGHT be better off with repeatedly creating the special effect and destroying it by use of a variable. Trigger would be something like E: Periodic Event (every 0.0whatever seconds) C: none, I could imagine A: - Destroy <SpecialEffectVariable> - Create <SpecialEffect> on Heroes weapon - Set <SpecialEffectVariable> = Last created Special Effect As I said, I don´t know if that helps your problem, but it´s the only advice I´m able to give. Gozai |
| 08-14-2003, 11:18 PM | #5 |
Thanks for all the info, and for running your test! I think repeatedly creating with a trigger might cause lag too because of the trigger(s) running over and over, I don't know. Maybe I'll just do without the effects...I've been chasing this performance problem for a week and I'm just glad I finally got it to go away. |
| 08-15-2003, 08:26 AM | #6 |
Just try it. but instead of my example trigger above use a timer for that. As far as I know periodic event are more memory intensive than timer. Something like E: EffectTimer1 expires C: --- A: - Destroy <SpecialEffectVariable> - Create <SpecialEffect> on Heroes weapon - Set <SpecialEffectVariable> = Last created Special Effect - Start EffectTimer1 If for any reason you would like to stop that cycle, use a Boolean false/true variable check under Conditions or simple Turn trigger on/off. Boolean is to be preferred when you have to stop several triggers at once. Gozai |
| 08-15-2003, 01:55 PM | #7 |
I suppose I can run a test or two with this in place and see what happens. I willl report back in a bit 8) |
| 08-16-2003, 05:03 PM | #8 |
Delete all the triggers (dont forget to make a backup) and test run it. If it doesnt lag, you can rule out anything terrain wise. Then delete half of the triggers (bottom half). If it still lags, its the top half. Delete half of the top half (botton half) and if it still lags, its the top half of the top half. Then keep doing this until you run into your problem. |
| 08-16-2003, 05:24 PM | #9 |
And if it is something terrain wise...what sorts of things could it be? I think I had a few trigger issues...I've cleared some of them up, but I still suspect something additional. The triggers are pretty sparse now, I've thinned them and trimmed them and performance has improved. |
