02-27-2010, 11:00 AM
(This post was last modified: 02-27-2010, 11:04 AM by Pulverizer.)
Use the #monitor 15 command as admin to see if the cause is low server FPS or maxed bandwidth. Bandwidth settings can be modified in flashpoint.cfg
Trigger condition is evaluated every 0.5 seconds in OFP, but it's still a good practice to not have super long conditions (like forEach'ing large arrays of units) because they block all other execution. For example, try this condition for a trigger:
a=[];while"count a<9999"do{a=a+[random(1000)]}; hint format["%1",{_x>500}count a]; time%1<.5
It will make the game freeze for a split second every time the condition is evaluated. Ie, iterating loops is not done in parallel of other code, but by blocking all other execution. If you did a scripted version of this, it would not cause any noticeable stutter but still achieve the exactly same thing:
Trigger condition is evaluated every 0.5 seconds in OFP, but it's still a good practice to not have super long conditions (like forEach'ing large arrays of units) because they block all other execution. For example, try this condition for a trigger:
a=[];while"count a<9999"do{a=a+[random(1000)]}; hint format["%1",{_x>500}count a]; time%1<.5
It will make the game freeze for a split second every time the condition is evaluated. Ie, iterating loops is not done in parallel of other code, but by blocking all other execution. If you did a scripted version of this, it would not cause any noticeable stutter but still achieve the exactly same thing:
Code:
#loop
a=[]
#inner
a=a+[random(1000)]
?count a<9999:goto "inner"
hint format["%1",{_x>500}count a]
~.5
goto "loop"