Curo
Why am I still playing this game...?
- Reaction score
- 109
I made a previous thread with a question. I have now found the answer to that question, and am posting a new question (don't -rep me again, AceHart)
I have recently been experimenting with preloading; the concept of creating units and [units with certain] abilities at the start of the map to avoid small lag spikes in game when said units and abilities would first be introduced. From what I have found, there are 2 ways to preload things, both involving creating then destroying the units in question. The first way uses the map initialization event which causes the map loading time to increase significantly. The second option is to preload during an opening cinematic to "hide" the lag spike.
Now to my problem. I used the second option, preloading during a cinematic. What happens though is that I get a significant lag spike turning what should be a 4 second cinematic into a 20 second cinematic. Now what is the point of using this cinematic method if the lag spike will still be visible? Beyond that, I am curious as to why my preload trigger warrants such a massive spike. It creates 22 heroes (15 of which have 5 abilities each), then does not remove them. I see no reason for creating dummies with the abilities, then removing the dummies, just to add the heroes. Why not save a step and add the heroes directly? My point is, why is this causing such a huge lag spike, and further, how can I prevent this?
The trigger follows:
I have recently been experimenting with preloading; the concept of creating units and [units with certain] abilities at the start of the map to avoid small lag spikes in game when said units and abilities would first be introduced. From what I have found, there are 2 ways to preload things, both involving creating then destroying the units in question. The first way uses the map initialization event which causes the map loading time to increase significantly. The second option is to preload during an opening cinematic to "hide" the lag spike.
Now to my problem. I used the second option, preloading during a cinematic. What happens though is that I get a significant lag spike turning what should be a 4 second cinematic into a 20 second cinematic. Now what is the point of using this cinematic method if the lag spike will still be visible? Beyond that, I am curious as to why my preload trigger warrants such a massive spike. It creates 22 heroes (15 of which have 5 abilities each), then does not remove them. I see no reason for creating dummies with the abilities, then removing the dummies, just to add the heroes. Why not save a step and add the heroes directly? My point is, why is this causing such a huge lag spike, and further, how can I prevent this?
The trigger follows:
Code:
preload
Events
Map initialization
Conditions
Actions
Set TempPoint[1] = (Center of start architect <gen>)
Unit - Create 1 Architect for Neutral Passive at TempPoint[1] facing 70.00 degrees
Set hero_architect = (Last created unit)
Set TempPoint[2] = (Center of start arsonist <gen>)
Unit - Create 1 Arsonist for Neutral Passive at TempPoint[2] facing 270.00 degrees
Set hero_arsonist = (Last created unit)
Set TempPoint[3] = (Center of start barge <gen>)
Unit - Create 1 Living Machine for Neutral Passive at TempPoint[3] facing 180.00 degrees
Set hero_barge = (Last created unit)
Set TempPoint[4] = (Center of start carrier <gen>)
Unit - Create 1 Protoss Battleship for Neutral Passive at TempPoint[4] facing 270.00 degrees
Set hero_carrier = (Last created unit)
Set TempPoint[5] = (Center of start centaur <gen>)
Unit - Create 1 Centaur Battlelord for Neutral Passive at TempPoint[5] facing 270.00 degrees
Set hero_centaur = (Last created unit)
Set TempPoint[6] = (Center of start deadly <gen>)
Unit - Create 1 Deadly Assassin for Neutral Passive at TempPoint[6] facing 0.00 degrees
Set hero_deadly = (Last created unit)
Set TempPoint[7] = (Center of start dragon <gen>)
Unit - Create 1 Vengeful Dragon for Neutral Passive at TempPoint[7] facing 270.00 degrees
Set hero_dragon = (Last created unit)
Set TempPoint[8] = (Center of start druid <gen>)
Unit - Create 1 Guardian Druid for Neutral Passive at TempPoint[8] facing 270.00 degrees
Set hero_druid = (Last created unit)
Set TempPoint[9] = (Center of start ghost <gen>)
Unit - Create 1 Ghost Lord for Neutral Passive at TempPoint[9] facing 270.00 degrees
Set hero_ghost = (Last created unit)
Set TempPoint[10] = (Center of start ghoul <gen>)
Unit - Create 1 Frenzied Ghoul for Neutral Passive at TempPoint[10] facing 135.00 degrees
Set hero_ghoul = (Last created unit)
Set TempPoint[11] = (Center of start master <gen>)
Unit - Create 1 Master of the Arts for Neutral Passive at TempPoint[11] facing 0.00 degrees
Set hero_master = (Last created unit)
Set TempPoint[12] = (Center of start mind <gen>)
Unit - Create 1 The Collective Mind for Neutral Passive at TempPoint[12] facing 45.00 degrees
Set hero_mind = (Last created unit)
Set TempPoint[13] = (Center of start phase <gen>)
Unit - Create 1 Phase Shifter for Neutral Passive at TempPoint[13] facing 0.00 degrees
Set hero_phase = (Last created unit)
Set TempPoint[14] = (Center of start pitlord <gen>)
Unit - Create 1 Pit Lord Torturist for Neutral Passive at TempPoint[14] facing 225.00 degrees
Set hero_pitlord = (Last created unit)
Set TempPoint[15] = (Center of start rage <gen>)
Unit - Create 1 Embodiment of Rage for Neutral Passive at TempPoint[15] facing 315.00 degrees
Set hero_rage = (Last created unit)
Set TempPoint[16] = (Center of start ranger <gen>)
Unit - Create 1 Divine Ranger for Neutral Passive at TempPoint[16] facing 90.00 degrees
Set hero_ranger = (Last created unit)
Set TempPoint[17] = (Center of start renegade <gen>)
Unit - Create 1 Renegade for Neutral Passive at TempPoint[17] facing 180.00 degrees
Set hero_renegade = (Last created unit)
Set TempPoint[18] = (Center of start stealth <gen>)
Unit - Create 1 Stealth Assassin for Neutral Passive at TempPoint[18] facing 0.00 degrees
Set hero_stealth = (Last created unit)
Set TempPoint[19] = (Center of start trapper <gen>)
Unit - Create 1 Trapper for Neutral Passive at TempPoint[19] facing 0.00 degrees
Set hero_trapper = (Last created unit)
Set TempPoint[20] = (Center of start virus <gen>)
Unit - Create 1 Rouge Virus for Neutral Passive at TempPoint[20] facing 0.00 degrees
Set hero_virus = (Last created unit)
Set TempPoint[21] = (Center of start water <gen>)
Unit - Create 1 Water Diety for Neutral Passive at TempPoint[21] facing 180.00 degrees
Set hero_water = (Last created unit)
Set TempPoint[22] = (Center of start wraith <gen>)
Unit - Create 1 Shadow Wraith for Neutral Passive at TempPoint[22] facing 180.00 degrees
Set hero_wraith = (Last created unit)
For each (Integer A) from 1 to 22, do (Custom script: call RemoveLocation (udg_TempPoint[bj_forLoopAIndex]))