I noted recently that stacking a lot of behaviors will cause game lag especially to lower spec computers. are there any better ways of altering basic stats of specific units rather than using behaviors?
I noted recently that stacking a lot of behaviors will cause game lag especially to lower spec computers. are there any better ways of altering basic stats of specific units rather than using behaviors?
Seeing as nobody has ever observed lag caused by behaviors before, there's absolutely no logical way to explain *why* behaviors would cause lag, and any computer so slow that it couldn't handle something as basic as a bunch of behaviors wouldn't even be able to load SC2, I think the burden of proof is on you.
Easy way to tell. Make a new empty map, apply as many behaviors to a single marine as the system will let you, and if it lags your computer to shit post it here and I'll eat my words. I'm not going to hold my breath.
By the way if you're wondering why I'm being so derisive, it's because you clearly are having a problem with one of your projects, but instead of just coming out and saying "Hey guys, I don't know what's causing frame rate issues on my map, here's what I'm doing" you've come out and said something positively silly as if it were fact. Now the problem is these forums are perused by people of all skill levels, and less knowledgeable people are going to read your authoritative statement and believe it, and now whenever somebody asks how to do something and we give a solution using a behavior, the response is going to be "But I can't use behaviors, they cause lag!"
Well I use many behaviors in my map. If a unit is in a specific region it will add 1dmg and 1 hp, 2 behaviors. In order to test victory triggers I changed it so it adds 999 of each to my units.
I placed 10-30 units in the area. as soon as the behaviors were added the game began to lag a lot. When I killed these units the lag disappeared.
@gorang: Go
By the way if you're wondering why I'm being so derisive, it's because you clearly are having a problem with one of your projects, but instead of just coming out and saying "Hey guys, I don't know what's causing frame rate issues on my map, here's what I'm doing" you've come out and said something positively silly as if it were fact. Now the problem is these forums are perused by people of all skill levels, and less knowledgeable people are going to read your authoritative statement and believe it, and now whenever somebody asks how to do something and we give a solution using a behavior, the response is going to be "But I can't use behaviors, they cause lag!"
Why would I do that when i've already found out where the lag comes from.
Well I use many behaviors in my map. If a unit is in a specific region it will add 1dmg and 1 hp, 2 behaviors. In order to test victory triggers I changed it so it adds 999 of each to my units.
I placed 10-30 units in the area. as soon as the behaviors were added the game began to lag a lot. When I killed these units the lag disappeared.
The lag was more than noticeable.
Why 2 behaviors? you can do the same with one.
From what I saw of your triggers... you better start looking there.
Deactivate ALL other triggers and tell us if it still lags... unless you have everything in 2 or 3 triggers with each 1000 lines
Umm if the behaviors just give stats they shouldnt cause any lagg. Inless they are set to be periodic or something stupid they shouldnt be doing.
How are you applying 999 of the behaviors. Are you using triggers? Is the trigger maybe Looping too much when applying the behaviors?
Technically you have 999 x 2 x 30 behaviors. That could possibly be enough to bog the game down. Wouldnt know since I havent tried. Does it still lag if you set it to only apply 100 of each behavior?
Does it lagg if you have lets units while you do this.
Sounds like you need to do a bit more debugging with the way you are implementing your behaviors.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
1) A lot of behavior stacks impact performance negatively.
2) Adding more stacks becomes severely slower the more stacks there are already.
However, the second issue is much much more noticable than the first one.
I tried to a point where I had 16 units with 10000 stacks each. Nothing else going on.
At that point the game ran with about 5 FPS constantly.
Adding new stacks (even small amounts) created a short evil performance drop (just like performance heavy code).
Well, since this is an insane amount of behavior stacks I'll allow you to have some milk to gulp down your words :P
It's basically the same as complaining about the game lagging because there are 10000 units on the field at once.
I'll attach the map in case you wanna look for yourself.
Nah, I need about 1500 stacks per unit to see the frame rate counter slowly drop and about 4500-5000 to notice the lag visually. You totally need OVER 9000 TO DEAL TERRIBLE TERRIBLE DAMAGE!
Did these tests in Window mode, so that sucks some performance too.
That's pretty limited, i says around 20 behavior = 1 unit put on the field. You need to test more on whether unit is actually rendered reduce some lag or not...
One thing to keep in mind that can cause major slowdowns is trying to stack behaviors that are already at their limits. I know this sounds weird, but many times now I've noticed slowdowns in my recent project when buffs were added. I thought nothing of it until I tried making an ability that assigned a behavior to a unit with each attack (the behavior only had a maximum stack count of 1). It actually froze the game. I tried about ten more times and it did the same thing...had to ctrl + alt + delete my way out of it each time.
The solution (which fixed any and all delays and freezes) was to add a validator (which I normally do but forgot that once) which prevents the behaviour from being applied on units that already had it.
There definitely seems to be some problems when behaviours try to go out of their limit boundary. Are you sure that isn't your issue?
I noted recently that stacking a lot of behaviors will cause game lag especially to lower spec computers. are there any better ways of altering basic stats of specific units rather than using behaviors?
Yeah, that's just not true.
Any way to back that up?
@gorang: Go
Seeing as nobody has ever observed lag caused by behaviors before, there's absolutely no logical way to explain *why* behaviors would cause lag, and any computer so slow that it couldn't handle something as basic as a bunch of behaviors wouldn't even be able to load SC2, I think the burden of proof is on you.
Easy way to tell. Make a new empty map, apply as many behaviors to a single marine as the system will let you, and if it lags your computer to shit post it here and I'll eat my words. I'm not going to hold my breath.
By the way if you're wondering why I'm being so derisive, it's because you clearly are having a problem with one of your projects, but instead of just coming out and saying "Hey guys, I don't know what's causing frame rate issues on my map, here's what I'm doing" you've come out and said something positively silly as if it were fact. Now the problem is these forums are perused by people of all skill levels, and less knowledgeable people are going to read your authoritative statement and believe it, and now whenever somebody asks how to do something and we give a solution using a behavior, the response is going to be "But I can't use behaviors, they cause lag!"
Well I use many behaviors in my map. If a unit is in a specific region it will add 1dmg and 1 hp, 2 behaviors. In order to test victory triggers I changed it so it adds 999 of each to my units.
I placed 10-30 units in the area. as soon as the behaviors were added the game began to lag a lot. When I killed these units the lag disappeared.
The lag was more than noticeable.
Why would I do that when i've already found out where the lag comes from.
Why 2 behaviors? you can do the same with one.
From what I saw of your triggers... you better start looking there.
Deactivate ALL other triggers and tell us if it still lags... unless you have everything in 2 or 3 triggers with each 1000 lines
Umm if the behaviors just give stats they shouldnt cause any lagg. Inless they are set to be periodic or something stupid they shouldnt be doing.
How are you applying 999 of the behaviors. Are you using triggers? Is the trigger maybe Looping too much when applying the behaviors?
Technically you have 999 x 2 x 30 behaviors. That could possibly be enough to bog the game down. Wouldnt know since I havent tried. Does it still lag if you set it to only apply 100 of each behavior?
Does it lagg if you have lets units while you do this.
Sounds like you need to do a bit more debugging with the way you are implementing your behaviors.
Then start eating now.
I ran a few quick tests:
1) A lot of behavior stacks impact performance negatively.
2) Adding more stacks becomes severely slower the more stacks there are already.
However, the second issue is much much more noticable than the first one.
I tried to a point where I had 16 units with 10000 stacks each. Nothing else going on.
At that point the game ran with about 5 FPS constantly.
Adding new stacks (even small amounts) created a short evil performance drop (just like performance heavy code).
Well, since this is an insane amount of behavior stacks I'll allow you to have some milk to gulp down your words :P
It's basically the same as complaining about the game lagging because there are 10000 units on the field at once.
I'll attach the map in case you wanna look for yourself.
Maybe so he can add damage and hp seperately? ^.^
@Everyone:
Why would it be so strange for behaviors to slow down the game in the first place?
They're more than just an integer in the background.
@s3rius: Go
That's over 9000, you got to get realistic, how's the results with around 1000 behavior ?
@progammer: Go
Nah, I need about 1500 stacks per unit to see the frame rate counter slowly drop and about 4500-5000 to notice the lag visually. You totally need OVER 9000 TO DEAL TERRIBLE TERRIBLE DAMAGE!
Did these tests in Window mode, so that sucks some performance too.
That's pretty limited, i says around 20 behavior = 1 unit put on the field. You need to test more on whether unit is actually rendered reduce some lag or not...
Always those limitation D:
One thing to keep in mind that can cause major slowdowns is trying to stack behaviors that are already at their limits. I know this sounds weird, but many times now I've noticed slowdowns in my recent project when buffs were added. I thought nothing of it until I tried making an ability that assigned a behavior to a unit with each attack (the behavior only had a maximum stack count of 1). It actually froze the game. I tried about ten more times and it did the same thing...had to ctrl + alt + delete my way out of it each time.
The solution (which fixed any and all delays and freezes) was to add a validator (which I normally do but forgot that once) which prevents the behaviour from being applied on units that already had it.
There definitely seems to be some problems when behaviours try to go out of their limit boundary. Are you sure that isn't your issue?