Game Development Community

100s of objects on screen halves FPS

by Jonathan Mendenhall · in Technical Issues · 12/16/2009 (7:05 pm) · 2 replies

Still very new to Torque, and I am not sure if this is the right place for this question. I have started into trying to create my first game. In this 2D game the creation of about 200 objects (along with 200 text fields) is possible. In the base state on my development computer the game runs at about 200 FPS. After the 200 objects are created it plummets down to 95 FPS, which is still not bad at all. The problem is that I am developing this game to be run on a much weaker computer, with a joke of a video card. In the base state it runs at 15 FPS (which might be acceptable), but it then drops down to 8 FPS.

So, my main concern at this point in time is: How can I create these 200 objects without a 50% drop in FPS? They do not need to have any physics information, they all use the same single image map, and the position for each of the 200 chips is unique, but fixed.

Here is how I am creating them right now in script:


new t2dStaticSprite(betChip @ %betId)
{
scenegraph = $sceneGraph;
imageMap = "ImageMapGrey_Chip";
frame = "0";
canSaveDynamicFields = "1";
position = %position;
size = "49 48";
Layer = "10";
GraphGroup = "21";
BuiltInShaderType = "NONE";
WorldLimitMode = "KILL";
WorldLimitMax = "1366 768";
AutoMassInertia = "0";
CollisionPhysicsSend = "0";
CollisionPhysicsReceive = "0";
CollisionCircleSuperscribed = "0";
};


Thanks in advance for any help, and sorry if this is the incorrect forum for this problem.

#1
12/16/2009 (7:59 pm)
This comes down to practical design ideas. If you are developing a game which targets lower powered hardware, then your design needs to match that target. Its the exact same issue people are facing with iPhone development, you must account for your target platform in the design.

That said, should you expect to have 200 objects in your scene with minimal performance issues? It depends on what the objects are designed to do. In that example there, the World Limit properties are going to be your big performance issue so I would say that 200 of those objects will see a significant drop in framerate. If they are 200 static-do-nothing objects, then that is a completely different story.

For TGB specific information on this issue, you should throw up this question over on the TGB Forums.
#2
12/16/2009 (8:02 pm)
They are static-do-nothing objects, I am just not sure how to let the game know that.

Thanks very much for the reply and the advice. I will try posting my question on those forums.