Large-ish lua scripts cause significant FPS drops

Status
Not open for further replies.

Puppyfaic

Member
In advance, I apologize if this isn't the place to put this. I wasn't really sure whether this belonged in Help or SRB2 Discussion, but I think this is more appropriate since I'm seeking help or some sort of answer?

In overly large or detailed maps, such as THZ2, DSZ1, ECZ2, etc., and with large lua scripts such as Rosy, the game's FPS drops to unplayable levels. This didn't happen prior to recent versions(I believe 2.1.14 and earlier was fine?), and I'm wondering if something might have changed or if there is some sort of fix?
 
Last edited:
Are you sure your game is up-to-date? Some people had FPS problems in 2.1.15, but that has been fixed.
 
FPS Drop example: Fsonic in CEZ2

Game not modified:
Not_modifyed.gif

Game with Fsonic.wad added:
added_Fsonic.gif


This is why I don't host with character mods anymore. :/
 
Last edited:
Usually when games tend to lag via lua I've been told its through the constant use of Hooks like "ThinkFrame", but at the same time, not everyone's PC is actually capable of running 35 FPS of SRB2. :/
 
I don't remember the details much, but last I remember even a blank Lua script kind of slows the game down a bit in some levels such as AGZ? Of course I could be misremembering.
 
Loading a Lua script initiates the script interface, which IIRC that's what slows the game down a bit for even blank scripts.
 
Seems weird that even a blank script would slow the game down, since there's nothing for the interface to process.
 
But the interface has to check that there are no hooks, and it does this for each mobj ;P

Isn't there a merge request on the SRB2 Github that tries to solve this problem? My life's been too much of a nightmare to check it out.
 
There is a merge request on Github that optimizes Lua, the one that LJ Sonic made, right?
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top