HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Question about large unit triggers

06-10-2003, 11:07 PM#1
FyreDaug
I was reading through Skyline's lag post, and I was wondering, if you spawn say 10 units at... 10 locations instantly, that would cause lag, but what if you spawned 1 unit and each of the 10 locations 10 times, over a second or two, would that make a noticable difference? I don't have time to test right now, but has anyone tried this?
06-10-2003, 11:28 PM#2
Sen
I am not going to test it, but it will actually cause more "delay" in the end, because things work better if you do them all at once. However, because this delay will be spread out, it will make a difference in lag. I would suggest over 5 seconds, not just 2 or 3 seconds. The higher the better.

This is because when war3 creates units, it has to load the meshes for those units into program memory, along with any necessary textures. Once they are in memory it can work with them pretty fast, but it takes a second to set them up.

Does that answer your question?
06-11-2003, 02:37 AM#3
Panto
Lots of TD maps will spawn all the units at once, or each of the spawn points will simultaneously spawn one unit after another. This tends to cause a lot of lag (especially the first way).

However, games like Cube Defense and a few others have staggered spawns that create the units just a little bit of time apart. It doesn't affect gameplay, but it does seem to cut down considerably on lag.
06-11-2003, 03:59 AM#4
piRo-piOn
FMSS is a great example... i believe it spawns something like 3 units at random points in a region every something seconds.
06-11-2003, 10:34 AM#5
Sen
Other possible work arounds would be to create the units slowly, but have them all hidden, and then un-hide them all at once. I'm not sure if a unit still uses video memory when it is hidden or not. If it does use video memory, then you could create them slowly, and then unhide them all, and there would be no lag because it wouldn't really have to load anything.

War3 might unload units from video memory that are hidden tho. (in fact it is likely).

Another solution if they all have to be bunched together while running is simply moving the spawn region along with the running units, and then spawning gradually.
06-11-2003, 04:39 PM#6
Ari
For the record, I strongly suspect that wc3 does indeed unload units from memory when they are hidden. In my warcraft tactics map, I have 1200 "tiles" (heavily modified farm models) hidden during gameplay. When I unhide 400 of them, there's a very perceptable lag as they are all loaded. Moveover, there's a noticable performance hit when all of them are unhidden. Since this performance hit isn't present when they are hidden, I'm guessing that wc3 doesn't keep hidden units in memory (at least in general).
06-12-2003, 07:59 AM#7
Sen
Yes, I suspect the same thing. Maybe if you set them at 100% transparency instead. Then again, whats the overhead on most graphics cards for transparent (alpha) blending? Or maybe it will unload them when it sees they are 100% transparent... Who knows.