Particles not being cleaned up - No mission cleanup group
by Thomas \"Man of Ice\" Lund · in Torque Game Engine Advanced · 09/23/2006 (1:06 pm) · 2 replies
OK - diving into the next issue. This is an old one that has existed for ages.
In the particle emitter deleteWhenEmpty() method, the "No mission cleanup group" is called a lot.
The reason is, that the code is run on the client side - but the mission cleanup group only exists server side.
On top of this particles are not removed from the game properly.
The above behaviour is visible in a dedicated server setup.
Adding a static counter to the code and and increasing/decresing the value in the contructor/destructor of the particle emitter shows the problem. When it goes up 10-20 in value, it only goes down for a few. Slowly increading the amount of particle emitters in the game.
While I dive into this issue, is this something others see too? And maybe even something someone fixed?
In the particle emitter deleteWhenEmpty() method, the "No mission cleanup group" is called a lot.
The reason is, that the code is run on the client side - but the mission cleanup group only exists server side.
On top of this particles are not removed from the game properly.
The above behaviour is visible in a dedicated server setup.
Adding a static counter to the code and and increasing/decresing the value in the contructor/destructor of the particle emitter shows the problem. When it goes up 10-20 in value, it only goes down for a few. Slowly increading the amount of particle emitters in the game.
While I dive into this issue, is this something others see too? And maybe even something someone fixed?
#2
10/02/2006 (3:12 pm)
Yes, thanks again Thomas for finding those issues and passing them along. I'm getting to them as quick as I can.
Torque Owner Thomas \"Man of Ice\" Lund
After playing around with a stock emitter code for a few minutes in Air Ace, we had several hundred emitters that where orphaned. The deletion process doesnt work, is error prone and actually caused a few crashes on us (we have lots of emitters in the game).
Besides fixing up the deleteWhenEmpty method and some other issues, I implemented a singleton emitter manager class (very basic) and decoupled all emitters from their parents using generic ids instead of pointers. Slight overkill, but I seriously was tired of crashes and this totally removed them.
In the process of implementing the manager, I had to rewire all emitters. During that process I found a few places where emitters are created and never destroyed properly.
All changes are send to Brian R incl the manager stuff. While that part most likely doesnt go into TSE, I hope that some of the other changes will. *nudges Brian* ;-)