So I did alot of searching to find anything about Buff Stacks causing lag because each stack counts as individual behaviors. I couldn't really find much on the subject, so Zolden told me to just test it myself and I did!
AMD Phenom FX 4100 Quad Core Processor, 3.8GHz
AMD Radeon 7700 HD 2GB graphics
16GB G-Skill DDR3
Also should be noted I am not overclocking for this. I also run the game at 1980x1200 resolution, max settings
Without further adieu..
-=-=-=-
130k buffs (2 buffs with maximum 65535 stacks) causes a freeze then crash
80k buffs (2 buffs with 40k stacks each) causes a very long freeze when applied, but allows play at approx 4-8 fps
50k buffs (2 with 25k) causes a moderate freeze and cuts the fps down to 10-15
25k buffs (2 with 12.5k) causes a moderate freeze and cuts fps down to 20-25
10k buffs (4 with 2.5k) causes a chunky stutter but barely touches fps
12k buffs appears to freeze lower end computers
8k and below seems fine beyond a slight stutter. My fps was 84-88 and any time I added 2-8k buffs I would see a drop to 60fps5k I would appear to be the maximum before frames start dropping on lower end computers
-=-=-=-
Workarounds:
When buff stacks reach a certain point, collapse the effect into 1 (ex. 20 buff stacks could potentially be collapsed into 1 buff in which it has the exact same "modifications" as the x1 buff stack, multiplied by 20.
This can be achieved by making the buff stacks collapse every 10 stacks, or when the stack reaches it's maximum. or really whenever you like.
So overall.. having around 2k buffs persistently (I'm personally making a progression system) seems to be alright, and even people with lower end computers would be able to handle it as long as their graphics were set appropriately. I wouldn't use this as a global reference.. but if someone happens to have a lower end computer to test this out on, I'd greatly appreciate seeing your findings!
Thought buff stacks were capped at 255? What are these buffs doing and how are you applying them?
Buff Stacks are capped at 65535 in the data editor, and there's nothing that I've seen that shows stacks maxing at 255. Each buff stack adds HP, armor, HP regen and heroic damage, the other buff adds MP, MP regen. I'm applying them through galaxyscript.
UnitAddBehavior(u, "STR", 65000); / last number being stack count
You don't have to, but if you end up with some free time let me know what you find out! I'm currently planning on using less than 400 buffs at a time (14 players worth of stats), if I HAVE to I will optimize that further, but for now we'll see how it runs.
It appears to run no differently when applied to my map with large amounts of large triggers, even though this is a blank map. The only difference I noticed was that at 60,000 stacks I got about 4 more FPS.
My computer will freeze for a long time when adding large amounts of buff stacks at once (2500+) but strangely enough when the unit supposedly has 18000 buff stacks, my computer (after freezing) will continue to run at a decent FPS.
Now here's the map. What this does is slowly increase the stacks, do as Zolden said and bring up the FPS bar and see how many stacks you can acquire without it going below 60. Make sure you press the menu button before you FPS drops too low, it might be hard to get out of. My computer can last all the way until max stacks but I know how easy it is to lock up a slower computer.
This have been an issue for me since SC2 beta. (your test map freeze my low end pc around 13k stack)
If you add the behaviors with triggers, just use multiple behaviors with different scales. Like add +1 damage buff per damage modulo 10 and add +10 damage buff per damage/10 (of course use integers). Also if you have a maximum limit you can do a single behavior for it...
Just check my Nexus Squadron Strike map, its full of behaviors like that and its not lagging even at late game....
This have been an issue for me since SC2 beta. (your test map freeze my low end pc around 13k stack)
If you add the behaviors with triggers, just use multiple behaviors with different scales. Like add +1 damage buff per damage modulo 10 and add +10 damage buff per damage/10 (of course use integers). Also if you have a maximum limit you can do a single behavior for it...
Just check my Nexus Squadron Strike map, its full of behaviors like that and its not lagging even at late game....
Awesome to hear, I'll update first post. I sortof do that in a different way, I have a trigger that dynamically collapses and expands buffs when they reach 10, which reduces the amount of total buff stacks I have by alot. If there is maximum players with the maximum amount of buffs they can have (very small chance of that happening), it still doesn't breach 400 buff stacks at any point.
Perchance could I ask you at the amount of stack your framerate started dropping from 60 fps? I want to make sure it isn't some low number like 500.
I'll definitely take a look at your map too, thank you!
well my fps is hardly over 70... What you should ask people that when get their fps halved first....
But it doesnt really matter. The work around that I use is pretty effective and you can always make it more effective by using mod 2 instead of 10... (though than you need to make much more behaviors)
Have you tried adding the buff stacks over time since doing anything excessive in a single instance can cause issues. The game used to crash if you added a ton of buff stacks using the Apply Behavior effect at once but if you added them over time in more reasonable numbers per 0.016 secs it would still work. Also cap used to be 255, I remember that the one patch upped the limit.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
well my fps is hardly over 70... What you should ask people that when get their fps halved first....
But it doesnt really matter. The work around that I use is pretty effective and you can always make it more effective by using mod 2 instead of 10... (though than you need to make much more behaviors)
Well, I need to know what amount of buffs makes framerate drop at all. Perhaps 200 buffs wouldn't make your fps drop by more than 3, but 500 would make it drop to 59. I need to know when it drops to 59 so that I know the most buffs I can use.
I've made good use of a workaround, it pushes 200 buff stacks at a time, which is normal for any game (especially tower defenses with multiple players) so I should be fine.
Have you tried adding the buff stacks over time since doing anything excessive in a single instance can cause issues. The game used to crash if you added a ton of buff stacks using the Apply Behavior effect at once but if you added them over time in more reasonable numbers per 0.016 secs it would still work. Also cap used to be 255, I remember that the one patch upped the limit.
I mean the damage modifier. You can cause your unit to deal more damage to certain armor types (in my case, heroic). Also, the test map I posted sortof slowly adds stacks, once it starts adding 500 at once it gets stuttery you're right
So I did alot of searching to find anything about Buff Stacks causing lag because each stack counts as individual behaviors. I couldn't really find much on the subject, so Zolden told me to just test it myself and I did!
AMD Phenom FX 4100 Quad Core Processor, 3.8GHz
AMD Radeon 7700 HD 2GB graphics
16GB G-Skill DDR3
Also should be noted I am not overclocking for this. I also run the game at 1980x1200 resolution, max settings
Without further adieu..
-=-=-=-
130k buffs (2 buffs with maximum 65535 stacks) causes a freeze then crash
80k buffs (2 buffs with 40k stacks each) causes a very long freeze when applied, but allows play at approx 4-8 fps
50k buffs (2 with 25k) causes a moderate freeze and cuts the fps down to 10-15
25k buffs (2 with 12.5k) causes a moderate freeze and cuts fps down to 20-25
10k buffs (4 with 2.5k) causes a chunky stutter but barely touches fps
12k buffs appears to freeze lower end computers8k and below seems fine beyond a slight stutter. My fps was 84-88 and any time I added 2-8k buffs I would see a drop to 60fps 5k I would appear to be the maximum before frames start dropping on lower end computers
-=-=-=-
Workarounds:
When buff stacks reach a certain point, collapse the effect into 1 (ex. 20 buff stacks could potentially be collapsed into 1 buff in which it has the exact same "modifications" as the x1 buff stack, multiplied by 20.
This can be achieved by making the buff stacks collapse every 10 stacks, or when the stack reaches it's maximum. or really whenever you like.
So overall.. having around 2k buffs persistently (I'm personally making a progression system) seems to be alright, and even people with lower end computers would be able to handle it as long as their graphics were set appropriately. I wouldn't use this as a global reference.. but if someone happens to have a lower end computer to test this out on, I'd greatly appreciate seeing your findings!
@unclesatan: Go
Thought buff stacks were capped at 255? What are these buffs doing and how are you applying them?
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Buff Stacks are capped at 65535 in the data editor, and there's nothing that I've seen that shows stacks maxing at 255. Each buff stack adds HP, armor, HP regen and heroic damage, the other buff adds MP, MP regen. I'm applying them through galaxyscript.
UnitAddBehavior(u, "STR", 65000); / last number being stack count
UnitAddBehavior(u, "INT", 65000);
Like that.
@unclesatan: Go
I have a low end computer we could probably test this with, post the map and I'll get back to you when I have time to post results.
I run SC2 in the lowest settings with 2Gb DDR3, I'm sure my results would be different.
You don't have to, but if you end up with some free time let me know what you find out! I'm currently planning on using less than 400 buffs at a time (14 players worth of stats), if I HAVE to I will optimize that further, but for now we'll see how it runs.
It appears to run no differently when applied to my map with large amounts of large triggers, even though this is a blank map. The only difference I noticed was that at 60,000 stacks I got about 4 more FPS.
My computer will freeze for a long time when adding large amounts of buff stacks at once (2500+) but strangely enough when the unit supposedly has 18000 buff stacks, my computer (after freezing) will continue to run at a decent FPS.
Now here's the map. What this does is slowly increase the stacks, do as Zolden said and bring up the FPS bar and see how many stacks you can acquire without it going below 60. Make sure you press the menu button before you FPS drops too low, it might be hard to get out of. My computer can last all the way until max stacks but I know how easy it is to lock up a slower computer.
This have been an issue for me since SC2 beta. (your test map freeze my low end pc around 13k stack)
If you add the behaviors with triggers, just use multiple behaviors with different scales. Like add +1 damage buff per damage modulo 10 and add +10 damage buff per damage/10 (of course use integers). Also if you have a maximum limit you can do a single behavior for it...
Just check my Nexus Squadron Strike map, its full of behaviors like that and its not lagging even at late game....
Awesome to hear, I'll update first post. I sortof do that in a different way, I have a trigger that dynamically collapses and expands buffs when they reach 10, which reduces the amount of total buff stacks I have by alot. If there is maximum players with the maximum amount of buffs they can have (very small chance of that happening), it still doesn't breach 400 buff stacks at any point.
Perchance could I ask you at the amount of stack your framerate started dropping from 60 fps? I want to make sure it isn't some low number like 500.
I'll definitely take a look at your map too, thank you!
well my fps is hardly over 70... What you should ask people that when get their fps halved first....
But it doesnt really matter. The work around that I use is pretty effective and you can always make it more effective by using mod 2 instead of 10... (though than you need to make much more behaviors)
@unclesatan: Go
Hmm, I'm quite sure that stuff like MP and HP regen greatly affects the lag.
Can you test with behaviors not having these modifications?
What you mean by heroic damage?
Have you tried adding the buff stacks over time since doing anything excessive in a single instance can cause issues. The game used to crash if you added a ton of buff stacks using the Apply Behavior effect at once but if you added them over time in more reasonable numbers per 0.016 secs it would still work. Also cap used to be 255, I remember that the one patch upped the limit.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Well, I need to know what amount of buffs makes framerate drop at all. Perhaps 200 buffs wouldn't make your fps drop by more than 3, but 500 would make it drop to 59. I need to know when it drops to 59 so that I know the most buffs I can use.
I've made good use of a workaround, it pushes 200 buff stacks at a time, which is normal for any game (especially tower defenses with multiple players) so I should be fine.
I can make a separate test map for that, I can also make one with different modifications
I mean the damage modifier. You can cause your unit to deal more damage to certain armor types (in my case, heroic). Also, the test map I posted sortof slowly adds stacks, once it starts adding 500 at once it gets stuttery you're right
Try rounding that number to the nearest power of 2 so between 256 and 512 as a rough guess.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg