2kristof2 Posted August 1, 2015 Share Posted August 1, 2015 Hi, I have a question about scripts. I made many scripts like: moving objects, peds (+animations), effects (fire and smoke), texts and more. What should I delete to decrease lags? Which functions cause lags on slow computers? (People have low fps everywhere not only near scripted parts) Link to comment
TheSmart Posted August 1, 2015 Share Posted August 1, 2015 IMO, remove smoke maybe then it will decrease lag Link to comment
GTX Posted August 1, 2015 Share Posted August 1, 2015 Seperate scripts, stop them one by one and you'll find out which one is lagging. Post here the lagging script and we can help you. Link to comment
2kristof2 Posted August 2, 2015 Author Share Posted August 2, 2015 So moving objects, peds, effects, texts etc aren't the reason of the lags but I just failed 1-2 scripts which are lagging? Link to comment
Moderators IIYAMA Posted August 2, 2015 Moderators Share Posted August 2, 2015 Make sure there are 0% errors/warnings in your debugscript. Those are the ones that cause the most lagg in servers. I have sometimes 1 or 2 of those in my server caused by a NaN value, yet I can't prevent those very well. But other servers have 100 of those in 1 min, which is... (and will fill up your server logs) Link to comment
GTX Posted August 2, 2015 Share Posted August 2, 2015 Make sure there are 0% errors/warnings in your debugscript. Those are the ones that cause the most lagg in servers. There are even more worse things that cause lag. Like looping a table (which may have a lot of data) inside a function which is above event onClientRender. Link to comment
Moderators IIYAMA Posted August 2, 2015 Moderators Share Posted August 2, 2015 Yet I think he should first do that. Because to prevent tables that overflow like you mentioned, is mostly by fixing error and warnings so incorrect data will not enter the systems. Error and warnings and fps Error and warnings is lagg that will not be visible by fps, unless it takes longer than the frame time. But players will feel the lagg even if the fps doesn't drop. Error and warnings give a longer frame time. When you have 60 fps and the lua code hasn't finished with in 16,666 ms the fps will drop. (1sec/60fps) Link to comment
2kristof2 Posted August 4, 2015 Author Share Posted August 4, 2015 thanks for the replies. I already fixed the problem. My friend used timer (0) for sound Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now