Particle Effect Woes

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.

Best Answer

  • SocksSocks London, UK.Posts: 12,822
    edited February 2013 Accepted Answer
    Yep, 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

  • CORE GameCORE Game Member, PRO Posts: 280
    yes but spawning actors will affect the memory, You can have the actors out of the view and relocate them when you need them.

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    yes but spawning actors will affect the memory
    Yes, it's more efficient !
    You can have the actors out of the view and relocate them when you need them.
    Spawning and destroying is more efficient than keeping all the actors in the scene at the same time - but if we are talking just a few actors then I doubt either method has much advantage.
  • CORE GameCORE Game Member, PRO Posts: 280
    well, as I have started using an old version of gamesalad last I remember that spawning/destroying will eat up the memory slowly, however recent version of GS stating that it doesnt.
    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.

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    well, as I have started using an old version of gamesalad last I remember that spawning/destroying will eat up the memory slowly, however recent version of GS stating that it doesnt.
    Yeah, it used to be an issue, spawning and destroying would slowly use up memory, but like you say it works fine now.
    I am using (spawn/destroy) myself but I noticed huge lag after spawning/destroying about 200 actor . . .
    How many actors were on screen at once ? When does the lag appear, as soon as the spawn starts ? Towards the end ?

    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.
    I normally don't think of optimization until I am done with the basic concept of the game.
    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.
  • CORE GameCORE Game Member, PRO Posts: 280
    since you have tested with 200k actors, then you made my day ! :D
    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.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Just change the rate of the particle and also set the direction to random 0-360. I just created a particle effect around breaking ice. It works well if you know how particles work. I have experience creating particle effects in Apple Motion.
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    since you have tested with 200k actors, then you made my day ! :D I will be working on spawning/destroying rather than particles from now on.
    Do some tests, see what woks best for your particular needs.
    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
    The question really is this, does spawning/destroying impact on memory/performance compared to other methods with all other things being equal ?

    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 . . . . .?"

    ;)
  • CORE GameCORE Game Member, PRO Posts: 280
    Yes, I hear socks! btw I was spawning bullets (8x16)

Sign In or Register to comment.