This is pretty useful for beginner scripters . And making code faster in general.
Not that this may be a good method, but I do find significant performance boosts by selecting what should be inside workspace.
If a player is far away from a certain room or area, and you believe the player has no intent to even be able to see it, shove it into a table, and parent it to nil. Once a player gets back nearby that the player should see the parts, parent it back to the workspace.
This removes the entire rendering, collisions, lighting, transparency, textures problem of the selected part if it’s still in the Roblox render distance.
However, at a cost to still keep the part in memory unless you intend to use a replication service to handle loading in parts/models in a chunk fashion to let clients :Destroy() items instead of holding them in nil.
The code you’re running in a short amount of time is where most of the problem forms!
Sorry for the late response, but about StreamingEnabled, I meant that it caches the already loaded parts of the game. If you go into a game with StreamingEnabled, you likely won’t see that far, once you load it in, it will stay loaded until you cannot render it, which then I assume it’s removed from the client until it’s back in their view
Also! Added some clarification for the terrain part!
I have 62k parts in ReplicatedStorage (for testing) and using 268 mb of memory (default for creating a game), so I’m not sure if this is a myth or a fact.
Definitely fact! It’s listed on the reference API, anything in ReplicatedStorage is replicated to the client! Memory isn’t always directly correlated to performance!
This is entirely incorrect and a misinterpretation/contradiction of the actual article you quoted. The same article you quoted for the transparency section itself says:
Use partial object
Transparency
sparingly, as semi-transparent objects inhibit a lot of internal rendering optimizations.
Please fix this asap. I understand it’s probably a typo, but actually advising the complete opposite of what to do in a guide is unacceptable.
Thanks for letting me know! I will change it immediately!
You did come across as a little aggressive, though I understand you’re just trying to help… it was simply a change in rhetoric!
I understand I was a bit blunt with you, but please understand it was out of concern of the impact on others a guide like this can have. For a community guide that a lot of developers will probably use extensively, the information should be accurate all the way through, as it can have a big impact on many developers’ current games and all their subsequent games too, and the advice they spread to other developers and so on, like a sort of butterfly effect.
Additionally, the page’s information has not changed since at least March 27, as the internet archive shows, so it must have been a misinterpretation, which is fine and happens to everyone! I’m not blaming you for anything, everyone makes mistakes, I just want you to understand the impact (positive or negative) you can have on other people, and understand the extensive caution and review that should go along with making guides/tutorials, due to their potential widespread impact.
maybe incude hollowing of parts turning off castshadow on parts tht dont need it unioning all the parts tht have the same: transparency,reflectance,materials,texures and decals. color doesnt matter since unions uk wht i am saying right.
Hey! Thanks for the tips, I did include most of those already but I don’t want to advise using unions since in my experiences it’s lead to unoptimized geometry
I’m a newer developer and this is of great value to me. I have been direction less as far as how to program for optimizations and now have a great reference moving forward. Please don’t ever remove this and I’m looking forward to any other guides that your willing to provide!!!
As a starting developer, don’t worry about performance. All those things indeed make performance better, but for games that are typically made by starting developers (not to put you down!) optimalization isn’t really needed. Roblox handles most things for you and optimalization will only have a significant effect in larger games.
I suggest focus on practicing scripting in general, optimalization is a thing for later!
I’ve actually built a whole game in unreal engine somewhere around 15 years ago and then released it onto the iOS store. It was a hobby project, but I was still proud of it.
I haven’t coded for a long time, but I understand at least some of the core principles. And now for Roblox, I’ve been struggling with simple things like when to put something into server storage vs replicated storage vs local and things of that nature. So I ignored it and have been placing everything in workspace… which now takes 60 seconds to load my map, lol. Just learning to optimize via learning where to place each item in what storage will help me to not be completely dumb.
Per your advice, I’ll focus on scripting and not pay too much attention to the optimizations while still being aware of them so I don’t make crazy errors.
Nice! For loading the map, check out Content Streaming | Roblox Creator Documentation ; this will probably limit your loading times!
I would advise good practices, don’t focus too hard on optimization but don’t just ignore optimization. If you get used to doing things the right way then you’re better off in the long run! The API reference is an amazing source! Starting developers should worry about performance, otherwise when they work on bigger projects- getting overwhelmed with new practices or having to change how you work or work you’ve made is horrible… it can hurt your motivation and delay your game, so I’d still say you should worry about performance! You may not need to go as in depth as some developers but you should still keep it in mind!
This one is weird, why would a pre-built constructor be slower than explicitly setting the Instance’s Parent?
I don’t think they explained it in-depth enough. It’s because when the parent isn’t set, setting the properties of the instance is faster because the instance itself won’t be updating until it has a parent set.
I’ve always heard of people explaining that it’s faster, but never how much faster it is. If you need to set the parent right away, then do so, the small performance boost isn’t really worth it unless you’re creating a handful of instances every second.