Object pooling
by Craig Fortune · in iTorque 2D · 05/12/2009 (8:23 am) · 2 replies
I'm on a bit of a mission for getting the most out of iTGB in regards to speed at the moment. Specifically targeting issues I come across while developing my game.
On this front I'm pondering over doing a little work on object pooling. I had a little look around to see what people have already done in regards to this with TGB and it seems these are the interesting posts:
www.garagegames.com/search?q=object+pool&x=0&y=0 (Top 2 posts)
and for a very nice scientific viewpoint...
www.garagegames.com/community/blogs/view/15758
It is apparent to me that although the gains are pretty good in places, the data is only for a large amount of objects (starting at 610 runners, each runner being several objects). My issue is the desire to have individual objects being created promptly rather than many objects created quickly (there is a difference... honest!). So on this standpoint I want to know if anyone has done anything similar to this on iTGB and has any data to share?
Also, does anyone have any information (opinion/fact) on how expensive object creation actually is within Torque? I see a lot of conjecture on the net about this topic (in a broader sense than just Torque) and I'm not really sure what to believe :D
On this front I'm pondering over doing a little work on object pooling. I had a little look around to see what people have already done in regards to this with TGB and it seems these are the interesting posts:
www.garagegames.com/search?q=object+pool&x=0&y=0 (Top 2 posts)
and for a very nice scientific viewpoint...
www.garagegames.com/community/blogs/view/15758
It is apparent to me that although the gains are pretty good in places, the data is only for a large amount of objects (starting at 610 runners, each runner being several objects). My issue is the desire to have individual objects being created promptly rather than many objects created quickly (there is a difference... honest!). So on this standpoint I want to know if anyone has done anything similar to this on iTGB and has any data to share?
Also, does anyone have any information (opinion/fact) on how expensive object creation actually is within Torque? I see a lot of conjecture on the net about this topic (in a broader sense than just Torque) and I'm not really sure what to believe :D
#2
05/12/2009 (9:20 am)
The second link was very interesting about removing the objects from the scene graph when their not visible. I'm going to have to remember to do that, I'm not doing that right now for the objects I'm reusing, however the current reusable objects are low in count and are frequently used so I'll probably keep it that way for now. However when I start adding items that are highly dynamic and large in count I'll be sure to remember that.
Torque Owner Bret Patterson