I have committed sins against optimization multiple times please help!!!
Okay so I have 9 “chunks” of grass spanning the entire default baseplate. These chunks are in total, 128x128 studs each, and consist of 1x0.3x1 parts that repeats every other stud. There’s just one problem, I can’t run my game at all.
My computer sucks and on top of that, due to the sheer amount of parts, my game won’t run at all. Instead of running it takes about a minute for the server to even start up, and when it eventually does, the server freezes for so long that quite literally every function of both core scripts and game scripts freezes completely (It’s very bad lol)
As you can imagine, these chunks of studs up to a whole lot of parts, and it’s important that they stay as individual parts instead of being grouped via union or external means for two reasons.
For one, these parts have the stud texture on the top surface, so grouping them with unions would completely remove them.
And for two, whenever the parts are first within a certain distance from the player, there will be a random chance that individual stud will be tall. So again, grouping them with unions as well as exporting them as obj files and reimporting them wouldn’t work.
The reason I want these to have a chance to be resized at runtime is because eventually there’ll be terrain that isn’t exactly square, meaning it wouldn’t fit chunks as big as these, and I want to avoid individually picking blades of grass to resize every time a chunk doesn’t fit the floor it’s placed on.
I believe that my issue lies in the fact that the server loads every single stud all at once, and this would be fine if there were only a few chunks, but there are literally thousands of them, thus the game completely fails to function.
My goal is to find a way to halt the loading of specifically these studs (and if I’m feeling fancy, any other objects that may be causing performance issues) in order to control when they do load (specifically when they are within a certain distance from the player) and unload them when they leave that distance, and if that’s not possible, to do a delayed loading of these these objects so that the server doesn’t soil itself.
I already tried to set their transparency to 1, but I failed to realize that just because an object is invisible, doesn’t mean it’s completely inactive, thus, the server still loads them all at once, and we’re back right where we started.
I also did try filtering enabled but I got intimidated by all the options and immediately turned it back off.
If push really comes to shove then I’ll probably end up making an entire system just for procedurally generating grass on the floor, and I really don’t want to do that, so I need help desperately!
If you need any extra information or clarification (and this is a long post, so I more than likely left something out) please let me know