Jump to content

Recommended Posts

Hello there!
For one of my multiplayer mission, I'd like to have blinking lights from different lightsources (static ones, no vehicles).
I'm planning to have a lot of them (50+), and some may be blinking fast (up to 20x / second).

I totally don't care about the lights synchronization for the players. This is mainly to create a mood. So a client-side effect command would be perfect.

Until now, I was using something like this to make a lamp blink:

_lamp setHit ["light_1_hitpoint", 0.97];
sleep 0.1;
_lamp setHit ["light_1_hitpoint", 0];

Problem is, this command is broadcasted over the network. Multiply this by 50 lamps, a mission of ~20 players, and here's my question : will this ruin data exchanges between the server & the players ?
I'm afraid of building something that works for me when testing, but is unplayable for my community due to performance issues.

Should I expect a huge drop on FPS / Synchronization, & if yes, is there an alternative command with local effect only, to ensure a minimum performance penalty ?


I searched in the wiki, but everything that was resolving around setting damage is broadcasted over the network.
Thanks a lot for your ideas !

Share this post


Link to post
Share on other sites

I realise you say static and non vehicle but what are you lights exactly? Could you get away with using a local light point?

_light = "#lightpoint" createVehicleLocal ( (player getPos [ 10, getDir player]) vectorAdd[ 0, 0, 5 ] ); 
_light setLightBrightness 1.0; 
_light setLightAmbient [1.0, 1.0, 1.0]; 
_light setLightColor [1.0, 1.0, 1.0];

h = _light spawn {
	params[ "_light" ];
	
	while { !isNull _light } do {
		_light setLightAmbient [0, 0, 0]; 
		_light setLightColor [0, 0, 0];
		uiSleep 0.025;
		_light setLightAmbient [1.0, 1.0, 1.0]; 
		_light setLightColor [1.0, 1.0, 1.0];
		uiSleep 0.025;
	};
};

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

×