Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kenneth Law on Apr 11, 2019, 04:33 AM

Title: FPS problem related to function ScriptProcess
Post by: Kenneth Law on Apr 11, 2019, 04:33 AM
I used ScriptProcess in client side for 3D GUI label display but there seemed to be a serious frame issue after this was added.
I wrote some codes for transforming the 3D position of the world into screen position and moving the labels to the position accordingly into ScriptProcess and found that this function which performs callback per frame would lead to a frame skipping, especially when there were too many lines included in the event.
This has been tested for lots of times by making a comparison between the two situations in which I reserved and removed the ScriptProcess.
An evident distinction in frame rate was proved existing between them.
So is there anything wrong with the codes in client script being processed each frame since the frame rate looks unstable and low while they do so?
Title: Re: FPS problem related to function ScriptProcess
Post by: DizzasTeR on Apr 11, 2019, 11:16 AM
You most likely did a mistake of instantiating instances of gui elements rather than just modifying their characteristics, I have a alot, and I mean alot of things under script process and if done right, everything is smooth and nice
Title: Re: FPS problem related to function ScriptProcess
Post by: Xmair on Apr 20, 2019, 07:38 AM
Possibly adding to this topic, such frame skips sometimes occur when there is an error and that error is being written to your debug log each frame, causing the frame skips.