I'm making a massing map, and so far it's going good and everything, but one huge problem(and this goes for any maps which involve massing units) is the fact that your FPS can drop to near 0 in any large battles. My map is very trigger heavy, most of the performance issues come from one trigger though, and so this is a big issue. Basically for every unit death I have to track it by setting some variables. I do it with this trigger;
That runs everytime a unit dies, and since in massive battles there are obviously going to be a lot of units dying in a very short amount of time this thing fires off like a machine gun with infinite bullets. Because of this I even implemented a supply cap to limit the amount of units a player can control at one time. It works, but the problem is still there. Anyone have any ideas on how to increase my map's performance in this case? Anything I should change in that trigger?
How long would it typically take a player to reach 200 kills? Would it be worth it to have a brief timer (say 2 minutes), run a trigger which turns that trigger on to check the conditions and then turns it off? And then repeats every 30 seconds or so, as opposed to every second or less?
If that's confusing...
Trigger 1: 2 min timer, when time expires, turn on Trigger 2, wait, turn Trigger 2 off
Now repeat, every 15-30 seconds until the conditions of Trigger 2 = true, then turn both triggers off.
How long would it typically take a player to reach 200 kills? Would it be worth it to have a brief timer (say 2 minutes), run a trigger which turns that trigger on to check the conditions and then turns it off? And then repeats every 30 seconds or so, as opposed to every second or less?
Well in my map on the first level you spawn two units per 4 seconds, until you level up @ 200 kills at which point it will only spawn one. I mean I also have a scoreboard, this is the trigger that serves to update both it and every other variable that is updated in this manner.
I think your basically suggesting that I update the variables in groups every X seconds? Idk it would work but the scoreboard would be a little eh.
Did you try disabling the trigger completely to see the performance gain? That performance would be your best case.
Next, try making improvements to the trigger and see how performance changes. I recommend using sensor-based checks if possible. This distributes calculations over time. For example, just do the bare minimum when an enemy is killed like increment a kill count. Here's an example of a sensor-based setup I use in my map -
HostileSquadCountSensor-PollingEventsTimer-EveryHOSTILE_SQUAD_SPAWN_CHECK_INTERVALsecondsofGameTimeLocalVariablesi=0<Integer>squadCount=0<Integer>ConditionsActionsGeneral-Foreachintegerifrom1toMAX_HOSTILE_SQUADSwithincrement1,do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(NumberofLivingunitsing_hostileSquads[i].units) > 0
Then
Variable - Modify squadCount: + 1
Else
Variable - Set g_hostileSquadCount = squadCount
Other methods can check the g_gostileSquadCount variable for their logic. Would be nasty to call this method continuously.
Did you try disabling the trigger completely to see the performance gain? That performance would be your best case.
Next, try making improvements to the trigger and see how performance changes. I recommend using sensor-based checks if possible. This distributes calculations over time. For example, just do the bare minimum when an enemy is killed like increment a kill count. Here's an example of a sensor-based setup I use in my map -
Other methods can check the g_gostileSquadCount variable for their logic. Would be nasty to call this method continuously.
While I haven't disabled the trigger to see how much it actually affects the performance I'll bet it does more than it's fair share. As for distributing the calculations over time, I think I'm already doing this on a smaller scale. I'll see if I can improve that a bit after I go test the performance. Brb.
-
Edit
-
Testing with it on: < 15 fps (in major battles)
Testing with it off: ~ 23+ fps (in major battles)
I don't have the best graphics card out there, nor do I have the best processor, but mine is around average according to the game's graphic settings (says I can go on medium with little problem). I have an ATI Radeon HD 4650 and a 2.7 GHz triple core processor.
Your FPS issue does not stem from any trigger issues. FPS is all about poly count and pixel shaders and will not be effected by even the most taxing of triggers. Fact is, when your map is being hosted online, your map and all it's triggers are being run by one of Blizzard's servers. The only area a trigger can effect performance is with regards to networking, and you would need a massive number of triggers sending huge amounts of information every frame to create a real issue.
With regards to improving your map performance? You need to lower the amount of information being processed by the GFX cards of your players. That means lowering poly count via less detailed models, using fewer units, or reducing the number of shader instructions by culling out uneccessary fancy effects. The rest is up to your player. If his machine is getting a reduced fps on your map he must lower his detail settings so that his computer can handle the larger battles.
PS. The performance drop you see with and without this trigger is likely from the fact that you are testing it on your own PC. My advice is to upload a version of each map to the Blizzard servers are see if there is any difference there. I notice rather large performance gains testing my map online over testing it locally. Also, if you are testing your map with the Trigger Debug window you will get a huge performance loss the longer the map runs.
Your FPS issue does not stem from any trigger issues. FPS is all about poly count and pixel shaders and will not be effected by even the most taxing of triggers. Fact is, when your map is being hosted online, your map and all it's triggers are being run by one of Blizzard's servers. The only area a trigger can effect performance is with regards to networking, and you would need a massive number of triggers sending huge amounts of information every frame to create a real issue.
With regards to improving your map performance? You need to lower the amount of information being processed by the GFX cards of your players. That means lowering poly count via less detailed models, using fewer units, or reducing the number of shader instructions by culling out uneccessary fancy effects. The rest is up to your player. If his machine is getting a reduced fps on your map he must lower his detail settings so that his computer can handle the larger battles.
PS. The performance drop you see with and without this trigger is likely from the fact that you are testing it on your own PC. My advice is to upload a version of each map to the Blizzard servers are see if there is any difference there. I notice rather large performance gains testing my map online over testing it locally. Also, if you are testing your map with the Trigger Debug window you will get a huge performance loss the longer the map runs.
Ill try that soon. Keep in mind I have button to mass your units to a specific unit's position, and a hotkey to go along with said button. This creates netcode so I don't want people spamming it 100 times a second or w/e is humanly possible. You use it once, button disappears, hotkey is disabled, waits 5 seconds, re-enables. It does this per a player so you cant spam it endlessly and lag the game.
Yeah I know if you strip down everything else off of it the thing runs fairly smoothly, but I don't know if I should. I'm uploading the map to battle.net to test it there atm. If it isn't much better ill consider changing how my triggers work a bit.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm making a massing map, and so far it's going good and everything, but one huge problem(and this goes for any maps which involve massing units) is the fact that your FPS can drop to near 0 in any large battles. My map is very trigger heavy, most of the performance issues come from one trigger though, and so this is a big issue. Basically for every unit death I have to track it by setting some variables. I do it with this trigger;
That runs everytime a unit dies, and since in massive battles there are obviously going to be a lot of units dying in a very short amount of time this thing fires off like a machine gun with infinite bullets. Because of this I even implemented a supply cap to limit the amount of units a player can control at one time. It works, but the problem is still there. Anyone have any ideas on how to increase my map's performance in this case? Anything I should change in that trigger?
@ST4RKiLL3R: Go
How long would it typically take a player to reach 200 kills? Would it be worth it to have a brief timer (say 2 minutes), run a trigger which turns that trigger on to check the conditions and then turns it off? And then repeats every 30 seconds or so, as opposed to every second or less?
If that's confusing...
Well in my map on the first level you spawn two units per 4 seconds, until you level up @ 200 kills at which point it will only spawn one. I mean I also have a scoreboard, this is the trigger that serves to update both it and every other variable that is updated in this manner.
I think your basically suggesting that I update the variables in groups every X seconds? Idk it would work but the scoreboard would be a little eh.
@ST4RKiLL3R: Go
Did you try disabling the trigger completely to see the performance gain? That performance would be your best case.
Next, try making improvements to the trigger and see how performance changes. I recommend using sensor-based checks if possible. This distributes calculations over time. For example, just do the bare minimum when an enemy is killed like increment a kill count. Here's an example of a sensor-based setup I use in my map -
Other methods can check the g_gostileSquadCount variable for their logic. Would be nasty to call this method continuously.
While I haven't disabled the trigger to see how much it actually affects the performance I'll bet it does more than it's fair share. As for distributing the calculations over time, I think I'm already doing this on a smaller scale. I'll see if I can improve that a bit after I go test the performance. Brb.
-Edit-Testing with it on: < 15 fps (in major battles)
Testing with it off: ~ 23+ fps (in major battles)
I don't have the best graphics card out there, nor do I have the best processor, but mine is around average according to the game's graphic settings (says I can go on medium with little problem). I have an ATI Radeon HD 4650 and a 2.7 GHz triple core processor.
@ST4RKiLL3R: Go
Your FPS issue does not stem from any trigger issues. FPS is all about poly count and pixel shaders and will not be effected by even the most taxing of triggers. Fact is, when your map is being hosted online, your map and all it's triggers are being run by one of Blizzard's servers. The only area a trigger can effect performance is with regards to networking, and you would need a massive number of triggers sending huge amounts of information every frame to create a real issue.
With regards to improving your map performance? You need to lower the amount of information being processed by the GFX cards of your players. That means lowering poly count via less detailed models, using fewer units, or reducing the number of shader instructions by culling out uneccessary fancy effects. The rest is up to your player. If his machine is getting a reduced fps on your map he must lower his detail settings so that his computer can handle the larger battles.
PS. The performance drop you see with and without this trigger is likely from the fact that you are testing it on your own PC. My advice is to upload a version of each map to the Blizzard servers are see if there is any difference there. I notice rather large performance gains testing my map online over testing it locally. Also, if you are testing your map with the Trigger Debug window you will get a huge performance loss the longer the map runs.
Ill try that soon. Keep in mind I have button to mass your units to a specific unit's position, and a hotkey to go along with said button. This creates netcode so I don't want people spamming it 100 times a second or w/e is humanly possible. You use it once, button disappears, hotkey is disabled, waits 5 seconds, re-enables. It does this per a player so you cant spam it endlessly and lag the game.
it is enough to update this once a second in a stand alone trigger:
Yeah I know if you strip down everything else off of it the thing runs fairly smoothly, but I don't know if I should. I'm uploading the map to battle.net to test it there atm. If it isn't much better ill consider changing how my triggers work a bit.