Interiors only spawn in the client

what came to my mind recently is to make a system where you only spawn the interior when the player enters it (only in his client) so heres the idea,

when the player joins the game the server loads all the interior data and the furniture data (if any) , and then the server places that interior in a folder in replicated storage which will be the main source for all clients to take the interior from

Example:
so for example lets say Player1 has a small house
and Player2 has a big house with a lot of furniture inside it (that may cause lag)

the Player2’s interior will only spawn when he enters his house and it will only spawn to him in his client so no one will see it, and the reason this is better is because it wont lag to other people unless they entered his interior

and same thing applies for Player1

if Player1 enters Player2’s house it will take from replicated storage Player2’s interior and it will clone it and put it in workspace, and teleports Player1 to the interior
(all things are happening in the client so the server wont see that Player1 sees Player2’s interior)

and when he leaves the house Player2’s interior it will get removed,
(mind the fact that the interior is still in replicated storage we just deleted the clone that is inside workspace)

Possible Issues:
the issue that arises is that what if the owner of that interior places a furniture while other players are inside the inteior?
well what i thought of doing is when the player places a furniture (on the server) the server sends to all clients inside that interior all the furniture details which then they create it inside the interior in workspace, and then the server places that furniture that has been placed to the replicated storage interiors source, which means that anyone who will enter the interior in the future will see that placed furniture.

Exploiters:
i believe it cant be exploited because replicated storage only changes to all clients when the server alters it but when a client alters something in the replicated storage the alteration will only be seen by that client and not all clients

Positives:
what you might ask is why? and to that i say a lot of reasons but one of the main ones are:

1: prevents lag, if we made a system where it spawns all interiors next to each other the issue would be that what if someone has a large amount of furniture that may cause lag to lower-end devices, which will be prevented by making it so the interior will only render and spawn when the player enters that interior and not render even when hes not inside (which will cause lag from useless information that the player wont even see)

2: furniture datastore, you wouldnt need to reposition all furnitures when the player enters the game because they will all be positioned at one place (which will be the interiors spawn plot which will be shared by all interiors) so that means if the player places a furniture on the second floor inside a bathroom you wouldnt need to reposition that furniture when the player enteres due to the fact that the plot may change if its already occupied by an another player (that said if we stick to the old system that has multiple interior spawn plots and not 1 shared plot)

(im sorry if the furniture datastore was unclear please tell me to clarify if you are confused)

so give me your thoughts will it work or not?
are there issues with it or not?
will it cause more lag to do that than to just make all interiors spawn?
and most importantly will there be any possible exploits?

any help will be appreciated

That is indeed an approach you can use, and it’s great that you’re taking these things into consideration. I wouldn’t worry too much about exploiting, since exploiters can do pretty much anything they want with their own client anyway, and as long as there’s no way for them to abuse the remotes and cause issues for someone else, I wouldn’t worry about it. Regarding the issue if someone places furniture while someone is inside, you can follow the approach bloxburg takes and force them outside of the house during build mode, and then you can “de-render” the furniture so that it’ll reset when they enter again.

Or you could add an “update” clause to your remote event, where the server will fire a remote event to all clients in the house to place that particular piece of furniture there.

Something I’d recommend looking into is Instance Streaming. It should provide you a way to gain tighter control over what a client renders, which should prove more reliable than using RemoteEvents.

1 Like

appreciate the help greatly, and i will look into instance streaming

ill keep this post going if anyone has more ideas and suggestions

Sorry to post again, but I just wanted to double back and make sure I answered all of your questions.

The average performance should be significantly higher than if all of the interiors were being rendered. Although by making the interiors render when necessary, the player would likely encounter a noticeable lag spike or delay while the content loads, although it wouldn’t last long.

But, all things considered, I think what you’re doing is a good idea.

1 Like

there would be a loading screen that waits until the interior fully loads, the closest example i can give is adopt me

That’s even better, then. I’m sure it’s going to take some time and effort to figure it out, but I definitely think it’ll be worth it.

1 Like

actually i just realised an issue, if we spawn all the client sided interiors in one place/plot then players can see other players’ characters that are in their interiors but they cant see the interior in of its self, so im not sure how to fix that issue.

The way I’d approach that is just to have about 15 (or whatever the max player count of your game is) areas far off from the main map and assign each one to a player when they join. Then each player would be given their own space for their house. And if I’m correct, instance streaming should still give you the ability to control which of those plots render.

1 Like

appreciate the help

Character limit