Torque X performance: Intel GMA 4500MHD outperforms XBox 360
by Mathias Kahl · in Torque X 3D · 02/19/2010 (8:05 pm) · 7 replies
Good evening!
I'm experiencing very serious performance issues with Torque X on XBox 360.
Right now I'm developing a RTS game based on Torque X on my Laptop:
Intel Core 2 Duo P8600 2.4GHz
2.0GB, DDR2-800 SDRAM, 2 DIMMS
Mobile Intel® Graphics Media Accelerator 4500MHD
For testing I also use my desktop computer:
Intel Core 2 Duo 2.4Ghz
4.0GB DD2-800 SDRAM
ATI Radeon HD4870
For testing purposes I set up a little test project where I can spawn
any number of assets in fixed positions. I ran this exact same program
on my laptop, my desktop computer and my xbox 360:
The scene is the same in every case:

It consists of 56 animated DTS models, each having 5 textures.
The poly and mesh count seem not to be right. In 3DSMax the displayed
model has round about 800 polygons. I count polygons like this:
Anyway, even if this model had that much polygons, that's not the problem.
The problem is that my laptop's onboard graphics chip outperforms my
high end gaming console...
Does anyone have an idea as to how the hell this is even possible?
Something here goes terribly wrong.
In this test scenario I create one template of a unit (the building) like this:
Subsequently I spawn 55 copies of this unit component:
If anyone has an idea why the performance on xbox 360 is so terrible, I'd appreciate any hint.
Thanks very much in advance!
I'm experiencing very serious performance issues with Torque X on XBox 360.
Right now I'm developing a RTS game based on Torque X on my Laptop:
Intel Core 2 Duo P8600 2.4GHz
2.0GB, DDR2-800 SDRAM, 2 DIMMS
Mobile Intel® Graphics Media Accelerator 4500MHD
For testing I also use my desktop computer:
Intel Core 2 Duo 2.4Ghz
4.0GB DD2-800 SDRAM
ATI Radeon HD4870
For testing purposes I set up a little test project where I can spawn
any number of assets in fixed positions. I ran this exact same program
on my laptop, my desktop computer and my xbox 360:
+---------+-----------+--------------+ | Device | fps Debug | fps Release | +---------+-----------+--------------+ | Laptop | 25 | 28 | | XBox | 10 | 11 | | Desktop | 55 | not measured | +---------+-----------+--------------+
The scene is the same in every case:

