SRB2 Message Board  

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

Reply
 
Thread Tools Search this Thread
Old 08-15-2016   #1
Rapidgame7
bzzzzzzzzzzzzzzzzzzzzz
 
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
Default

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
fickleheart
ms reflec beat stan
 
fickleheart's Avatar
Default

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.
__________________
Quote:
Originally Posted by Arf View Post
Stop trying to make slopes, guys.
fickleheart is offline   Reply With Quote
Old 4 Weeks Ago   #4
Rapidgame7
bzzzzzzzzzzzzzzzzzzzzz
 
Rapidgame7's Avatar
Default

(Replying to now deleted reply authored by carlrev)
Are you aware this is a 4 year old thread?
__________________

NOTICE: Game must be restarted to record statistics.

Last edited by Rapidgame7; 4 Weeks Ago at 11:30 PM. Reason: Nice deleted message
Rapidgame7 is offline   Reply With Quote
Old 4 Weeks Ago   #5
carlrev
The living revolution
 
carlrev's Avatar
Default

As soon as I realized that. I felt so stupid.
__________________
Long live the revolution!
carlrev is offline   Reply With Quote
Old 4 Weeks Ago   #6
Rafael44642
 
Rafael44642's Avatar
Default

Quote:
Originally Posted by carlrev View Post
As soon as I realized that. I felt so stupid.
Yeah, me too lol. It's like, almost nobody looks at the dates.
Rafael44642 is offline   Reply With Quote
Reply

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 10:51 AM.


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