Culling building interiors, is there a better way?

So I use a culling function on most games I develop for that works like this:

The interior of buildings that are enterable for players are made in a way that the interior is separate from the exterior, this model is placed into the replicated storage area of the game. Everything interior wise, aside from objects that have to be interacted with the player are culled away in this fashion.

When a player enters the building, they prompt the server via either a proximity prompt, or a passive sensor that detects the player’s humanoid. When this is triggered, a signal is sent to the local part of the script to retrieve a copy of the specified interior and place it locally into the game.

The idea is this physically removes the interiors of unoccupied buildings when they arent in use, reducing the load on the game that has to be rendered and calcuated.

In practice this works well, I have no complaints about this method other than one, and its where I want to know if there is a better solution to achieve the same goal. Upon loading the interior, it causes a breif lagspike, it’s not a game-ending problem, but its one that players notice and they do complain about. When using the proximity prompt method its not that noticeable even to players as they are teleported inside, whereas the passive method is more noticeable, but its necessary for some areas.

What can I do to mitigate this for a smoother experience?

2 Likes

There isn’t a crazy lot I know that can be done to mitigate the issue, Roblox’s instancing system can just be a bit laggy when creating and moving alot of stuff.

You could try Asynchronous Loading. There is a couple of ways you could do this, but assuming the model is something like 5 other seperate folders that are like “Furnature”, “Walls”, “Lights”, etc. You could go thru each and load them in separately, with a small delay between each one.

Assuming you’re only ever loading the interiors in on the client side, and you’re using :Clone() and then reparenting, you could instead just reparent the model and not :Clone() a copy of it, seen as you’d only need one. Just make sure to re-parent that back once you’re done with it.

I do clone it as I have had issues with that and player deaths in the past.