HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Taking on the Lagg Beast

06-30-2003, 12:25 PM#1
Hivemind
Lagg is the bane of almost every online game. WC III is no different. We are going to talk a little bit about the causes of lag and what you as a mapmaker can do about it.

There are many sources of lagg and several types of lagg. We have not done any studies specificly into the causes but have read several that others have done. Our experiance with dealing with it is the real world kind. Making a map not lag. Here are some of the things we know about it....

Connection lagg-

This is caused by a poor connectection between players. Often caused by 56k users but not always. This can also be caused by other types of lagg. If one computer in the game laggs bad enough it will lose connection with the others. Even if it has a good internet connection. Another source of this would be dsync problems.

Solutions-

If you lagg-
Turn you graphic settings down. Some custom maps have much more going on than WC was designed to handle efficiantly so even higher end system sometimes have a problem.

Turn down partical effects. This is big for TD's and any map that has lots of shooting and special effects. Will also help with memory useage.

Turn off 3d positional sound and music. Havent tried this yet but it is suggested by blizzard in the manual.

Turn off shadows and other graphic things you dont realy need to play.

Get DSL/Cable :D


For your maps-
Try to avoid chat messages and cinematics that only effect one player. We havent had a problem with chat messages from triggers but have noticed ppl losing sync when someone enters a chat message. When possable dont use chat commands.

At the start of the game have a delay that gives players time to sync up. 10 seconds should work. Also setting your init trigger to start at 0 time elapsed instead of game start will help.

Any and all of the suggestions for reducing lag under the other sections.



Graphic Lagg-

This is cause simply by too much going on at once on someones screen. Rendering too many units, too many units shooting and or too many special effects.

Solutions-

Keep the number of things that can be seen on the screen at once down to a resionable amount. Use the origonal game as a frame of referance. If there is more going than in a normal WC III game than its prob too much.

Custom cameras can help with gameplay (standard camera is too close for most custom maps) but dont take it back too far. Depends on how much activity you have in one area as to what distance your camera should be set at.

Use fog of war. Not always possable or desired but it will help reduce the onscreen action.

Keep the number of doodads down. Especialy ones that have animation. Flies and birds can hardly be seen ingame and are not worth the lagg they add. Fisures, fires and other animated doodads can be used but just be careful about how many.

Explode or remove units if corpses are not needed.

Dont use a lot of realy large models. If you want something to look big make everything elce smaller.

Keep the number of ranged attacks as low as possable. This is hard in things like TD's and some other map types so you will have to make up for it by compinsating in other areas.

Lots of special effects look realy cool. They also make maps unplayable. Be artistic. Use them as spice, not the main dish. This goes for some ranged attack types too. Flaming metiors are cool but too many things like that will be a problem.

Dont have too many mobs (mobiles ie: moving units) in one place at one time. When possable keep the the total number of units down. When not possable try to keep them from being all in one place. Hard to do in a TD but other things can be done. Longer spawn times and starting a spawn only when all units are clear.

If you make custom models keep the poly count low. Cource if your making models you prob know more about graphic issues than we do.
;)


Trigger Lagg-

Caused by too many triggers active at once or poorly designed triggers. Many ppl say the total number of triggers will effect this. We will belive that when we see it. We use tons of triggers in our maps and we dont have this problem. We do pay attention to how our triggers are oporating and keep them from bogging things down too much.

Solutions-

Dont use too many triggers that fire on short timers. If you think your leaderboard needs to be updated every .5 sec then maybe you should rethink your whole map setup. In most cases these kinds of triggers can be conditional or a combination of timed/conditional.

Try to keep too many situational triggers from fireing at once. This a map design thing and will be different for each map. Keep it in mind when coming up with your game structure and you wont have to reverse engenier latter.

Learn how to make triggers turn off when you dont need them. You can use the on off function to chain your triggers and keep them form activating when you realy dont need them. You can also use this to troubleshoot. Turn off suspected bad triggers untill you find the one causing the problem.

Use very specific conditions. If you find yourself having to make additional triggers to stop prevoius triggers from doing unwanted things take a close look at your conditions first. Thats what they are for.

