My map Bungle Squats is experiencing lag in late game.
It is a simple map and I believe the reason to be periodic timers.
I have experience with auto spawning maps and I found it is best to keep the spawning of all units in one trigger and one periodic timer. However this map deals with multiple units spawning at their own specific spawn rate.
For example, Marines spawn at 3.6 real time seconds, Zealots spawn at 5.7 real time seconds.
Up to now the only solutions i've found are to only switch timers on when needed and to combine timers. However I can't seem to eliminate the lag.
A suggestion as been made to me to use loops within the triggres and use the wait function rather than the periodic timer function.
I'm skeptical of any difference between a periodic event and a loop with a wait. Also, if you were experiencing lag because of how this timer was implemented, wouldn't you experience it from the start of the game, and not only in the end game?
Since the problem only appears in late game as you said, I'm guessing the cause is slightly different. I'm no expert on this, but I heard that in wc3 when a unit dies it is not removed from the game. Maps that dealt with lots of units spawning and dying specifically had to run triggers to remove the unit from the game, not just kill the unit.
If you're only running this after playing a long game, even when there are few units alive, then i'm more likely to believe this is the issue rather than how you wrote your loops.
You could switch your unit spawning to be handled completely by DATA.... then to adjust the spawn rates you could use "upgrades" or "set catalog field value" to change the rates....
This would probably dramatically increase proformance.
I have found that periodic triggers tend to lag in bnet. If they do alot of stuff anyways..
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Sorry, I should have specified that I am esing the periodict
<<quote 255253>>
I'm skeptical of any difference between a periodic event and a loop with a wait. Also, if you were experiencing lag because of how this timer was implemented, wouldn't you experience it from the start of the game, and not only in the end game?
Since the problem only appears in late game as you said, I'm guessing the cause is slightly different. I'm no expert on this, but I heard that in wc3 when a unit dies it is not removed from the game. Maps that dealt with lots of units spawning and dying specifically had to run triggers to remove the unit from the game, not just kill the unit.
If you're only running this after playing a long game, even when there are few units alive, then i'm more likely to believe this is the issue rather than how you wrote your loops.
<</quote>>
Hi, sorry I wasn't specific enough.
I use a system of switching the triggers on and off when they are required so I have as few running as possible. Late game they are nearly all running as the units have been bought by players.
I'm interested to know how I can remove dead units from the game after they have been killed. Maybe this is also a problem because late game there is anything between 4000-16000 units that have been killed.
This is how a trigger looks for a unit spawn - Please note that the unitgroup is cleared in another trigger, so it is not causing leaks as far as I know
Events
Timer - Every 5.7 seconds of Real Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Picked player) <= 8
(Picked player) >= 1
Player defeated check[(Picked player)] == false
Unit Count[(Picked player)] < Unit Limit
Zealot[(Picked player)] > 0
Then
Unit - Create Zealot[(Picked player)] Zealot for player (Picked player) at Spawn Area Array[(Picked player)] using default facing (No Options)
Variable - Modify Unit Count[(Picked player)]: + Zealot[(Picked player)]
Unit Group - Pick each unit in (Last created units) and do (Actions)
Actions
Unit Group - Add (Picked unit) to Last Created Unit Group
Else
Quote from SouLCarveRR:
You could switch your unit spawning to be handled completely by DATA.... then to adjust the spawn rates you could use "upgrades" or "set catalog field value" to change the rates....
This would probably dramatically increase proformance.
I have found that periodic triggers tend to lag in bnet. If they do alot of stuff anyways..
----
Quote from SouLCarveRR:
You could switch your unit spawning to be handled completely by DATA....
then to adjust the spawn rates you could use "upgrades" or "set catalog
field value" to change the rates....
This would probably dramatically increase proformance.
I have found that periodic triggers tend to lag in bnet. If they do alot
of stuff anyways..
I've no idea how this is done.
Are there any guides?
Um Behaviors with periodic effects that spawn units......
and "DO NOT USE WAITS IN PERIODIC TRIGGERS" that already have alot of stuff to do.... I cant see your exact trigger so yeah...
If the trigger is running multiple times at once.. this could be where your lag is coming from because you said your doing dynamic spawn rates so im guessing that your trigger runs every 1 second and in the trigger it checks to see if enough time has transpired since the last time each spawn point was activated.
its possible this trigger is running again before the previous time it ran had finished.... this could possibly generate lagg
that or your playing with the trigger debugger open .... which causes a lot of lag
So these behaviours would be applied to say the command centre(this is the main structure for each player). Then the units would spawn at the command centre? Would they also move to the command centre's rally point?
Lastly, I could just use triggers to add and remove as many of these behaviours as i would like?
That trigger is just one of 17 periodic timer triggers. One for each spawn rate. I don't use loops or waits in the trigger so there's no chance of the performance degradation of loop within a loop.
It is just what is shown above. Every 5.7 seconds this trigger completes the actions. It creates x number of units at the spawn point of the "picked player", then it saves those units into a unit group which is then used to rally units and then the unitgroup is cleared.
well you can make "Set Effects" (which run a multiple set of effects)
SpawnEffect (type:set effect_
Create Unit Effect (spawns 1 marine)
Issue Order effect > target search area all units in search area of 10 > orders unit "move attack" to possition offset (you could specify a specific target but thats more involved then I know... if you research it im sure you can figure it out)
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
To post a comment, please login or register a new account.
My map Bungle Squats is experiencing lag in late game.
It is a simple map and I believe the reason to be periodic timers.
I have experience with auto spawning maps and I found it is best to keep the spawning of all units in one trigger and one periodic timer. However this map deals with multiple units spawning at their own specific spawn rate.
For example, Marines spawn at 3.6 real time seconds, Zealots spawn at 5.7 real time seconds.
Up to now the only solutions i've found are to only switch timers on when needed and to combine timers. However I can't seem to eliminate the lag.
A suggestion as been made to me to use loops within the triggres and use the wait function rather than the periodic timer function.
Would this make a difference?
You could use Periodic Event rather than relying on timers.
I'm skeptical of any difference between a periodic event and a loop with a wait. Also, if you were experiencing lag because of how this timer was implemented, wouldn't you experience it from the start of the game, and not only in the end game?
Since the problem only appears in late game as you said, I'm guessing the cause is slightly different. I'm no expert on this, but I heard that in wc3 when a unit dies it is not removed from the game. Maps that dealt with lots of units spawning and dying specifically had to run triggers to remove the unit from the game, not just kill the unit.
If you're only running this after playing a long game, even when there are few units alive, then i'm more likely to believe this is the issue rather than how you wrote your loops.
You could switch your unit spawning to be handled completely by DATA.... then to adjust the spawn rates you could use "upgrades" or "set catalog field value" to change the rates....
This would probably dramatically increase proformance.
I have found that periodic triggers tend to lag in bnet. If they do alot of stuff anyways..
Sorry, I should have specified that I am esing the periodict
<<quote 255253>>
I'm skeptical of any difference between a periodic event and a loop with a wait. Also, if you were experiencing lag because of how this timer was implemented, wouldn't you experience it from the start of the game, and not only in the end game?
Since the problem only appears in late game as you said, I'm guessing the cause is slightly different. I'm no expert on this, but I heard that in wc3 when a unit dies it is not removed from the game. Maps that dealt with lots of units spawning and dying specifically had to run triggers to remove the unit from the game, not just kill the unit.
If you're only running this after playing a long game, even when there are few units alive, then i'm more likely to believe this is the issue rather than how you wrote your loops.
<</quote>>
Hi, sorry I wasn't specific enough.
I use a system of switching the triggers on and off when they are required so I have as few running as possible. Late game they are nearly all running as the units have been bought by players.
I'm interested to know how I can remove dead units from the game after they have been killed. Maybe this is also a problem because late game there is anything between 4000-16000 units that have been killed.
This is how a trigger looks for a unit spawn - Please note that the unitgroup is cleared in another trigger, so it is not causing leaks as far as I know
Events
Timer - Every 5.7 seconds of Real Time
Local Variables
Conditions
Actions
Player Group - Pick each player in (Active Players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Picked player) <= 8
(Picked player) >= 1
Player defeated check[(Picked player)] == false
Unit Count[(Picked player)] < Unit Limit
Zealot[(Picked player)] > 0
Then
Unit - Create Zealot[(Picked player)] Zealot for player (Picked player) at Spawn Area Array[(Picked player)] using default facing (No Options)
Variable - Modify Unit Count[(Picked player)]: + Zealot[(Picked player)]
Unit Group - Pick each unit in (Last created units) and do (Actions)
Actions
Unit Group - Add (Picked unit) to Last Created Unit Group
Else
Quote from SouLCarveRR:
You could switch your unit spawning to be handled completely by DATA.... then to adjust the spawn rates you could use "upgrades" or "set catalog field value" to change the rates....
This would probably dramatically increase proformance.
I have found that periodic triggers tend to lag in bnet. If they do alot of stuff anyways..
----
I've no idea how this is done.
Are there any guides?
Um Behaviors with periodic effects that spawn units......
and "DO NOT USE WAITS IN PERIODIC TRIGGERS" that already have alot of stuff to do.... I cant see your exact trigger so yeah...
If the trigger is running multiple times at once.. this could be where your lag is coming from because you said your doing dynamic spawn rates so im guessing that your trigger runs every 1 second and in the trigger it checks to see if enough time has transpired since the last time each spawn point was activated.
its possible this trigger is running again before the previous time it ran had finished.... this could possibly generate lagg
that or your playing with the trigger debugger open .... which causes a lot of lag
So these behaviours would be applied to say the command centre(this is the main structure for each player). Then the units would spawn at the command centre? Would they also move to the command centre's rally point?
Lastly, I could just use triggers to add and remove as many of these behaviours as i would like?
That trigger is just one of 17 periodic timer triggers. One for each spawn rate. I don't use loops or waits in the trigger so there's no chance of the performance degradation of loop within a loop.
It is just what is shown above. Every 5.7 seconds this trigger completes the actions. It creates x number of units at the spawn point of the "picked player", then it saves those units into a unit group which is then used to rally units and then the unitgroup is cleared.
@gorang: Go
well you can make "Set Effects" (which run a multiple set of effects)