Jump to content
Sign in to follow this  
commanderx

Lags in Multiplayer because of remoteExec and publicVariable possible?

Recommended Posts

Hi,

 

I experience small lags on our dedicated Server even if I am alone and no AI present.

 

The only thing I`m doing is some scripts with remoteExec (only if something happens and that´s seldom -> 1 action per 30 seconds maybe.) and every second is a variable published via publicVariable from the server.

 

All other missions runs more than fine on this server with no lags.

 

Is this publicVariable so bad? If yes what options do i have instead of this?

I have a countdown and the server publishes how much time remains. Is it maybe a better idea to remoteExec a predefined function on each client?

Share this post


Link to post
Share on other sites

It's not so bad. You should show some code.

Share this post


Link to post
Share on other sites

Certainly, depends on how much data you are sending though. Once per second sounds definitely far too often. Does the countdown really need to be so accurate? Why not just have each client count down on its own, with occasional synchronization from the server?

Share this post


Link to post
Share on other sites

I will show some code when I´m back home.

 

Well,it´s for a Search and Destroy like Mission and the countdown needs to be as accurate as it can be. But maybe it´s better to give a start signal from the server and then every client should count on itself.

Share this post


Link to post
Share on other sites

There's no good way to do an accurate timer without increase in network traffic.

 

Best compromise you can do is local countdown with periodic sync to server time.

 

Have the clients machine count down from a variable and update the variable every ~5 seconds.

 

missionnamespace setvariable ['varname',value,true];

 

is slightly less costly than

 

varname = value;

publicvariable 'varname';

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×