I am making a Tug of War map based on Warcraft mod. In this map, in late game can be 400-800 units. The problem is that FPS is too low and map is just unplayable. I started to investigate this issue and tested on empty map with warcraft mod. If you use original starcraft 2 units - fps is fine, about 40-60 on Extreme settings. If you use warcraft units fps drops down to 10-20 and more units -> less fps. In my map fps was 1. The problem was in events of models of warcraft units. Check screen http://imgur.com/SHONn8f. I have removed all events from all models and Boom, fps x2, x3 increased, it's still not fine. But it's better than nothing. Some units such as Demolisher can completely destroy your map. So, removing events for this model just must have.
Another problem of my map - corpses, many corpses. I found that they are removed after 88 seconds. To reduce this value find agent War3_DeadAnimationMacroUnit (Unnamed) and set duration of animation to 5 seconds. It's increased my fps by 10.
I have attached map where you can test performance with many units. Just remove and reset events for unit and run map. You will see difference. You can also compare it with original Starcraft 2 units.
Model Events are mainly used to play sounds and spawn effects for the model. Like the death blood, the footprints, the moving/animation sounds etc. If you have hundreds of these units in a screen, it would be better to remove them to increase performance.
Siege units cost most since they have most 'car-tracks' (foot prints), and each segment of these tracks is a single model. So you can simply remove the events if you have too much of these units or if you don't need this kind of things.
For the corpses. The macro only control the time how there corpse model exist. The actual corpse duration is controled by the 'death time' of this field.
So kill the model won't actually kill the unit instance. If your map doesn't need corpse, you can just set the 'death time' of all units to 0.
In war3, these events are set in the model files itself. But the models in the offical asset pack doesn't include any of them. So I manually set them with data.
Some of them are vital, for example: even the launch/impact sounds of missiles are all generated by the model events. With out them, the combat would become a 'dumb show'. So selective removing model events from units can be helpful, but it would be bad to remove them from things like the missile models.
Rollback Post to RevisionRollBack
GAx4 - An A extremely powerful Mod to amplify the capability of StarCraft II Editor!
We now have Warcraft themed mod subform in this site.
Some other things that may help in some 'maps with lots of units'
Attack Ground: If your map feature hundreds of siege units which has attack ground abiilties, it would be a performance killer. Since currently attack ground is done by 'create a dummy unit and order the siege unit to attack it, and remove the dummys' after the units no longer attack the dummys'. So let's say if you have 300 units attacking ground, there would be 600 units in total.
A better way to avoid it, is simply don't use the Attack Ground in your map. Or if you only need them to attack the same point, you can just use trigger to attack the same dummy unit, and as long as the other dummy units not being attacked by their own Siege Unit, they will be auto-removed.
(Note: I would recreate the Attack Ground after the void, since Void provided useful feature to do this. After that, there would be NO DUMMY UNITS.)
Trees: Sc2 doesn't have war3's tress supports, so all tress are all units if you want them to be harvestable. If you maps have thousands of trees, and you don't actually need harestable/attackable tress, you can just replace them with doodads, it would greatly increase the performance.
Console Status Bar: It's a feature that requested by war3 Melee fans, but it also consume some performances. If you maps would require you to control hundreds of units in the same group, you can turn off this feature and revert back to the SC2's defalut Color-based-console-hp-display method.
1. Remove "War3_GroupIconMonitorMacro" from your unit actor's Macro field.
2. Go to the data editor's Game UI Data sheet, revert the 'Wireframe Colors' field
I found that all weapon with splash damage completely destroys performance. More search flags->lower fps. Should i just don't use splash in my map?
Also can you say where death model of Demolisher is configured? These corpses kills my map, when all corpses removed fps is 90. When 200 corpses on the map fps 30-40. I need to remove them fast, but they are removing too slow... War3_DeadAnimationMacroUnit (Unnamed) did not help to fix Demolisher death model.
EDIT: to remove death models fast, open actor events War3_DeadAnimationMacroUnit (Unnamed) and set animation Decay to 5 seconds. Now, Demolisher death models will be removed in 5 seconds.
EDIT2: Still can't find how to remove fast Rifleman death model.
Go to the data editor, then the units tab. Find your rifleman unit. There is a stat called: "Death Time".
This is how long the unit will stay in the game after it dies. If you want to use spells that need corpses (necros and spirit walker spells for instance) I suggest you don't put this stat to 0 directly.
I don't know exactly what happens to a unit that is referenced in the triggers. During the period when its dead it will point to the right unit, but I think after the dead period your reference will point to "No Unit".
Death Time does not have any relations to death time of death model of unit. Demolisher have 0 death time but death model removed through War3_DeadAnimationMacroUnit (Unnamed) actor settings. I fixed rifleman, don't know how, but just did everything again and set death model animation to 5 seconds in War3_DeadAnimationMacroUnit (Unnamed) actor.
This is what i had in my actor, i did it myself before you posted it. And it still does not work for Abomination. It did not work for rifleman also, but after unknown actions it started work for rifleman and still does not work for some other units.
EDIT: Found weird bug, just reseted macroses for actor of Abomination and it works... Before this I changed marcos field to remove Console Status Bar. Then changed War3_DeadAnimationMacroUnit (Unnamed). And changes in War3_DeadAnimationMacroUnit (Unnamed) have not applied to this unit. Seems it's errors in editor. So just need to reset macros field of all units and then remove Console Status Bar again, lol.
I have an overclocked FX-6300 and an overclocked Sapphire Radeon 7950.
Starcraft 2 with 800+ units runs at 14 fps if I remember correctly, even less sometimes.
So I wouldn't blame the mod so fast, try the normal Starcraft 2 with no Fog of War or Black Mask. Create 800 lings and see if you have the same performance issues, which I believe you will. Maybe with 1-2fps on top.
By my research, the main thing causing the lag is PATHING. If you want to use over 800 units I'd just set all units which are going to be massed to AIR pathing, that should help.