Collection Service and Part Properties

So I love particles, point lights, transparent parts, neon parts and reflective parts to the point where there are hundreds or even thousands in game, however lower performance machines do not.

I would like to set up a low graphic mode which will disable all of these things, the issue is the way I want to do it (CollectionService:GetTagged() on join, CollectionService:GetInstanceAddedSignal(tag)) during gameplay) may actually lag more than the original game does.

What are the performance costs of listening for new parts being added, and then disabling anything that could cause lag? Is this a bad way of doing this?

1 Like

TL;DR: It’s fast enough

I don’t actually know any of this, so take it with a grain of salt and ideally do your own tests.

You can think of collections as tables containing every instance that has the collection’s tag. So GetTagged shouldn’t have to do any crazy expensive calculations to figure out which instances are in a collection. It should be pretty much the same as copying and returning a table. As for GetInstanceAddedSignal, this uses the observer pattern. This means that it doesn’t have to constantly poll (ask) the collection system if anything new has been added. Rather, the callback is only called when things are added. Unless you’re adding and removing a lot of things very often, it should be fast enough for your needs.

Iterating over 1000s of instances and making changes to them might have an upfront performance cost, but if this is only done when the player joins, you can pretty much think of it as a slightly longer load time. Players on low-end devices would probably trade a couple of seconds of waiting for a significant performance boost any time of the day.

I’d probably set it up the other way. Have them all off by default and then if the user is not in low graphics mode, enable them using the collectionservice methods.

That way there’s no chance that someone on low graphics mode would see the particles for even a frame before they got disabled. In reality it makes no difference as the methods are fast enough anyway.

1 Like

You can always just always put all of those in a folder and when someone joins and they want to use the low graphics option you can disable everything in the folder or edit them.

No, it’s not a bad way.

You would actually need more computing power to do it the other way. Because when a new instance is added into somewhere, collection service recognizes it instantly, with basically no cost. So you can edit it with ease.

But let’s say there were no collection service, how would that impact your game?

When a new instance is added, you would have to detect with many I mean many if statements because you would have to detect if the part is a part that you want to edit that would use much more computing power than if you were to use collection service.

2 Likes