Saturday, June 12, 2010

Performance Problems

I was on vacation last week and so did not work on the game at all. Before leaving for vaca, I found that there were some severe performance issues with the game on the xbox. I was wondering when this was going to happen. I had to do some testing to determine the cause of the performance problems and found some great help for this from Shawn Hargreaves blog here and here. Basically, XNA comes with a really nifty tool you can use to inspect your games heap when its running on your xbox and view all sorts of metrics on the garbage collector and memory usage. This made it easy to discover that I was putting the garbage collector into overdrive because I had 4 objects per map tile allocated for map scripts. This was far too complex. I limited the map scripts to only 20 sets of 4 per map and that solved the problem. This was much harder to do than to type, but I'm glad it's over with. In addition to this change, I've also added the ability to specify a background image for a map in the map editor.

No comments:

Post a Comment