Reproduction Steps
For my game, Tornado Alley Ultimate, I am experiencing ‘Script timeout’ errors that are occurring when I am attempting to weld larger maps. This is completely breaking the game, to the point in which I’ve had to shut it down temporarily last night. I can reproduce this issue commonly by trying to play on larger maps in my game (that have more parts to weld), which will result in this error being thrown. This has never happened before until yesterday, right around the time the recent 485 update was released. Here is the game I am having the issues on: Tornado Alley Ultimate - Roblox
Expected Behavior
The maps used to weld without any issue when they were loaded in. Even the larger maps with 2000+ parts. No ‘Script timeout’ error would be thrown.
Actual Behavior
Ever since the 485 update launched yesterday, these larger maps are taking longer to be inserted into Workspace after being cloned. Then, when attempting to weld the model (map), it will commonly throw a Script timeout error, as shown here:
Issue Area: Engine Issue Type: Other Impact: High Frequency: Constantly Date First Experienced: 2021-07-07 00:07:00 (-04:00) Date Last Experienced: 2021-07-08 00:07:00 (-04:00) A private message is associated with this bug report
While that seems to be the case now, it had no problem loading these larger maps up until yesterday. It has worked flawlessly since November 2019. I’m not sure why, but it almost seems like the script exhausts itself quicker. I haven’t changed any code, but yesterday right when the 485 update released, all of my game’s servers began breaking due to this issue.
Hm, this sounds like a bizzare abnormality and definately something that needs to be looked into ASAP, considering your fairly large game that is being stalled out until the bug is fixed. Good luck!
Essentially with the new Collision Pipeline, welding objects requires a new sub-structure to be created in the engine. Its super optimized if you make all of your welds at once, however calling Workspace::joinToOutsiders one part at a time on a massive level will cause a lot of redundant work that can be resolved by simply collecting the parts and then passing them in a single table into Workspace::joinToOutsiders once.
EDIT: Hmm, based on the code of joinToOutsiders this may not be enough. Investigating.
@1billybob1 I’ve disabled the linked feature ONLY for your specific placeID: 2313058949
I think if you re-enable the game it should work. I think your game is an edge case of Workspace::joinToOutsiders uses that severely regressed after a major Collision Detection performance update (read the linked thread for info),
I did a thorough lookup of other places uses JoinToOutsiders to make sure your case is unique. This game seems to be the only one affected. We are going to attempt to find a fix for this, but in the mean time we’ve disabled the feature only for your PlaceID.
Hi, I need your help. Super Doomspire is having this script timeout issue, my game which heavily uses surface-based welds. Lots of servers have been breaking all week, I’d appreciate it if you could turn it off for my game too, thanks! Super Doomspire - Roblox
There’s no coincidence that I’m getting exactly the same issue in my game since like the same time period, first half of July, and until now. My game is largely relying on the welding scripts that are welding together parts of the models. And just exactly in highly described case, since about 5-10 July the welding script started breaking all of sudden, constantly being cut with the very same “Script timeout: exhausted allowed execution time” error. With this happening, literally the whole game gets ruined, since, once again, literally everything is relying on these welding scripts that are now no longer working for such a random reason that appeared out of nowhere. I had to close the game indefinitely since I failed to find the solution.
I thought I would post the solution that staff members ContextLost and Khanovich came up with for my issue. So far, after implementing this new method, I have not had any script timeout or exhaustion errors, and it’s been about a week since ACD was re-enabled for my game. Absolutely zero reports of a script timeout error since this new method was implemented. While you may have to adjust this method to work to your game, I hope this will be useful for those having similar issues.
In my instance, I have very large maps that require fragmenting, welding, and then loading.
Here is how I go about doing this now (again - this method has some steps specifically needed for my game. Up to you to decide what steps are unnecessary).
I place the selected map I want to load into a WorldModel in ServerStorage to begin prep
Gather all unanchored parts, remember them in a table, and temporarily anchor them
Weld all parts in the map
Unanchor the parts that were initially unanchored
Finally, move the map to workspace
I am going to mark this method as a solution as it fixed my issue in particular.
According to staff, they are thinking of larger solutions so steps like these are not necessary - though this is an efficient workaround for now, at least in my instance. I hope this helps. Thanks again to ContextLost and Khanovich for their help. Tremendously appreciated.
I’m not sure if it is related, but I am also having script timeouts while trying to dynamically build a level.
I need a place to run long-running Lua code. This is not the first time I’ve encountered this. Is there a good reason to have such a low timeout? Maybe the timeout can be a property of the Script that I can set if I know it can be heavy.