Failed to Load Assets should automatically retry


sometimes Assets will fail to load I understand that but not giving us any way to detect and fix that is horrible

as you can see it is very immersion breaking and game breaking when they do fail to load

which is why these should automatically retry instead just leaving it there and not load, I am sure that we have enough resources and bandwidth for that with our current modern hardware

7 Likes

Although I agree with you, I believe that there should be a max retries cap if it done automatically to prevent useless requests as if it fails too many times it just means that the server is unavailable or that there is a problem and retrying won’t work.

I agree with the idea, however as NinjaFurfante07 said there should definitely be a cap on retries.

I know lots of people use 0 as a placeholder “asset” for things that can be dynamic (boomboxes, user customisable pictures, etc), and assets can be deleted/removed which means they outright won’t load at all.

I think if this was going to be implemented it should have a LOT of optimisations to decide on what to retry with (such as checking if the asset actually exists still, which would fix both the 0 placeholder and content deleted assets) as well as a much smarter queue system (like weighing priority by amount of times its been requested/how many times it appears in a game, and order of requests)

Feature Requests should be focusing on the problem instead of the solution- in this case the issue is with failed assets not loading for a prolonged period of time, so you should write your topic focusing on that!

As for the ability to detecting and fixing scenarios when this happens, you can utilize ContentProvider and CollectionService to recursively try to reload failed assets.

local ContentProvider: ContentProvider = game:GetService("ContentProvider")
local CollectionService: CollectionService = game:GetService("CollectionService")

local PreloadInstances: {Instance} = CollectionService:GetTagged("PreloadInstance")

local function Callback(Id: string, Status: Enum.AssetFetchStatus): ()
	if Status == Enum.AssetFetchStatus.Failure then
		task.delay(3, ContentProvider.PreloadAsync, ContentProvider, {Id}, Callback)
	end
end

ContentProvider:PreloadAsync(PreloadInstances, Callback)

Support; this has been a huge pain of mine for a very long time. It’s frustrating that we have practically no control over failed assets.

This actually used to be a thing in the past, until Roblox removed it.

A very long time ago assets used to automatically retry a few times, skipping the asset if it failed too many times in a row, but sometime around January 2017 Roblox changed it so that they can’t ever retry, after failing just once, even if you use PreloadAsync.

I don’t exactly have the best internet. I don’t know how many times I’ve noticed that some asset(s) failed to download on my client, forcing me to have to leave the place and completely restart Roblox, as that’s the only way to “retry” a failed asset.

Also, over the last few years Roblox seems to have been removing some of the automatic “failed” error messages in the dev console, so sometimes I won’t even realize that an asset failed to load. The message only appears for unions, meshes, and audio now. Perhaps this is to make locating script errors less confusing for the average user, but it’s kind of annoying how I’m not told at all if an image fails to load anymore.

Sometimes I worry about using too many cloud assets in my place, just because there’s a higher chance that something could fail to load. Large, detailed environments with hundreds or even thousands of assets always worry me.

2 Likes

You can’t retry failed assets at all. If it fails once then any future attempts to preload it will always fail.

Retrying asset loading
Actually @xyrafrost, this may surprise you, but there is an undocumented way to retry assets that have failed. The reason why trying to load an asset again will fail is because the URL is cached in Roblox’s cache.

For simplicity, rbxassetid://[id] actually just expands to: https://assetdelivery.roblox.com/v1/asset?id=[id] internally.
If you were to put something after it, say, rbxassetid://[id]&retry=1, then it is a different URL, now being https://assetdelivery.roblox.com/v1/asset?id=[id]&retry=1, which is not cached by the client.

So, therefore, you can automate this with a script. If you detect that an asset has failed to load, you can retry with rbxassetid://[id]&retry=1, rbxassetid://[id]&retry=2, rbxassetid://[id]&retry=3, etc. Like others were saying, if you do decide to go this route, I’d suggest putting a limit on how many times it will retry. If you try 10 times to load the asset and it fails to load, then it’s safe to assume that even if you try a million more times, it still won’t load. Use this knowledge wisely and try not to misuse it like this. :wink:

Here, I unplugged my Ethernet for about 40 seconds, tried to load rbxassetid://144080495, and it failed (obviously). I plugged the Ethernet cable back in and retried with rbxassetid://144080495&chepsk9washere=1 (oops, accidentally misspelled cheapsk9, haha), and you can see the Request URL in memory (I scanned Roblox Studio’s memory for chepsk9washere=1 for demonstration purposes only.)

image

Detecting asset loading failures
As for @RuizuKun_Dev, I saw your other thread (Give us a way to tell when an asset failed to load) saying it was impossible to detect when assets couldn’t load. This isn’t true; you can check by ContentProvider:PreloadAsync(contentIdList, callbackFunction) if it hasn’t loaded using a callback function. Since normal asset IDs won’t retry reloading as I’ve mentioned earlier, if you try to preload it after it has failed, it will also return a failure status. Remember earlier when I unplugged my Ethernet cable, and tried to load that one asset? Well, I tried loading it again with ContentProvider in the command bar, with print as the callback function, and sure enough, Enum.AssetFetchStatus.Failure.

5 Likes

are you sure this works in game? and can you provide a minimal code sample or place file for that?

And do you know how i could change the Failed Id back to the normal Id?

Interesting, but that also sounds pretty tedious… I’d probably have to keep track of every single instance in the place that uses the content URL I’m trying to preload, and replace all of them if it fails. It’d be a lot simpler if it could just automatically retry.