You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Making the uncopylocked free-to-use source of a minecraft clone lag less
What is the issue? Having a few chunks loaded will lag the game. I narrowed it down to the large amounts of decals being used to have the textures of the different sides
What solutions have you thought of so far? Before I decided the cause, I made the lighting less intense. I don’t know what to do now since it has a normal amount of parts.
I think the lag is caused by decals because each block has one decal per face and quite a few chunks are loaded at the render distance setting.
I don’t have an end-all solution, and I don’t know there really is one, but I can offer some advice on this:
I have found having more than 20 or so decals overlapping can produce some serious lag. The closer the player’s camera is to the decal, the more resources it will take up.
Something you can do is only make decals that the player could see set to visible. For example, a block underground that isn’t able to be seen by the player is still using up resources because the decal is technically “visible”. So, if you know a block is entirely not visible to a player, its decals should not be visible.
You can also make decals a certain distance away from the player not visible and instead just use a colored block underneath the decals.
The issue is I don’t know how to do this. It already has only visible blocks rendered but it has all sides of the decals rendered. I have tried to fix this by swapping to textures and saw a bit of performance increase
Hmm I see. I do not recall if a completely transparent part will show its decals or not. But either way, you can always modify the decal’s transparency property to 0 or 1 locally on each client.
Option 1 using a matrix/references: Use a matrix or references to keep track of which blocks have exposed surfaces. When a surface becomes exposed, change that decal’s transparency from 1 to 0.
Option 2 using line of sight: What I would do is have all the decals’ transparency set to 1 (fully transparent). Then, as the player looks around the map, use some sort of line of sight detection system to “switch on” only the visible decals to the player. Ray casting comes to mind, but it might not fully cover each block. Checking each block in a certain vicinity might be possible to do on the client but it could get computationally expensive.
I use the word decal here, but textures are great too!
Making a part with decals transparent is taxing on performance. A glass structure that is large would a client out. It already handles creating the blocks locally since there are no physics with the blocks.
Oh alright, you can use surface GUI’s in that case and flip on and off the Frame’s visibility instead using those options. I’m pretty sure a non-visible GUI object does not use resources.