Script Timeout Error

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

3 Likes

Is it possible that the size of the map might be too overwhelming for the server to handle, thus throwing an exhaustion error?

Thanks for your response,

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.

2 Likes

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!

2 Likes

Are you welding the parts once they are in Workspace? Are you able to Weld Them before they enter the Workspace?

EDIT: Just saw the private message with the welding code.

1 Like

Is there any while true loops, repeat loops, or for loops? if so can you show me?

I replied with a prospective fix to @1billybob1 in the private message.

I suspect the issue is calling Workspace::joinToOutsiders recursively on every part in a massive place with Upcoming Optimization to Collision Detection System - Beta Test on Mac Clients soon enabled (which it became enabled on Servers yesterday).

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.

2 Likes

@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.

2 Likes

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

1 Like

@Khanovich

Hey, EAT or DIE is also affected by this change and causing script timeouts upon loading in maps.

https://www.roblox.com/games/1080206711/EAT-or-DIE

I’ve disabled it for this place as well. Keep in mind this is a temporary solution as we figure out a workaround/API update.

2 Likes

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.

Hi everyone,

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 get these errors for no reason as well, here’s an example:

this is the stone dagger script, I get these errors by calling on raycastparams.new()
image
Whenever this happens, studio hangs for a good amount of time, usually a minute.
It randomly happens, but its annoying when it does

I also get this:
image

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.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.