y0014984 / Advanced-Equipment

Advanced Equipment is a Arma 3 mod, that brings equipment to life, like laptops and lamps.
Other
23 stars 9 forks source link

Fix Debug Overlay #245

Open y0014984 opened 1 year ago

y0014984 commented 1 year ago

Because getPowerOutput and getBatteryLevel use the getRemoteVar Function, the Server is called onEveryFrame twice for each AE3 power asset. This needs to be fixed bevore Debug Overlay could be used in an dedicated server environment.

The draw needs to be on each frame, but could use a local variable to display it's content. This local variable could be updated less often, like once per second. This would reduce server load by factor of 20 or more.

Also we need to find a way to use getBatteryLevel and getPowerOutput in a unscheduled environment.

GermanHydrogen commented 1 year ago

There is no way to get remote variables in an unscheduled env, because the data retrieval from the server takes an unpredictable amount of time.

Is the debug mode for dedicated Servers really needed?

y0014984 commented 1 year ago

Is the debug mode for dedicated Servers really needed?

Not really, but if a player in a dedicated multiplayer session turns on the debug overlay by accident, and the server or mission has not forced to disable the debug mode, the client would overkill the server with getRemoteVar connections. So we should take care, that even in dedicated multiplayer sessions our mod would not harm the mission.

GermanHydrogen commented 1 year ago

If we want to allow the debug mode in an production env, then we would also need other optimizations, like only rendering the box if the object is visible for the player unit. So I would advice to disable the debug mode for dedicated server envs for now.

y0014984 commented 1 year ago

So I would advice to disable the debug mode for dedicated server envs for now.

Yes, I already had the idea to do that. The debug mode ist available (Login with other users, faster Laptop start), but not the Debug Overlay. See #246