Help for method to handle very large number of assets

Hello everyone,

My first post here on roblox dev :smiley:

For the game I’m developing there will be many spaceship models that will be handled locally with a custom level of detail system. The server will only handle the ships as a single 1x1 block to maximize number of active spaceships both player and NPC. I also want players and clans to be able to submit models for their own custom ships to be added to the game. The problem with this is that eventually there would be too many assets to load onto each client. Game load time would be forever.

So I want the client to only download upon joining the models of ships that are currently active and interacting with the world. This means I can’t just put all the ship models in replicated storage.

The server could just make available in a common location that clients can access all the active ships but then each player would also have to download every level of detail version of the ship as well which I want to avoid.

So now I’m stuck. Anything I clone from the server storage I can’t put in a common area every client can access(maybe it’s unavoidable), I need to replicate it only to a specific local client. And I’m not sure how to go about that.

Any advice or help would be much appreciated. This is my first game project on roblox so I don’t have much working experience with filtering enabled.

Thank you

Simple methods; smaller servers, multiple places in a game for different parts of space.

Replicated storage could be used for models your would just have to save location data, having the models in game will make less lag.

Try streaming enabled! Its a property of workspace and recently got an update. Big Changes to StreamingEnabled

You can also implement LOD systems which only load models such as trees, road segments and interiors that are near the players. This would have to be custom though.

@kinkocat
The server only sees the spaceships as a single block, and then the client would clone and parent the ship model to that replicated block using tweening to smooth out any lag in updates from the server. I don’t think streaming enabled would work because it only streams assets the server has in the workspace? And in this case it would only be a single part not the ship model I want the player to see.

To be more specific I want the client to send a signal to the server, from which the server replicates a specific model it has in storage to only that client. Is this just not possible?

Well in the past I’ve done it this way, I have the server clone a model from ServerStorage to a place such as the players PlayerGui and then the client will pickup on this addition and clone it into their workspace or wherever you want it, then the server would delete the cloned model. I don’t know if this is a good way of doing it, it’s just a way that worked for me in the past. This could be bad practice and isn’t something i do anymore it just sufficed at the time.

@kinkocat

So when the server clones into the playergui, only that player downloads the ship model? Does sound like a workaround kind of like how people used to use lighting for storage.

From what I can tell there is no API to do this as of right now. I’ll look into this when I get the time. Thank you!

Im pretty sure if you store models in lighting or replicatedstorage it still uses client memory (since its replicated to all the clients) its just not rendered. The method i used to use might still download it to all the clients however you will still be deleting it roughly a second after anyway on the server. In the end you’ll just have the cloned model on the client you want and nothing on the server. Again, this is just something i did a long time ago and i don’t know if its really worth it but im sure you could try it. In shorter terms it should clone the model from ServerStorage to where the client can grab it > Client clones the model > Server deletes the old model > Client does what it wants with the model.

I’ll look into it and play around with it.

Hopefully Roblox supports this with some API in future. It would be a very useful feature to add in my opinion, I don’t imagine it would be that difficult for them to implement.

Welcome to the forums!

How I interpret your question is that you’re wondering how you can deal with many ships without making the client have to wait forever to join your game. I also see that you’re currently utilizing ServerStorage to prevent ships that no players use, are in the “game” for the clients, and that’s great. That reduces memory & bandwidth for the clients that are connecting.

I see some stating that StreamingEnabled could work, and yes, that could work if this was more of a CPU/GPU-related problem (also memory on very low-end devices). It simply reduces the parts that are visible to the client to maximize game-performance on lower-end devices that don’t have that much computing power. But, it doesn’t hurt too much enabling this either, but you’ll have to beware of the consequences of using it. (Parts not loaded in, if you have referenced them in your scripts etc.)

Sadly, as far as I am aware, Roblox does not support a way to only load something in for a particular client only. You could create workarounds (sending information when communicating with the client to have it construct from the information given to it).

So as far as I can tell, you are going to have to replicate it to all the clients either way. But that doesn’t mean you have to render the models (which is more of a computive-intensive task). It will “only” increase the game’s memory usage and use more bandwidth. But this all entirely depends on how long it takes to load in the models. Just notify that the model is for that particular client only so the others don’t have to worry about it. I’m not familiar with your game’s structure but I think that’s pretty much it.

If it takes too long to load in, you should be reconsidering how the ships are built. 1-200 parts aren’t that bad for a ship, but if the ship starts exceeding 1000 parts you’re going to face a problem with rendering too, because it will be significantly slower. Also remember that players with bad internet connections are probably aware of the issue themselves, and they understand it will take longer to load in your game.