• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Most efficient way to clean up particle systems?

F

Finn

Guest
What is the most efficient way to clean up particle systems? More specific: Is is possible to completely clean up a particle system only knowing its name/id - but not the ids of the emitters or particles?

As far as I understand the following steps are required to remove particle systems from memory entirely:
  1. Clear existing partciles in the current room - as in part_particles_clear(); - this is also done by part_type_destroy();
  2. Remove particles from memory - as in part_type_destroy();
  3. Remove particle emitters from memory - as in part_emitter_destroy(); - this is also done by part_system_destroy();
  4. Remove particle system from memory - as in part_system_destroy();
Now,
  • using part_system_destroy() will take care of 3) & 4) only requiring the particle system name.
  • using part_particles_clear() will take care of 1) only knowing the particle system name independent of how many particles are associated with the system
So it would be possible to write a function, feed it _only_ the name of the particle system and take care of 1), 3) and 4). But how about 2) ? Is there a way to find all particles associated with a particle system to then remove them from memory?
 
T

Timothy

Guest
No, because multiple systems can use a single particle type... so the particle types are not associated with a particular system.
 

NightFrost

Member
Is there a way to find all particles associated with a particle system to then remove them from memory?
No, because there is no such association between them. While you may have written your particle stuff with some association in mind, nothing in the particle commands sets up such thing.
 
Top