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