Particle Effect Woes
Tobin
Member Posts: 9
I'm wondering if I have uncovered a bug, or maybe I'm doing something wrong. I searched for "particle problems" and "particles" and a few other things, but didn't see anything with the same observation. Forgive me if this has been asked before.
I set up a particle emitter, picked a direction and velocity, and set the lifetime of the particles to 30 seconds. Run the emulator, and you see the emitter dumps out a thick chunk of all the particles almost at once, and will not resume emitting until those particle die. Then once that initial burst all dies, it will start emitting with the exact parameters you set. This isn't exactly good, since the first set of particles released should follow the parameters defined.
I tried a variety of start up times and spawn rates. it's pretty clear what happening and I'm really surprised more people haven't scene this problem. I saw some other threads where people had different issues, but most of them were closed after someone suggested "just play with the spawn times". That's great and all, but it's not a fix for the particles that are not following the rules. Maybe no one makes particles with long lifetimes?
Any help would be appreciated.
I set up a particle emitter, picked a direction and velocity, and set the lifetime of the particles to 30 seconds. Run the emulator, and you see the emitter dumps out a thick chunk of all the particles almost at once, and will not resume emitting until those particle die. Then once that initial burst all dies, it will start emitting with the exact parameters you set. This isn't exactly good, since the first set of particles released should follow the parameters defined.
I tried a variety of start up times and spawn rates. it's pretty clear what happening and I'm really surprised more people haven't scene this problem. I saw some other threads where people had different issues, but most of them were closed after someone suggested "just play with the spawn times". That's great and all, but it's not a fix for the particles that are not following the rules. Maybe no one makes particles with long lifetimes?
Any help would be appreciated.
Best Answer
-
Socks London, UK.Posts: 12,822Yep, the particle behaviour has always been a little 'lumpy' (especally at the start of the effect) that's why I use spawn for that kind of thing, you can do some great stuff with spawn as it opens up all the controls available to actors.
Answers
I am using (spawn/destroy) myself but I noticed huge lag after spawning/destroying about 200 actor, it could be something else is causing it though, I normally don't think of optimization until I am done with the basic concept of the game.
I tried to get the infamous spawn issue to appear, spawned hundreds of thousands of actors (literally, 200k if I remember correctly) - with as many as I could get on screen at the same time (around 150) all with constrains, timers and various other rules - and Gamesalad didn't break a sweat, 60fps, static memory use / no growth in RAM use. Same here, I might do a little bit of basic stuff as I'm putting something together but generally I'm happy to work on a bloated unoptimized project and do the real optimization towards the end.
I will be working on spawning/destroying rather than particles from now on.
btw I have just checked, the game lags when I have so many actors (30) at once in the screen and the camera is moving, after destroying it goes back to normal, my mobile is iPhone 4G, so it could be the issue.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
You should try and place those 30 actors on screen manually and see if the game runs smoothly, if it does then Spawn is at fault, if on the other and the game lags in exactly the same way (which I suspect it would) then the issue is with having so many actors in the scene at the same time rather than how they're placed into the scene.
You'll often hear people say "hey! Spawn keeps crashing my game!!" You then ask them what they are spawning and they tell you: "800 spider animations all constrained to each other with their own individual 4 part audio system and multiple collision rules". )
Spawning is simply a way of getting actors into the scene, when you recommend spawning as a way to place objects you'll sometimes hear people say "yeah, sure buddy, try spawning two hundred 1024 x 1024 images all at the same time" - which says absolutely nothing about spawning, but everything about having two hundred 1024 x 1024 images in the scene at the same time, they are confusing the delivery method with what's being delivered:
"I hate this cup, need to get a new one, every time I take a drink from it I feel sick"
"Can I ask, what's in the cup, what are you actually drinking ?"
"Oh, just some hemlock tea I like to brew up"
"Mmmmm, maybe the cup is not the issue here . . . . .?"