HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Uncommon causes of lag

02-19-2003, 11:49 PM#1
Ari
I finally got to the point where I ran a multiplayer test on my map, and discovered to my dismay that several minutes in, the lag becomes so severe that both players either crash or *hard* crash and need to reboot. I'd love to figure out what's going on here. I'm thinking it's not going to be something obvious, though, because:

-the map's very small.
-there are only two players.
-the TempReplay file is only 42kb.
-while there are a number special effects used, they're properly destroyed (that is, removed from the game) when they're no longer needed.
-while there is a single trigger which updates the leaderboard every .3 seconds, this trigger is usually off.
-there are only a dozen units on the map, with no deaths or creations.
-there are no orders being given by triggers.
-there's no weather of fog, or anything fancy like that.

Keep in mind that no lag is present in single player, so I doubt very much it's a cpu issue. I'm thinking it's some sort of memory leak perhaps, though I can't understand why it would only happen in multiplayer.

Is there any other obvious culprit that I could be missing? This is a non-melee, turn based map, so it is very light on action (especially the kind of action that I associate with heavy lag) but rather heavy on triggers. Yet most of the time, only a single trigger is running at any one time - the program is very linear, with no recursion, or multiple function calls. I use a ton of local variables (integers and reals, mostly, with a few local special effect variables). Is there a known connection between those and memory or lag issues? Is there a connection between large numbers of events (though in truth, I don't have that many) and lag?

If anybody could provide some tips on some of the more ...exotic... causes of lag, or could pick one cause out from my suspects, I'd really appreciate it.
02-20-2003, 12:06 AM#2
ph33rb0
Maybe local variables aren't meant to be used in multiplayer. Have no idea, just a thought...
02-20-2003, 12:49 AM#3
dataangel
Local variables can be used in multiplayer.

Chances are you have a periodic event somewhere that isn't executing fast enough. For some reason this happens more in multiplayer. Make sure you avoid any waits, don't access array elements you haven't defined, and optimize.

It can also cause lag if a unit is constantly ordered onto boundary.
02-20-2003, 02:52 AM#4
Aiursrage2k
Negative indexs in arrays.
ConvertedPlayer() x > 16 || x < 1
Player() x > 11 || x < 0
call DisplayTextToForce( GetPlayersAll(), "\" ) this needs to have two slashes "\\".

A event timer that is constantly running trying to execute too much in too short a time period. An example, event time every 0.01 seconds create 1 footmen at center of playable map, kill unit. Only a few seconds the map will become lagged, if its every 0.1 seconds it will take longer but eventually begin to lag. A test could be disable your event timer, and see if it still lags after ten minutes. If that is the case try making the Event time to a higher time rate.
02-20-2003, 02:58 AM#5
dataangel
Put an abs function around your indices and see if it goes away, then you know that's the problem.