Jump to content

Scripts and low fps


2kristof2

Recommended Posts

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
  • Moderators

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

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

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