[Request] Pre-loading streamed assets

(post inspired by Download before game instead of in-game)

The title says it all - I think it would be genuinely beneficial to allow pre-loading of chosen streamed assets. Why? There are two main reasons:

1.) In regards to custom vehicle models, we’ve all been there - you join a server and, while someone’s cool vehicle is loading, they are falling through the floor on your screen. This is particularly an issue for RP servers (especially regarding police officers, as the majority of roleplay servers use custom models and skins for emergency vehicles);

2.) There is some weird form of lag when approaching particularly large streamed MLOs or YMAPs. Judging by the forums there’s a number of people affected by that. What’s that? Oh, you’re asking how would pre-loading solve it? You see, I have tested this issue for a time now, and I can reliably say that the lag occurs only if the streamed asset is NOT cached. I have done (legitimately) more than 20 tries with this so far, and it’s always behaved that way - when it’s not cached, freeze on approach, then even after game restarts it never lags, in before I clear cache to test and the lag occurs again when the asset is not cached… you get the idea.

How could this be implemented? From a user’s perspective, I’d say a way to define which streamed assets would need to be pre-loaded on the client (I’m guessing add that to the fxmanifest.lua options?)
As a small note, to rule out the “bad server loading 1000GBs of data on my PC!11!!” comments and reports, I’d say there should be a limit on how much those pre-loaded assets can weigh in total. And as a way to encourage people to actually care about physmem allocation going overboard, disable pre-loading for streamed assets that use memory beyond the limit?

In any case, I am open for opinions regarding this matter.
And yes, I do know there is a way to pre-load vehicles currently, but it’s way too many hoops to jump through (not to mention that it might not work for everyone, on every server etc.)

P.S. Bubble (and renegade, and whoever else from the CFX team), I am willing to help troubleshoot and try to find the cause of the lags when loading streamed MLOs and YMAPs - don’t hesitate to reach out to me in forum DMs if needed :slightly_smiling_face:

EDIT: Let me say this again to avoid confustion. I am not requesting a way to pre-load ALL streamed assets (that literally defeats the whole purpose of streaming); I am, instead, asking for a way to pre-load (sort-of “ensure”) specific assets that you somehow choose before the client joins the server.


I totally agree <3
Also pre-loading streamed assets will benefit people with low end pcs and bad internet bandwith


Technically, it wont as it’ll take roughly the same amount of time either way - but it’s sure nice to load into the game to already “seeing” all the vehicles and other custom stuff :grinning_face_with_smiling_eyes:


yeah it will take same time but the difference is that when he gets in the server , he can see everything already -> that’s what i meant with benefiting them

I want to drop my two cents on this discussion.

I’m assuming you want to pre-load all streamed assets?
Compared to “download-on-demand” when the streamed asset is first required, this can take way way longer and bloat a players cache before they’ve even started playing.

Imagine a server with “1000+ custom cars”, while only 40 or so of the cars will be used at once (making you only download the 40 cars whenever you first see them), you still have to wait for 1000 or more cars to download before joining. All of that to prevent a first-time-load when spawning or seeing the car that lasts like, an odd 20 seconds?
A player with “bad internet” would’ve had to download the 1000+ car with his “bad internet”, which sounds worse than torture

I’m not opposed to the option of pre-loading, but I feel like people are missing the point of the current solution to streaming assets.

1 Like

I made it quite clear in the original post - I want a way to pre-load specific streamed assets. Pre-loading ALL of them defeats the whole purpose of streaming, not to mention it’s an obviously bad idea. Thanks for the input, though!

1 Like

Ah, fair enough. A built-in option to ‘ensure the client has these assets ready’ would be neat.

1 Like

That is the point! :grinning_face_with_smiling_eyes:

1 Like

Pre-load like when you download the resources themselves? Wouldn’t it stuck you there a long time watching nothing? Won’t it will also stuck the queue systems for full servers, even for these who already downloaded these assets, just waiting for the one who’s downloading these assets, that can take sometimes a really long time (depends on his internet speed and server internet speed) ?


Mate, you’re really not getting the point here (I dont want to come off as rude or whatever, so sorry if it seems that way)
The whole idea is to allow pre-loading of certain assets simply to improve gameplay quality (and alleviate some lags in the process). If a server would force you to download 5 GBs of cars before you connect, it’s a badly run server and nothing else. And I’m sure there will be some way to figure out whether a client is pre-loading assets in this specific moment and adjust the queue system based on that.

1 Like

