HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Anyone got any tips on making my map less laggy?

03-01-2004, 02:44 AM#1
Locoh8u
Hi, I'm worried about adding too many laggy causing things to my map, can anyone tell em what i should avoid doing that may cause lag? It's a map designed for b.net & i don't want it to be completly bare, but i don't want it to be laggy either. (Just not doodads and whatnot, but triggers to avoid as well if possible).

thanks for reading.

ps. if you want a screenshot so you can see what stuff i got on my map that may be causing lag, just say so.
03-01-2004, 03:34 AM#2
ThyFlame
Mass timed spawns lag... use recycling systems from the repository.
03-01-2004, 09:24 AM#3
Cubasis
Against popular believe, recycling units does not save you from much leakage/lag.

Graphical Lag can be caused by too much happening on-screen at the same time, this does depend on the computer though. However, you don't really need to worry that much about too much doodads, as in my mod, KDH, we have around 10,000 doodads on a 256x256 map, and it doesn't lag noticably.

Lag Spikes can come up when loading a new type of unit into the GPU. F.ex. when playing TD's, and the spawned unit of a wave gives you a tiny lag, while the others don't. This happens because it needs to send the units model and texture to the GPU's memory, and on low-end systems, it takes like 0.25 second. This is also the cause of like a 5 sec lag during the start of a map.

So it's a good idea if you are creating alot of different units in your map, to "pre"-place them somewhere on the map in your editor, then kill/remove them all when the map starts (using triggers).


Intense triggers (periodic ones with like 0.01 second cooldown) can also cause jutters.

However, it mostly depends on the person how it handles in a visual-heavy map. And then ofcourse if you're spawning MASSES of units all the time, it can cause jutters.

Cubasis
03-01-2004, 03:12 PM#4
Vexorian
Something that really helps is to instead of using Center of Region <gen> everytime you want to create a unit.

Make this stuff at map initialization:

Set SpawnPoint[1] = center of Spawn Region 1<gen>
Set SpawnPoint[2] = center of Spawn Region 2<gen>
Set SpawnPoint[3] = center of Spawn Region 3<gen>
Set SpawnPoint[4] = center of Spawn Region 4<gen>
Set SpawnPoint[5] = center of Spawn Region 5<gen>

Then when creating the units use the point variables instead of center of region blaha, it is certainly the best you can do against the location leak since it will use the same locations everytime instead of creating them and destroying them again (cause even that cause small leak)
03-01-2004, 04:03 PM#5
RaeVanMorlock
Ummm... select File > New Map, save, and play ^_^ No lag whatsoever! Weeeeeee

Okay, really, I wanted to clarify something that Cubasis40 said. If you make a trigger that will create 1 of each of the units used in the map upon Map Initialization, then the loading time for each of those units will occur during the initial loading of the map (during the Load Screen mumbo-jumbo) rather than once the map is actually started. If you decide to kill/explode the units rather than remove them, since some people say that's more efficient, then make sure you disable any triggers that detect a unit's death for the duration of the creating and killing.