Some question about server load

i am making a PVE game lately

but it requires a lot of “permanent” loop to evaluate

such as unstoppable "chase player variable "

rumor has it that change variable cost a very little server load , does it?

so i want to know which is a better way to reduce possibility of server crash

rule 1:

variables
{
global: A

}

actions
{
Chase Global Variable At Rate(A, 10000, 1, Destination and Rate);
}

rule 2 :variables
{
global:A

}

actions
{
While(Global.BOSS_skill < 10000);
Global.BOSS_skill += 1;
Wait(1, Ignore Condition);
End;
}

which is better? thanks for answering

Well since we wouldn’t know how your game should work entirely, both attempts you provide shouldn’t weight heavy on server load, especially when they are Global events, for a Player event it may become stresssful for the server if it’s a while loop, since it would loop for every Player that would meet the condition to trigger each time, so unless you won’t go the Player to Player context approach both are fine, still the Chasing Variable way can be even optimized a bit by setting the reevaluation option for it to None, i guess the destination doesn’t need to be tracked over few frames anyway right? Its fixed to 1000 anyways, same for the Rate the rate of change is fixed at 1 right? So as long these won’t change that much either setting reevaluation to None instead of Destination and Rate would reduce the stress a little too.

2 Likes