Cloning Particles Lots of Particles or Scripting Every Particle

Hello! I’ve been thinking about this for a while.

Is it better for a game that uses a lot of particles with a lot of paramaters to clone particles that exist in a folder… say in replicated storage, as opposed to creating a new particle in the script and manually doing all the properties?

Thoughts?

In my opinion, cloning is much better as the server doesn’t have to go through as much effort of replicating the same properties as it would if you were to manually set for every new particle you made. Cloning also would take up much less room inside your code compared to creating a new particle emitter and putting in all the properties each time. It is more efficient and more organized to clone existing emitters rather than creating many new ones.

1 Like

I agree with @Vmena Cloning seems to be the apparent efficient method of doing this. Although I should add, if you are cloning particles that need to be customized a lot then I suggest making a handler module or script that applies these customization and makes them instead of cloning . In terms of performance, I believe that instancing a new particle object would be more costly. However make sure you test these out using the Micro Profiler.

Thats what i was thinking… i just wanted other devs opinions to make sure i wasnt being dumb XD. Ya know?

Yea I totally understand. It’s good to have a shared knowledge and see different opinions when approaching tasks.

1 Like

Personally I prefer cloning for the sake of ease of access in a game structure. I never instance reusable assets unless my structure or code explicitly demand for instancing. Just be wary that keeping assets live in your game takes up memory. Not the biggest concern but when that number starts creeping up (memory use), it starts to become one.

There are a couple of fundamental principles to consider when handling game assets, such as ensuring to destroy anything you don’t actively use anymore. As far as storage goes though, you’re fine to store them in a storage service. A lot of developers follow this pattern - I’d be surprised if that wasn’t true.

1 Like