Search code examples
c#windows-phone-7xnaxbox360

Poor performance on 360 and WP7


I've just got my 2D sprite game running on the 360 and WP7 and it's far slower on these than the Windows counterpart. The FPS is about a frame a second, but on windows its smooth. I'm using Farseer the latest version in this. Is there anything on these two platforms that could cause such a drastic slowdown?

Thanks in advance.


Solution

  • Yes. There are DEFINITELY things on those two platforms that can cause significant slowdowns. The CLR on the 360 and WP7 have much slower garbage collectors than on the PC. As a result, performance on those two platforms can vary dramatically. A game running at 60 fps on the PC can slow to a 1-2 fps second crawl on those platforms.

    There are a lot of resources out there for trouble-shooting and optimizing your code to gain the same FPS across all three platforms. Here are the ones I would recommend.

    First, check out Shawn Hargreave's article on "How to tell if your Garbage collection is too slow" That will first answer whether that is what you are seeing.

    Then hit Ian Nicolades article on "High End Performance Optimizations for Xbox360 and WP7" There is a lot of good advice, tips and tricks in that article. Most of which should help clear up any current performance issues you're having.

    There's also some good posts here on Stack Overflow I'd recommend you peruse: Game Jitters on xBox360 XNA game performance

    Also for some good reading, the .NET Compact framework team (both WP7 and the 360 run a modified version of the compact framework) have some oldie but goodie articles on Managed Code Performance on the Xbox 360 Part1 & Part2

    There's also some great articles on this from the guys in the trenches. People who have previously released games on the 360 and WP7. Here's one of my favorites from Kris Steele who has released games on multiple platforms with XNA called "Optimizing Code for Xbox XNA Games is required".

    And then last but not least, there are a TON of posts on the App Hub forums covering all areas of performance from WP7 to Xbox performance. The unfortunate thing is that the search on the App Hub isn't too great, but the posts are there and offer all sorts of tips/tricks and advice on how to find and improve your games performance on those platforms.