Forum

> > CS2D > Scripts > LUA scripts do lag?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch LUA scripts do lag?

13 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt LUA scripts do lag?

maPmaKer
User Off Offline

Zitieren
Hello,

I've been asking this to myself from the first time I have learnt to use LUA scripts on servers and now I am asking you the same.

Is it possible that, if a LUA scipt is composed from more LUA scripts, to overload the server and create lag?

Thank you,
maPmaKer

alt Re: LUA scripts do lag?

SQ
Moderator Off Offline

Zitieren
It depends on how many "parse" commands lua is executing.
So yeah, Lua scripts can, indeed, slow down the server and cause the lag.
1× editiert, zuletzt 14.07.11 13:23:06

alt Re: LUA scripts do lag?

Alistaire
User Off Offline

Zitieren
If they trigger eachother constantly it should lag like hell.
I once started a server with bots, and used a script which showed a custom shoot image when a bot attacked. Well.. that was what it has to do. It showed an image every time the bot moved, so my fps went down to 1 and the server crashed.

alt Re: LUA scripts do lag?

DannyDeth
User Off Offline

Zitieren
No, Lua is not that* system-heavy, but on a low-powered server overly large scripts will start to create minor lags ( however, you must note that the same script will probably cause a stack-overflow error before it lags your server ). Also, the script would need to be doing a lot of heavy workouts - like sorting long lists, scanning/comparing multiple tables together, etc. I used Lua the other day to write a database, and it didn't lag at all. ( it was only like 200 lines long, but it was sorting lists that had several thousand entires at a time ( this was temporary, as I was waiting for MySQL to download and it said it had like 9 hours to go [ I know, really slow internet connection... ] ).

alt Re: LUA scripts do lag?

DannyDeth
User Off Offline

Zitieren
@2Fast4You:
It is probably network stress ( because of all the image() function calls and things like that ), no decent computer should lag running Lua scripts.

alt Re: LUA scripts do lag?

maPmaKer
User Off Offline

Zitieren
user DannyDeth hat geschrieben
@map:
How many scripts are you running?


On my town server , which has the biggest script, are running 5 LUA scripts combined into one.

alt Re: LUA scripts do lag?

DannyDeth
User Off Offline

Zitieren
What sort of scripts are they? Could I find them in the File Archive? It might not be lag caused by the Lua scripts, but the traffic created by the Lua scripts which is in turn creating lag.

alt Re: LUA scripts do lag?

maPmaKer
User Off Offline

Zitieren
user DannyDeth hat geschrieben
What sort of scripts are they? Could I find them in the File Archive? It might not be lag caused by the Lua scripts, but the traffic created by the Lua scripts which is in turn creating lag.


1. Money script
2. Weapon stripping gate
3. Admin color
4. Automatic round restarter
5. Advertising LUA

You can find them everywhere. But I was just asking. My VPS isn't so good too, so that might be the cause.

alt Re: LUA scripts do lag?

DC
Admin Off Offline

Zitieren
it really depends on the script(s), the server (available CPU power/RAM), the network condition and the number of players on the server.

script which are executed frequently (like each frame) can quickly slow down the game and lead to lags. especially if they are using commands which cause additional network traffic.
same for very complex scripts.

each command which shows something on the clientside (like all image and text commands) cause additional network traffic!

good scripts are designed in a way that they don't cause lag.
some scripters don't really care about that and write bad scripts which can easily cause lag. be aware of that.

alt Re: LUA scripts do lag?

Apache uwu
User Off Offline

Zitieren
Yeah there are 2 types of lag, server and client sided lag.


Server Sided:
>You have excessive commands on parse, or hook_always()
>You load a lot of files or output a lot of files

Client Sided:
>Lots of buildings
>Lots of images
>Lots of NPCs
>Lots of chat messages

Just make sure your lua scripts run normally and it doesn't past like 3000 lines. lool
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht