Jump to content

Scripts and low fps


2kristof2

Recommended Posts

Posted

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)

Posted

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.

  • Moderators
Posted

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)

Posted
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.

  • Moderators
Posted

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)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...