| 02-18-2004, 11:12 PM | #1 |
Hi. I started writing a footwars map last night and I have all the basics working, as well as a simple AI player to test against. I played the map online and it seemed to work well and there was no initial startup lag as there are on other footie maps. One of the reasons for this is that I have been thinking very carefully about lag when writing my triggers, which is difficult since there seems to be no real information on what needs to be sent across the wires when a trigger is fired, as opposed what can be done without creating network traffic. One thing I was interested in adding is some custom trigger spells - I was thinking an area of effect polymorph or something would be a good place to start. But I was wondering if trigger spells cause a lot of lag. It seems like they might, since the trigger often hooks the "Unit issued an order targetting a unit" event, which happens rather frequently. 12 player footwars maps are often already laggy enough given that they have hundreds of units onscreen and people with 56k modems still insist on playing, so I don't want to exacerbate the problem by adding a bunch of laggy triggers to the map. Anyone want to share their experiences with this issue? It would explain why trigger spells are uncommon in custom games on BNet. |
| 02-18-2004, 11:52 PM | #2 |
It really depends on the trigger, processing speed, and Internet connection. A really complex trigger would usually be more likely to lag then a small trigger. Dial-up experiences more lag then DSL, whether it has trigger spells or not. Also, if it creates a lot of special effects or does a lot of action very quickly, some computers do not have adequate memory to process them fast enough. For example, if you have a spell that creates 20 Doomgaurds, has them each cast a spell, create a load of special effects, and do it in 5 seconds on dial-up, it will likely lag like crazy, as the connection can only transmit so much data at a time, while a T-3 wouldn't receive as much lag. Hope this helps! P.S. You should use the trigger: Event: Unit begins casting an ability Condition: Ability being cast equal to <Desired ability> Actions: <Spell triggers here> |
| 02-19-2004, 12:12 AM | #3 |
Whether you go with an ability comparison or an order comparison to detect the use of the ability doesn't matter a great deal. As far as my reason dictates, anytime something happens in WC3, it needs to be checked to see if there's a trigger with a corresponding event -- then check the conditions to see if any action should be taken. So, if that's true, then having custom triggers won't lag in that regard -- the lag comes from the execution of the actions, and that's dependant upon how much is going on and how well it's coded. If anyone (somehow) knows for sure how the WC3 engine runs, then please correct me. But like I said, that'd be my best guess. |
| 02-21-2004, 09:01 AM | #4 |
That are my thoughts on the subject (thoughts, not knowledge) as well. I also try to put conditions in such an order that the ones that make the trigger not-run in most cases are first on the list, so that other conditions don't need to run afterwards unless the first, most selective condition says it's ok. Don't know if it really matters in any way, especialy because i'm just begining with trigger editing and don't know any optimisation tricks that would probably help a lot more than just caring about the sequence of conditions, but I do it anyway. :Heh: I'm making a map now with more trigger-spells at the moment, but I'm not occupied with the lag issue as it is a hero arena map and there are not 100+ units around at once. :) I guess that optimizing the unit/doodad count is much more important than trigger optimisation, and if the point of your map are massive battles and you can't get around that, then it is obviously meant for high end machines/connections and a few triggers won't make much of a difference. |
| 02-21-2004, 10:26 AM | #5 |
My suggestion is destroy everything extra, especially special effects. One reason why some trigger spells lag so much is because special effects just sit there being unused, but still there, same with dummy caster units (remove the dummy caster, don't just give it a trimer). |
