SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Thread Tools Search this Thread
Old 08-15-2016   #1
Rapidgame7's Avatar
Default Can a big Lua script cause problems in a game?

Sorry for the bunch of questions in a row.

I'm making a script and I keep adding features.
I use custom functions to make the file smaller, but as I add more things to the script, the filesize gets larger.

Will this cause any problems in the game because of the size?

NOTICE: Game must be restarted to record statistics.
Rapidgame7 is offline   Reply With Quote
Old 08-16-2016   #2
People's Elbow
Permanently Banned

Sometimes too much lua can cause lag, but usually not. Lua causing lag, at least for me would be from a file 1 GB in size, so you're fine. Just keep bug testing the lua and try keeping track of the changes or addons you make.
People's Elbow is offline   Reply With Quote
Old 08-16-2016   #3
ms reflec beat stan
fickleheart's Avatar

It depends on the script. A Big script could cause problems if your map doesn't have anywhere to go fishing in, and a script that runs a lot of code every tic (or manages a fuckton of data) could get really laggy, particularly if you combine them with a huge map, but the size of the script itself doesn't affect much after the initial parse and load.

Generally, the key to avoiding laggy scripts is to avoid running anything that doesn't have an immediate use, and create caches for data that needs parsed often from static information. Try not to overuse expensive functions like P_TryMove and thinkers.iterate, as well. If you have a crusty old computer around, fire it up and use it for performance testing; ideally your framerate in something like THZ1 with your scripts loaded should be about as good as your framerate in CEZ2 without them, but the hard line of acceptable performance is really up to you.
Originally Posted by Arf View Post
Stop trying to make slopes, guys.
fickleheart is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:48 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.