I’m not attacking the idea or whatever, I’m just giving you all points for thinking, I actually like the idea of pre-load and even shared my opinion of how it should be handled on the original thread. I even was about to post a request like this by myself, as @frenzy-renegade asked me too when he locked the other thread.

These are just things you need to think of before FiveM starts to implement this because it will prevent many issues that can be made to some people by this feature.

1 Like

Unfortunately, this is exactly what would happen if we were to introduce such a feature, ultimately impacting the user experience negatively across the board. However, I do agree with the main pain point, models taking time to load in while they are inside of your scope.

I believe it would he more beneficial to the community if we document some best practices and provide tools to minimize the loading of assets within visible range somehow, rather than allowing people to preload their entire server.

1 Like

The initial sketch of this feature was somewhat along the lines of hinting that a resource dependency tree (raw file name, model index with its dependencies, a pre-cached #map, and/or a certain coordinate box) should be downloaded even despite not being requested by the game, and allowing to query the status of a pre-cache, but only if the player is able to move and the loading screens have passed (to prevent gating).

Unrelatedly, as to the performance thing, current FiveM canary should have a few fixes to this (but loading may still be slow on slow disks, there’s some WIP changes to redo the cache/ directory to use RocksDB but that has its own flukes including some stuff about host memory usage).

1 Like

I do agree with that - however, I did make a point in the original post about that too. What if the total amount of pre-loaded assets was simply limited (to, say, 500 MB)? Anything above that limit would still need to be stream-loaded in the game. That should prevent the “5GBs of data” issue quite nicely. Sure, there will be server owners who complain, but people always complain regarding different things anyway :grinning_face_with_smiling_eyes:

That’s also a very decent option, although it does not cover some rather specific use cases (such as servers using an add-on map replacement), so TBF it’d be beneficial to have both ways available for choice.

Have a smaller map portion (could be <1 MiB) to ‘instantly’ load and then use that as a sort-of lobby area. Boom, requirement met. :stuck_out_tongue:


Just to add, servers can always use a caching proxy, so it’s not really about the time and/or performance it takes to load assets. This request is aimed towards improving actual gameplay quality (invisible vehicles while they’re loading has been a bane for as long as I have been here). Streaming is an amazing system, no denying that, but there should be ways to “circumvent” it and pre-load certain assets to the client for the reason outlined.

1 Like

Has this feature of downloading resources based on a dependency tree been actualized within the current model?

I totally agree with OP, and from a user experience perspective, I’d much rather spend a few more moments in a loading screen DOWNLOADING the map than myself lagging, and myself lagging to other players live as I’m trying to download the map.

That definitely breaks immersion / ruins experience.

Strange enough, I’ve seen public servers that seem to pull this off somehow. I’ve never lagged on their custom maps strange enough…

Not sure how this was done, but I’m sure it’s possible - I just need to understand how;

This usually doesn’t even happen (at least, we haven’t been able to induce this even with an artificially worsened internet connection and storage device). If this happens that’s a much more important bug to fix than trying to implement (or facilitate implementing) some half-assed predownload logic. :confused:

However, for such to get fixed, it needs to be reproducible and for the amount of people that tend to complain about stuff there’s a really low amount of people that give me or other core project developers access to the assets they’re using and a setup that reproduces whatever issue they are having. That’s what the earlier replies in this topic were about as well; if you’re having any issues as a result of asset downloads, THOSE should be fixed, but they can’t be fixed without us having these be reproducible.

Same for the idea mentioned earlier in this topic not being implemented because, again, we didn’t even have any assets to test this with, so of course other tasks that are actionable have higher priority.

Whaaat? That actually happens all the time, and isn’t something you guys are responsible for fixing (at least not directly).

Think about it like this:
You’re in GTA Online with your buddy; He has the shit-toaster 3000 graphics card and you’re rocking the latest and greatest.

He gets frame-lag on his GTA V client while moving at a constant velocity. That trajectory is now shifted because the player is a few feet / meters behind where he would be if he didn’t lag. Now on YOUR side, you’ll see the player shooting forward on the highway then teleporting back to where the player actually is. This happens all the time when the game code (or server) incorrectly predicts where the player will be because it wasn’t expecting the random lag spike.

This effect isn’t ‘fixable’ directly (as it’s a result of GTA’s Client-side prediction experiencing something unexpected), however, it is circumventable by reducing as much in-session lag as possible. (At least my opinion).

Also, I do totally agree with having proper data to demonstrate this. I’ll try to download liberty city (my harddrive crashed and I had to rebuild some stuff) and run a test with 2 players connected to demonstrate!