Particle Systems and Time Manipulation

Coded Games

Member
So currently my game uses objects as particles because the game constantly plays with the speed of time. One second everything will be full speed the next everything will be at 1% with very subtle movement. Overall the object system works alright but I am constantly looking to improve the performance of the game.

Would I be able to implement a particle system to do this? If I did, would I even see any performance improvements?

The current way I see that I can manipulate a particle system's speed to by using part_system_update. The downside to this is that I need my particle systems to expect the minimum speed to be their base speed (calling part_system_update once per frame). When I want time to speed up, I would then have to start calling part_system_update multiple times per frame to make it so that the particle system speeds up also.

Is this efficient or would it be best to just stick with objects?
 

NightFrost

Member
Particle system is much more efficient at displaying a large number of GFX as an amount of objects equivalent to number of particles, obviously. Unless you meant a custon-built particle system, where a single object tracks and draws hundreds of sprites. Anyhow, I'm not seeing the issue - the normal speed of a particle would be one part_system_update a step. When game slows time down to 1%, it means one update every 100 steps. (Remember to turn off automatic update.)
 

obscene

Member
I would certainly think calling part system update several times a frame would be taxing, but really it depends on how many particles. Drawing the part system is obviously more taxing and you wouldn't be calling that any more than before. Only way to answer this question is to test under your most intense situation and see. Write your own system and compare. I'm betting that writing your own system would be more taxing in any case but again no way to know other than running a test.
 

EvanSki

Raccoon Jam Host
make sure to also clear the particle system when you dont need it, and dont get caught in a loop of creating one in a step
 

Coded Games

Member
Particle system is much more efficient at displaying a large number of GFX as an amount of objects equivalent to number of particles, obviously. Unless you meant a custon-built particle system, where a single object tracks and draws hundreds of sprites. Anyhow, I'm not seeing the issue - the normal speed of a particle would be one part_system_update a step. When game slows time down to 1%, it means one update every 100 steps. (Remember to turn off automatic update.)
Unfortunately 1 update every 100 steps would look terrible. When the game is slowed down and everything is moving very subtly all the particles would be choppy. Fast moving particles would have noticeable jumps. To replicate the current object based particle system I would need to do 1 update per frame at 1% speed and then bump that up to 100 updates per frame at 100% speed.
 

NightFrost

Member
Hmm yes. Technically the answer would be to alter the properties of particles... but the particle system doesn't work that way. The property settings (with exception of one or several) do not affect particles that already have been created. To address the particle speed problem, you may have to build a custom system. But first test if speed can be altered, I can't immediately recall which setting(s) did affect particles already created into the system.
 
Yes I have a slow motion effect with particles and the only way I could find was to manually update the particle each step. I tried making am object particle system but it was much much slower than the particle system. I wasn't able to find another solution, though I heard that possibly a particle system shader would work I wasn't able to find such a thing.
 
Top