Page MenuHomeFeedback Tracker

Vehicle clock scripts running on dedicated server
Closed, ResolvedPublic

Description

On Vans/SUV
Executed scripts: \A3\soft_f_gamma\SUV_01\scripts\clock.sqf,

The loop is also running on the dedicated server
So with 20 SUV/Vans you have 20 loops like that on the server for nothing

while {alive _this} do
{
_clock_hour10 = floor ((date select 3)/10);
_textureName = format [ "\A3\soft_f\Data\num%1_ca.paa", _clock_hour10];
_textureName = format [_textureName];
_this setObjectTexture [1, _textureName];

_clock_hour = ((date select 3)-(_clock_hour10*10));
_textureName = format [ "\A3\soft_f\Data\num%1_ca.paa", _clock_hour];
_this setObjectTexture [2, _textureName];

_clock_minute10 = floor ((date select 4)/10);
_textureName = format [ "\A3\soft_f\Data\num%1_ca.paa", _clock_minute10];
_this setObjectTexture [3, _textureName];

_clock_minute = ((date select 4)-(_clock_minute10*10));
_textureName = format [ "\A3\soft_f\Data\num%1_ca.paa", _clock_minute];
_this setObjectTexture [4, _textureName];

sleep 5;
};

Maybe not a big deal but w/e

Details

Legacy ID
2935363740
Severity
Feature
Resolution
Fixed
Reproducibility
Always
Category
Performance

Event Timeline

Manzarek set Category to Performance.Mar 6 2015, 3:42 PM
Manzarek set Reproducibility to Always.
Manzarek set Severity to Feature.
Manzarek set Resolution to Fixed.
Manzarek set Legacy ID to 2935363740.May 8 2016, 11:36 AM

neither you need this on HC

if (isServer) exitWith {};

Cmon you can do it.

This is a low-hanging fruit for any BIS devs working on performance optimisation.

As Killzone_Kid and Manzarek are stating, this need not be run on the server machine, looks like early SP code anyways.

if (isServer) exitWith {};
if (!hasInterface) exitWith{};

Also, a variable to terminate the loop would be nice too.

if (_this getVariable "BIS_disableCarClock") exitWith {};

Reason being if I have a scenario with a dozen civilian ambient vehicles, I doubt many scenario designers want a dozen threads running just for the car clocks.

It is good to have it enabled by default, but allow more advanced scenario designers to terminate the script when there is no intention of having players see the clocks, in the interest of efficiency and performance.

Also could use a little optimisation itself. The 'date' function is being called 4 times in quick succession. Could call it once and store as variable for the next three uses. Small fry but its an irritating little script which shows up in diag_activeSQFScripts :) In a scenario with many civilian vehicles, it is the most prolific script, in my case comprising the bulk of the diag_activeSQFScripts array.

_date = date;

Thanks a lot for intel, this has been addressed with clock scripts removal for a different solution, there should be no more scripts running for clocks. Could You, please, confirm that on dev / RC branch and close the issue?

excellent pettka, have a great day.

sent you a forum PM regarding another similar low-hanging fruit.