Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How i can i reduce the lag on a game that has a lot of bricks?

I have a game where the map in generated by a script, it has a lot of bricks though. It is very laggy when i run it, to the point where i can't use tools/weapons. Ive seen plenty of other games that have tons of bricks, yet they run smoothly. For example the Quarry, it somehow generates maybe over a thousand bricks for mining and yet the lag does not seem to affect it very bad.

4 comments

0

How many bricks are we talking here?

0

That is not how the quarry works, it simply generates points randomly. These points will only become visible when the player reached the depth meaning that part are made when they are needed.

1

StreamingEnabled, if you don't know what it does, look it up. Scripting-wise, make sure you cut down on the loops, building wise, cut down on the quality and/or don't build in areas where the player isn't going to see anything.

0

The Quarry only generates the top layer, and as a player mines, it generates bricks around it.

1 answer

✓ Accepted answer

Occlusion

If they can't see it, don't generate it. There's simply no point in making things which may even never get interacted with by the player. It keeps the RAM free, it makes sure that there's less for the GPU to worry about when rendering and working with its own occlusion (Note: Roblox occlusion is bad), and it frees up the CPU at the initial generation by reducing how much stuff is being done ahead of time by moving stuff to the run-time.

This discussion is preserved as it was. New answers, comments, and votes are closed.