Find ways to combine triggers. You can have as many events in one trigger as you want. It will fire when any of them happen. For your trigger actions dont just use the first event response you find that works. Try to find ones that allow other triggers functions to be combined. When ever you are specifying a player make sure you cant use something like (Owner of(Entering unit)) instead. We see too many ppl making a trigger for each player and specifying that player in each action.

Learn about for-loops and arrays. Use them, they wont bite. They are your friend. In TFT if/then/elce (multiple) will be your friend too. Not only will these things make your map work better but will take a lot less effort to make. Not to mention most otherwise hard trigger problems can be solved easily with them.



Memory Lagg-

This is the big one in most cases. It is also the one map makers can do the most about while still having high action, complex or impressive looking maps. In most cases you will have to sacrafice the least to keep this kind of lagg under control. If you dont, however, it will make the map more unplayable than any other type of lagg. We wont put solutions for this one. We will put causes and you will need to find your own solutions since it will depend a lot on your map setup.

Causes-

Total number of units used by your map. Removal, exploding or letting units decay will not change the fact that every unit created adds to the memory useage of the game.

Creating too many units at once. Any time a unit is created it causes a pause in the game. The more units the longer the pause. We have found ways to reduce this effect but not to remove it.

Sit and spin triggers. Poorly designed triggers that are always doing something. In most cases they are not useful anyway.

Lots of units dying at once.

Picking large numbers of units at once or continuosly.

Unit orders from triggers. This is the #1 souce of lagg in most maps. Every single order you give during a game will add to the total memory used. This adds up as the game progresses.

High damge/health units. WC III has a problem dealing with this.

If your map takes a long time to return to the menue/battle net screen when done you most likely have a memory problem.


Hope this has been hepful. Anyone who has addition info on this subject feel free to add to it. If enough of us go after it we might just kill the beast.
:guns:
06-30-2003, 12:36 PM#2
piRo-piOn
avoid overlapping too many doodads at once... a 'cavern' made out of overlapping rock gates is a VERY bad idea.
06-30-2003, 12:42 PM#3
Vexorian
By Hivermind

Copy (Don't move) this to tutorial section, so this won't disappear with the time.
06-30-2003, 07:47 PM#4
Hivemind
Can someone who ahem, works at EB and took a TFT copy home for "evaluation purpouses", check if the unit health and damage thing still causes problems? And any other issues you can test in a min or two.

It would be nice if Bliz fixed some of these issues. Since they only effect custom maps and not the main game we dont expect them to do much. We might all get lucky and they decided to make more efficient use of memory tho.
06-30-2003, 09:52 PM#5
Raptor--
Quote:
Dont use too many triggers that fire on short timers. If you think your leaderboard needs to be updated every .5 sec then maybe you should rethink your whole map setup. In most cases these kinds of triggers can be conditional or a combination of timed/conditional.

this might be kinda difficult to avoid if u want to use accurate, responsive keyboard controls (TFT)... unless someone can think of a better way to do keyboard-based unit movement, u'd have to run a movement trigger very quickly to achieve accurate, non-stupid movement
07-02-2003, 05:06 AM#6
Hivemind
TFT We has functions for movement by arrow keys.
07-02-2003, 05:30 AM#7
Raptor--
i know, that IS what i'm talking about

basically it registers press/release, and the only way i've learned to do movement based on that (from my gr11 comp science project, megaman) is to be constantly firing something that registers if the button is still being held down

now the reason i posted that in here, is because by doing it that way in war3, i need to essentially be running a relatively complicated trigger every 0.1 seconds, which, could result in lag

so i was wondering/saying if there is a better way to do keyboard controls (accurate and responsive are key though) without constantly firing of a trigger
07-02-2003, 05:36 AM#8
Hivemind
Then make 2 triggers. First one starts movement on press. The other stops movement on release. As long as press/release is a event (cant think of why it wouldnt be) there should be no need for any kind of periotic.
07-02-2003, 06:38 AM#9
Raptor--
because it has to constantly say 'move to location X with offset Y'... where Y has to be a rather short distance or the AI gets dumb and tries to run around stuff... unless theres a magic way/trigger to make the unit walk in a specific direction forever...

because sure u can say 'event left is pressed' order unit to move 1024 to the left of itself, but if theres no periodic what happens when it reaches it destination?

Edited because:
meh, i don't think ican do it any other way anyhow, it has to constantly check what ur running into to see if u can walk over a unit or not
.