More Acceptible Way To Replicate To Only One Client?

Intro

As a roblox developer, it is currently too hard to replicate objects to only one client. There are a few different reasons one may need to do this, in my case optimization. Developers are forced to use the PlayerGui in an unintended way by parenting objects to this from the server, and picking up on them from the client. This leads to many trade-offs, and is unacceptable in my case because the model I’m trying to replicate includes gui objects inside of it, meaning that they will project onto the player’s screen unintentionally.

My Case

My game is a racing game, and before now I had been replicating all the vehicles onto the client prior to rendering in Workspace. I realized this was horrible decision on my part and was a beginner mistake when building Midnight Racing. Client memory could spike to over 2 GB at times, loading would last minutes, and assets began to fail to load due to a high volume of requests. By moving my vehicles (over 100 with about 25 meshes minimum each) to the server, I can cut down substantially on load times, and updates will no longer cause exponential lag by nature.

Unfortunately, my game also now depends on placing the vehicles into Workspace as local parts for the garage and dealership guis. This means that somehow, I need to replicate the car to only this client (when they request it so memory usage doesn’t spike), and then move that car to Workspace using a LocalScript. Unfortunately, when the car is parented to the PlayerGui, scripts in the car run and parent the car’s gui the PlayerGui directly, meaning that when the car is moved out it leaves the guis behind and you’re stuck with vehicle gauges for every car you look at in your garage.

The Solution

Some sort of shared storage service between only one client and the server. Basically, a cross between ServerStorage and PlayerGui that doesn’t actually draw the gui or run code. This would help a lot of developers save memory and implement their own part streaming method.

EDIT: Link to game: https://www.roblox.com/games/3339374541/Midnight-Racing-Tokyo-DEMO

5 Likes

2 posts were merged into an existing topic: Replicate items to individual client

Duplicate topic, moving to the original