- Home /
Object Pooling vs Particle System
I am wondering which of the 2 systems above would be a better, mobile friendly choice (or if it doesn't matter). Basically pooling gameobjects, or creating custom particles (meshes) that can be manually manipulated.
I will be spawning dozens of simple objects that are to be collected by the player. For this, they must be 3D (I do know 2D would mean that a PS would be better/easier though. But for the sake of the question, they must be 3D).
I am still pretty new to optimizations, and any insight would be appreciated before I go ahead with creating a spawning system...
Probably pooling for your case. Also, you should test out both methods on an mobile device prior to release.
So, there will only ever be solid meshes, like yellow balls with dollar-signs written on them? There will never be anything that anyone would think of as a particle? The plan is to think of a particleSystem as a really efficient reusable list, plus particle-moving stuff you don't need. And to repurpose just the list part into pick-up storage?
But could it be efficient enough to warrant checking it out? I have other things I can work on until I can figure that out... Otherwise (since it seems like not many people have tested this) I'll have to test it later...
Answer by Owen-Reynolds · Apr 08, 2014 at 05:01 PM
It's not an either/or. If you're confused, just do whatever seems to look nicer, and worry about speed later.
Choice#1 is custom mesh (is this a single facing plane with a fancy shader?) vs particleSystem. Particle systems can make some cool stuff, and are easier. Easier, to me, wins for now. Single meshes are fine for small, quick things (like a single white flash; grows/dies in 3 frames) where they won't notice or care it's the exact same every time.
Choice #2 is Pool vs.Instantiate. Whether you go with custom planes or particleSystems, you can do either. Pooling means that instead of Instantiating when-ever you need whatever it is, you grab an unused one from a list (which you Instantiate once at the start.) All pooling does is maybe avoid some stutters when you spawn a lot at once.
I already have what looks nice and was easiest to set up at the beginning (object pooler), but I also want to squeeze out some more performance if I can... I know ParticleSystem supports meshes, but I don't know if switching over would give a significant enough speed boost to bother...
Your answer
