I'm testing my tower defense map for stress testing and efficiency, using a full house of 6 players. I'm playing by myself and faking the game into running as if all players are present.
I've found a serious problem where my frame rate goes down permanently after each level. The more intense the level is, the more the frame rate goes down. For example, my testing is centered around a level that is particularly damaging to the frame rate (dozens of zerglings flood the map throughout the level). Before the level begins, my frame rate sits consistently at around 90 FPS. As the level goes on, the frame rate drops down to 60 FPS, then at its worst it can go down to 25-30 FPS. When the level is over, the frame rate sits at somewhere around 40 FPS and never goes back up to the 90 FPS I had before the level (even though the number of artifacts on the screen should be the same before and after, while the game idles between levels).
I plan to take measures to make this one level more efficient, but for now I'm only concerned with the problem that my frame rate can never go back up while the game is idle. This problem happens both with local map testing and over battle.net. I ran a windowed test mode with the trigger debugger, and I can confirm that there are huge performance spikes during the level (on the "Activity" tab), but all triggers and all threads close by the end of the level, and afterwards the Activity tab shows performance going back down to minimal with small green blips.
Next, I thought maybe there were actors that were not getting destroyed properly, so I made a test trigger to send the "Destroy" message to every actor on the map. When I first launch the game I have a frame rate of 120 FPS (before anything is built) , when I destroy all actors everything on the map disappears and the frame rate launches up to 170 FPS. On the next test where I wait until after the level is finished, the frame rate sits at 40 FPS and then I destroy all actors, the frame rate only goes up to 60 FPS. I would have thought the frame rate would be able to go back up to 170 FPS since there were no triggers running and no actors on the map.
Does anyone have ANY clue what could be happening here? Is the frame rate getting throttled when it dips below a certain threshold? Is there garbage collection that is failing? Is there any way to do more of my own memory cleanup manually to confirm the cause of the problem?
This is a critical game-breaking problem that could put a stop to my 2-year long project, so I have to find an answer. It's a tough problem, and I would very sincerely appreciate any help on this.
Try disabling parts of triggers, maybe something eats up resources.
Try moving everything to a new map (that's pain in the ass to do, but might bring up some results).
Output on screen everything that is created. Look for looping triggers.
Sorry, but it can be anything. What's the code size? How many units are implemented in the map?
If you are monitoring FPS, make sure the debugger is set to the threads tab because triggers and variables can cause lags like crazy. If you have messages displayed in the debugger (trigger starts, errors, ...) disable these. But best is to test it without debugger in fullscreen.
I was able to drop my FPS from capped 60 to 4 (!) with 1 trigger, 1 event which was unit attacked in my case and 2 zerglings of p1 and p15 which had a damage effect of 0 within the duration of a few minutes. That's how much the debugger can eat with the wrong settings (basically displaying everything and active trigger tab).
If the problem exists without having the debugger started with the map (just closing it is not enough), something on the map eats up the FPS.
Since you checked for actors, you might want to check the unit count before and after that level. Maybe there are dead units remaining that still eat up the FPS because of their presence (they don't even need to be on screen).
Other stuff that I could imagine:
- non-removed persistent effects
- buffs on some units that have very high stack counts
So try to remove all units for testing after that level. Maybe that will raise the FPS back to a high value again.
Thanks, I'll try testing for those things. Starting today I will be going down a laundry list of things to test.
I am monitoring FPS using the fraps on screen benchmark indicator, and I'm certainly not using the trigger debugger. When I have the debugger going with all 6 players in the game, there's enough stuff happening that it takes about 10 minutes to run through 1 minute of the game.
I've become curious as to whether anyone else has had this type of gradual frame rate loss before. I let the game run on its own and by the last level I had 5 FPS at all times, even while the game was idle. So, my conclusion is that there is something that is stealing memory and resources in my game, OR everyone would have to be having this problem.
@SkrowFunk: Go You can hit ctrl + alt + F to toggle sc2's fps display.
Check that out! I love how there's smart people here. I've been using this editor for 2 years and I never knew about that.
I've been doing more testing, specifically for monitoring extraneous leftover units. I picked every unit in the entire map with No Unit Filter. Before and after each level the counts are normal, and I can confirm that there are absolutely no leftover units after each level.
What's more interesting is that I made a test trigger to first send the actor message "Destroy" to every actor in the map, and then remove every unit on the map. I ran the trigger and let the game run. So, the game is running on its own with all 6 players and there are no towers shooting, doodads, or anything else. It's simply level after level of units walking in a line to the end of the track and dying (which means on average 150 units on the screen at any one time, 0 units between levels). I still see a FPS drop in each level that is just as severe as when there were towers actually killing the units.
After 10 levels the frame rate reached 24 FPS, after 20 levels the frame rate reached 11 FPS at all times, even when there are no units and no actors on the map.
It was text tags! I had a certain type of text tag that was never being destroyed. The levels that were more chaotic were also the ones that used more of these text tags so they made the game slower. Now that I am destroying these text tags the problem has gone away and my frame rate consistently returns to its maximum capacity.
I really appreciate the help I got on this thread. The suggestions gave me ideas for new things to test, and in running through these suggestions I was able to narrow it down and solve it!
I'm testing my tower defense map for stress testing and efficiency, using a full house of 6 players. I'm playing by myself and faking the game into running as if all players are present.
I've found a serious problem where my frame rate goes down permanently after each level. The more intense the level is, the more the frame rate goes down. For example, my testing is centered around a level that is particularly damaging to the frame rate (dozens of zerglings flood the map throughout the level). Before the level begins, my frame rate sits consistently at around 90 FPS. As the level goes on, the frame rate drops down to 60 FPS, then at its worst it can go down to 25-30 FPS. When the level is over, the frame rate sits at somewhere around 40 FPS and never goes back up to the 90 FPS I had before the level (even though the number of artifacts on the screen should be the same before and after, while the game idles between levels).
I plan to take measures to make this one level more efficient, but for now I'm only concerned with the problem that my frame rate can never go back up while the game is idle. This problem happens both with local map testing and over battle.net. I ran a windowed test mode with the trigger debugger, and I can confirm that there are huge performance spikes during the level (on the "Activity" tab), but all triggers and all threads close by the end of the level, and afterwards the Activity tab shows performance going back down to minimal with small green blips.
Next, I thought maybe there were actors that were not getting destroyed properly, so I made a test trigger to send the "Destroy" message to every actor on the map. When I first launch the game I have a frame rate of 120 FPS (before anything is built) , when I destroy all actors everything on the map disappears and the frame rate launches up to 170 FPS. On the next test where I wait until after the level is finished, the frame rate sits at 40 FPS and then I destroy all actors, the frame rate only goes up to 60 FPS. I would have thought the frame rate would be able to go back up to 170 FPS since there were no triggers running and no actors on the map.
Does anyone have ANY clue what could be happening here? Is the frame rate getting throttled when it dips below a certain threshold? Is there garbage collection that is failing? Is there any way to do more of my own memory cleanup manually to confirm the cause of the problem?
This is a critical game-breaking problem that could put a stop to my 2-year long project, so I have to find an answer. It's a tough problem, and I would very sincerely appreciate any help on this.
-Skrow
Try disabling parts of triggers, maybe something eats up resources.
Try moving everything to a new map (that's pain in the ass to do, but might bring up some results).
Output on screen everything that is created. Look for looping triggers.
Sorry, but it can be anything. What's the code size? How many units are implemented in the map?
@o3210: Go
I did a rough count, and there's about 300 different custom units I've made for this map. It's about 11 mb in raw file size.
I'm pretty sure the issue isn't looping triggers, because I would have seen that on the debugger's thread monitor.
I'm not exactly sure how I would copy everything to a new map file. Is there a reliable way to do this?
If you are monitoring FPS, make sure the debugger is set to the threads tab because triggers and variables can cause lags like crazy. If you have messages displayed in the debugger (trigger starts, errors, ...) disable these. But best is to test it without debugger in fullscreen.
I was able to drop my FPS from capped 60 to 4 (!) with 1 trigger, 1 event which was unit attacked in my case and 2 zerglings of p1 and p15 which had a damage effect of 0 within the duration of a few minutes. That's how much the debugger can eat with the wrong settings (basically displaying everything and active trigger tab).
If the problem exists without having the debugger started with the map (just closing it is not enough), something on the map eats up the FPS.
Since you checked for actors, you might want to check the unit count before and after that level. Maybe there are dead units remaining that still eat up the FPS because of their presence (they don't even need to be on screen).
Other stuff that I could imagine:
- non-removed persistent effects
- buffs on some units that have very high stack counts
So try to remove all units for testing after that level. Maybe that will raise the FPS back to a high value again.
@Ahli634: Go
Thanks, I'll try testing for those things. Starting today I will be going down a laundry list of things to test.
I am monitoring FPS using the fraps on screen benchmark indicator, and I'm certainly not using the trigger debugger. When I have the debugger going with all 6 players in the game, there's enough stuff happening that it takes about 10 minutes to run through 1 minute of the game.
I've become curious as to whether anyone else has had this type of gradual frame rate loss before. I let the game run on its own and by the last level I had 5 FPS at all times, even while the game was idle. So, my conclusion is that there is something that is stealing memory and resources in my game, OR everyone would have to be having this problem.
@SkrowFunk: Go You can hit ctrl + alt + F to toggle sc2's fps display.
Check that out! I love how there's smart people here. I've been using this editor for 2 years and I never knew about that.
I've been doing more testing, specifically for monitoring extraneous leftover units. I picked every unit in the entire map with No Unit Filter. Before and after each level the counts are normal, and I can confirm that there are absolutely no leftover units after each level.
What's more interesting is that I made a test trigger to first send the actor message "Destroy" to every actor in the map, and then remove every unit on the map. I ran the trigger and let the game run. So, the game is running on its own with all 6 players and there are no towers shooting, doodads, or anything else. It's simply level after level of units walking in a line to the end of the track and dying (which means on average 150 units on the screen at any one time, 0 units between levels). I still see a FPS drop in each level that is just as severe as when there were towers actually killing the units.
After 10 levels the frame rate reached 24 FPS, after 20 levels the frame rate reached 11 FPS at all times, even when there are no units and no actors on the map.
MORE TESTS!
SOLVED
It was text tags! I had a certain type of text tag that was never being destroyed. The levels that were more chaotic were also the ones that used more of these text tags so they made the game slower. Now that I am destroying these text tags the problem has gone away and my frame rate consistently returns to its maximum capacity.
I really appreciate the help I got on this thread. The suggestions gave me ideas for new things to test, and in running through these suggestions I was able to narrow it down and solve it!