Game Development Community

Horrible drop in performance with TX CEV 4.0 as compared to CEV 3.1.5 [Xbox 360 mostly]

by Jacob Lynch · in Torque X 2D · 02/26/2011 (4:29 pm) · 4 replies

Since the deadline passed to release games using XNA 3.1, I've decided to incorporate version 4.0 of the TX CEV into our project. First of all, thanks to everyone who made it possible to use TX with XNA 4.0, I certainly appreciate your efforts!

Unfortunately I've noticed a large drop in performance (FPS) since upgrading, and I'm just trying to track down how to fix it. The way I measured this drop was as follows:

Create a new 3.1.5 TX project, update the references to point to the release version of TX 3.1.5 CEV, add 336 static sprites (no components, collisions disabled, just picked an arbitrary number of sprites), add a small bit of code to print out the FPS and add the gamer services component, and deploy it to the Xbox 360 and start it up. I am seeing a steady 60-61 FPS, and I can move the little TX icon around smoothly.

Next, create a new 4.0 TX project (by upgrading from the 3.1.5 TX project), update the references to point to the release version of TX 4.0 CEV, using all the same code/txscenes deploy to the Xbox 360. I am seeing a steady 24-26 FPS, and moving the little TX icon around is sluggish.

In my real project I don't usually have this many sprites on the screen at once, but the performance drop is still very noticeable. Does anyone have any idea what might cause this or how I can fix it?

Thanks a bunch!

Edit: Just remembered, it's also noticeable to a lesser extent on the PC but I get higher framerates on the PC so I haven't been concerned with it. I drop from around 550 FPS to around 386 FPS with the same txscenes on PC.

Also, I have made some changes to my engine that aren't part of the baseline so I was curious if anyone else could duplicate this issue. If you're not seeing it, please let me know, and I'll try again with the version that's checked in to SVN. Thanks!

Second edit: I just double checked it with the baseline version of 4.0, and I'm seeing the same 24-26 FPS on the Xbox 360 with those libraries as well.

#1
02/26/2011 (6:39 pm)
Hey Jacob, sounds like your hitting the same issues as I was with my high number of sprites. Most recent build has an alternative sorting method (see my old thread)

The main bane of the 3.1 to 4 seems to be the drop in FPS; think its gonna be a toughie to crack, but if done will be a boon.
#2
02/26/2011 (6:42 pm)
Hoddie,

I wasn't sure if this was the same thing or not, thanks. I am using the most recent build (with Pino's suggested sorting order fix), but I'm still seeing the same numbers. It seems odd that it dropped so drastically from 3.1 to 4.0. Is this something that Microsoft changed or the way we implemented 4.0, do you think?
#3
02/26/2011 (6:54 pm)
I'm no pro, but I wouldn't say its anything radically different in XNA4. Matt H had noticed Bins cleaning was a major drain on his resources and thus the bins cleaning functions were implemented, having only rooted around the Core and main engine a little myself, it seems a "throwback" to the engines design. For example I got 1000 plus sprites on a raw XNA build using a simple SpriteBatch and moving sprites around (unanimated, static) but using TX 3.1 and 4 they seem to do something altogether different with its SpriteBatch-ing.

I've been stuck at this wall for a looong time kinda skirting round it hoping someone else may find the cause but I guess I have to roll my sleeves up and get learning the core aspects of the engine and see what could be done to improved.
#4
02/27/2011 (7:12 am)
One newer thing in the CEV is rendering of particles effects that are offscreen (because off screen particle generators can still end up with their particles getting onscreen). The current implementation of this takes a fair few CPU cycles just looking for particle effects to render (even if you have none in your game). If you don't need that feature then you can disable it. I doubt you'll see a massive increase, but it will give you a bit more CPU to play with.