| 09-20-2004, 05:18 PM | #1 |
I have some questions about lag in an AoS-type map, particularly how to reduce load time. 1. Many of the abilities are scripted with the event "A Unit Starts the Effect of an Ability" and the condition checking if the ability is the one for that trigger. All of these triggers are active at all times. Would it make any real difference to destroy the triggers that don't correspond to any of the heros the players pick, or to perhaps only create the triggers for a hero's abilities when the hero is selected at the start? 2. Do custom models/sounds/units/abilities contribute much to load time, or is it mostly just the script file? 3. Are periodic events generally inefficient? 4. There is currently almost no local variable or game cache use, even for temporary variables. Would removing as many global variables as possible help with the load time? 5. When the GUI triggers are converted to pure JASS, it seems to do some pretty stupid things, such as creating an entirely new function that returns a boolean for the condition of an if/then. Is it worth correcting things like this, or is using GUI reasonably efficient as long as you didn't have to do weird workarounds? 6. Any general tips on reducing load time would be great. Any help would be greatly appreciated. I did search the forums for a lot of this, but as I'm fairly new to JASS and optimizations in general it was kinda overwhelming, and there seemed to be conflicting answers. |
| 09-21-2004, 04:31 AM | #2 |
1 - Destroying a trigger does not decreases the loading time, it just decrease the lag on the game( not too much), if you have too much spells, then you could destroy some to decrease it. 2 - I don't know, but I guess that the things that makes it more slower are the terrain, descructibles and pre-placed unit, the script is the last thing that is load, see where did is taking too much time. 3 - That depends on what they are firing, what the trigger does, but be carefull, puting too much action in a "every 0.10 seconds" trigger could cause the game to lag. 4 - I don't have any idea. 5 - That stupid things are done in every condition, the GUI loop is also stupid, it uses 2 variables and call for a new function, you could change that if you want, but it should not affect it too much. 6 - Make some tests, remove some doodads or units, disable some triggers, the map size also increases the loading time. |
| 09-21-2004, 07:50 AM | #3 |
The only thing not really mentioned that comes to mind is having alot of preplaced units can increase loading time by alot, instead just place most of them with triggers. |