It consists of 56 animated DTS models, each having 5 textures.
The poly and mesh count seem not to be right. In 3DSMax the displayed
model has round about 800 polygons. I count polygons like this:
meshCount = renderComponent.Shape.Meshes.Length;
foreach (Mesh mesh in renderComponent.Shape.Meshes)
{
polyCount += mesh.GetNumPolys();
}Anyway, even if this model had that much polygons, that's not the problem.
The problem is that my laptop's onboard graphics chip outperforms my
high end gaming console...
Does anyone have an idea as to how the hell this is even possible?
Something here goes terribly wrong.
In this test scenario I create one template of a unit (the building) like this:
public class UnitComponent : TorqueObject, IAnimatedObject, GarageGames.Torque.Util.ObjectPooler.IResetable
//...
public UnitComponent(String unitTypeDescriptorPath, String modelPath) : this()
{
sceneComponent = new T3DSceneComponent();
sceneComponent.SceneGroup = Name;
sceneComponent.Visible = false;
Components.AddComponent(sceneComponent);
//TODO: Eventuell AnimationComponent nur erzeugen, wenn benötigt
animationComponent = new T3DAnimationComponent();
animationComponent.SceneGroupName = Name;
Components.AddComponent(animationComponent);
renderComponent = new T3DTSRenderComponent();
renderComponent.SceneGroupName = Name;
Components.AddComponent(renderComponent);
currentAnimation = null;
TorqueObjectDatabase.Instance.Register(this);
FileInfo modelFile = new FileInfo(modelPath);
// Die Einheit aus der XML-Beschreibung laden
UnitType unitType = Serialisation.LoadFromXML<UnitType>(unitTypeDescriptorPath);
this.Unit = new Unit(unitType);
// Die Einheit wird durch ein DTS-Modell in der 3D-Szene dargestellt
renderComponent.ShapeName = modelPath;
meshCount = renderComponent.Shape.Meshes.Length;
foreach (Mesh mesh in renderComponent.Shape.Meshes)
{
polyCount += mesh.GetNumPolys();
}
// Animationen laden, wenn benötigt
if (unitType.IsAnimated)
{
foreach (String name in unitType.Animations)
{
string[] parts = name.Contains(":") ? name.Split(':') : (new string[] { name });
String dsq = parts.Length > 1 && parts[1].Length > 0 ? parts[1] : (name + ".dsq");
String sequenceName = parts.Length > 1 ? parts[0] : name;
String threadName = parts.Length > 2 ? parts[2] : "ActionThread";
TSAnimation animation = new TSAnimation();
animation.ThreadName = threadName;
animation.SequenceName = sequenceName;
animation.Name = sequenceName;
// Möglicherweise ist die Animation in einer DSQ gespeichert
String sequenceFile = modelFile.DirectoryName + "" + dsq;
if (File.Exists(sequenceFile))
{
animation.SequenceFilename = sequenceFile;
}
animationComponent.AddAnimation(animation);
}
ProcessList.Instance.AddAnimationCallback(this);
}
}Subsequently I spawn 55 copies of this unit component:
public UnitComponent Spawn(String name, Vector3 pos)
{
if (!_templates.Contains(name))
{
Assert.Fatal(false, "Einheit '" + name + "' ist unbekannt und konnte nicht gespawnt werden");
}
UnitComponent template = (UnitComponent)_templates[name];
UnitComponent spawn = (UnitComponent)template.CloneT();
spawn.Position = pos;
spawn.Visible = true;
TorqueObjectDatabase.Instance.Register(spawn);
unitCount++;
polyCount += template.PolyCount;
meshCount += template.MeshCount;
return spawn;
}If anyone has an idea why the performance on xbox 360 is so terrible, I'd appreciate any hint.
Thanks very much in advance!
About the author
I'm a student of Computer Science (Freie Universität in Berlin, Germany). Currently I'm working on a multiplayer strategy/action game based on Torque X.
#2
Also, the reason your numbers are off is that the models are converted into Triangle Lists. This doubles your poly count relative to Quads. If you also accidentally checked off double sided during export, that would turn 56, 800 poly models into 179 200 Tris.
02/21/2010 (2:13 pm)
Another issue is Garbage Collection. The Xbox360 handles garbage collection VERY poorly. This means that having a mass amount of references can lead to a very significant loss of speed relative to the PC.Also, the reason your numbers are off is that the models are converted into Triangle Lists. This doubles your poly count relative to Quads. If you also accidentally checked off double sided during export, that would turn 56, 800 poly models into 179 200 Tris.
#3
Even though my laptop is relatively new: it's an on-board graphics chipset that barely is able to render warcraft 3 on low settings fluently, while the XBox 360 is running games like Gears of War. So I don't let this count. Of course the optimizations are probably one factor. However, I would have imagined that the engine creators took this into account when they developed the xbox 360 support. Obviously this is not the case. And even though its processors are relatively old, there are still 3 of them with 3.2 GHz clock speed. Of course you have to consider their RISC architecture, but anyway.
When it comes to garbage collection, that very well might be a problem. Especially since afaik XBox 360 is only implementing the Compact framework. However, I think this is not a problem in my application (at least in my own code), since I only create these units once in the beginning and only 56 of them, which aren't used any more afterwards. Basically everything I do is passing the render instances to the engine.
By the way I couldn't find a double side option in the dts exporter other than "enable double sided materials", which after a bit of testing proofed to be of no relevance whatsoever.
At least I found one major performance issue with my models (which by the way I did not create myself): Each single one consists of 25 meshes and 5 textures. In a XNA book I once read the models were rendered using BasicEffect and a loop that drew each mesh indivudally. That's why I figured that fewer meshes would actually be better. So I collapsed the whole model into one "big" mesh, which effectively doubled the performance under the same test conditions. That means my laptop rendered the scene with 45 fps (compared to 25) and the xbox rendered it with 19 fps (compared to 10).
Of course the elementary problem is still there: My laptop is faster than my xbox.
So I again thank you for your hints so far. I will take a closer look into the engine code now to find possible weak spots considering Xbox 360's hardware architecture.
For those who are interested, there is a interesting presentation entitled "Xbox 360 System Architecture" by Jeff Andrews and Nick Baker of the Xbox Semiconductor Technology Group to be found at www.hotchips.org/archives/hc17/3_Tue/HC17.S8/HC17.S8T4.pdf
02/21/2010 (3:49 pm)
Thank you very much for your answers! Even though my laptop is relatively new: it's an on-board graphics chipset that barely is able to render warcraft 3 on low settings fluently, while the XBox 360 is running games like Gears of War. So I don't let this count. Of course the optimizations are probably one factor. However, I would have imagined that the engine creators took this into account when they developed the xbox 360 support. Obviously this is not the case. And even though its processors are relatively old, there are still 3 of them with 3.2 GHz clock speed. Of course you have to consider their RISC architecture, but anyway.
When it comes to garbage collection, that very well might be a problem. Especially since afaik XBox 360 is only implementing the Compact framework. However, I think this is not a problem in my application (at least in my own code), since I only create these units once in the beginning and only 56 of them, which aren't used any more afterwards. Basically everything I do is passing the render instances to the engine.
By the way I couldn't find a double side option in the dts exporter other than "enable double sided materials", which after a bit of testing proofed to be of no relevance whatsoever.
At least I found one major performance issue with my models (which by the way I did not create myself): Each single one consists of 25 meshes and 5 textures. In a XNA book I once read the models were rendered using BasicEffect and a loop that drew each mesh indivudally. That's why I figured that fewer meshes would actually be better. So I collapsed the whole model into one "big" mesh, which effectively doubled the performance under the same test conditions. That means my laptop rendered the scene with 45 fps (compared to 25) and the xbox rendered it with 19 fps (compared to 10).
Of course the elementary problem is still there: My laptop is faster than my xbox.
So I again thank you for your hints so far. I will take a closer look into the engine code now to find possible weak spots considering Xbox 360's hardware architecture.
For those who are interested, there is a interesting presentation entitled "Xbox 360 System Architecture" by Jeff Andrews and Nick Baker of the Xbox Semiconductor Technology Group to be found at www.hotchips.org/archives/hc17/3_Tue/HC17.S8/HC17.S8T4.pdf
#4
02/21/2010 (5:45 pm)
You may also want to look at the sizes of the textures - Make them as small as possible, and group all of them into a single texture.
#5
Anyway. A few minutes ago I was messing around with the graphics resolutions: 640x480, 1280x720 and 1920x1080. While on my laptop it showed dramatical performance differences, on the xbox the fps was constantly 19 at any resolution! That's very interesting and suprising.
Not knowing too many of the technical details yet, I would assume that this points to a problem that is not directly related to the graphics adapter, but rather to the CPU or FSB (data transfer).
Another thing I want to try next is implementing mesh instancing to see how this affects performance.
02/21/2010 (9:09 pm)
Thanks for the hint. As I inspected the textures the model used I discovered that not only were it 5 for one small model, but also having resolutions of 512x512, 640x640 and 1024x1024! I reduced their sizes to 128x128 each. However, that didn't make a too great difference on my laptop: A raise of 3 fps (45 to 48) at average. I couldn't test it on the xbox yet. Anyway. A few minutes ago I was messing around with the graphics resolutions: 640x480, 1280x720 and 1920x1080. While on my laptop it showed dramatical performance differences, on the xbox the fps was constantly 19 at any resolution! That's very interesting and suprising.
Not knowing too many of the technical details yet, I would assume that this points to a problem that is not directly related to the graphics adapter, but rather to the CPU or FSB (data transfer).
Another thing I want to try next is implementing mesh instancing to see how this affects performance.
#6
So, I think it is more of a architectural difference than poor coding for the Xbox especifically.
Anyway, if you use "pure XNA" you will not be nearly as penalized as you are going to be with Torque X. It is just the weight of the engine.
02/24/2010 (1:05 pm)
Mathias, I have a similar problem with my game, in Torque X 2D. The thing is: I am able to move smothly around the screen, with the same texture, as many as 100 objects using all kinds of effects (like normal maps). But my Xbox chokes with 20+ objects using different textures and no effect. The contrary occurs when I play on my PC.So, I think it is more of a architectural difference than poor coding for the Xbox especifically.
Anyway, if you use "pure XNA" you will not be nearly as penalized as you are going to be with Torque X. It is just the weight of the engine.
#7
My code for rendering looks like this:
It seems you cannot expect the XNA framework itself to perform equally well on windows and xbox 360. I suppose you really have to optimize especially for xbox 360 yourself (However this can be done).
As soon as I got time again I will try writing my own shader instead of using the BasicEffect class to see how it performs on both platforms and which factors make a difference.
02/25/2010 (7:02 am)
Are you sure Diego? I'm not very familiar with XNA, but I just tried to recreate the scenario with pure XNA (using BasicEffect to render) and I got similar results. Basically the XBox again rendered only roughly at half the fps (I tried with various models with different polycounts, number of textures and meshes).My code for rendering looks like this:
public void Draw(Camera camera)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyBoneTransformsTo(transforms);
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.Projection = camera.Projection;
effect.View = camera.View;
effect.World = transforms[mesh.ParentBone.Index] * world;
}
mesh.Draw();
}
}It seems you cannot expect the XNA framework itself to perform equally well on windows and xbox 360. I suppose you really have to optimize especially for xbox 360 yourself (However this can be done).
As soon as I got time again I will try writing my own shader instead of using the BasicEffect class to see how it performs on both platforms and which factors make a difference.
Associate Jaimi McEntire
King of Flapjacks
Otherwise, I can't be too helpful here - sorry.