XNA Creators Club Online
Page 1 of 1 (10 items)
Sort Posts: Previous Next

Game running slow on XBOX 360

Last post 12/06/2009 4:18 by o KB o. 9 replies.
  • 01/06/2007 3:06

    Game running slow on XBOX 360

    Hi!

    I've got a 1.86 GHz Pentium M with 1.5GB Ram and a ATI Mobility FireGL V3200 (128MB, 128bit interface, 12.8 GB/s Memory Bandwidth, 2 vertex-pipes 4 pixel-pipes )

    On my Laptop, the game is running smooth arround 85-90 fps. On the XBOX however, it's arround 20-25 fps. Is this normal? If not - what could be the problem? could it have anything to do with one of these two problems:

    https://forums.xna.com/thread/11328.aspx
    https://forums.xna.com/ShowThread.aspx?PostID=11534

    ??

    Please help me - We have to present the game on next tuesday and it would be quite important to have it running on the XBOX...


    Thanks a lot!

  • 01/06/2007 8:41 In reply to

    Re: Game running slow on XBOX 360

    I also had serious performance problems on the 360 and found 2 things which really saved me:

    • Make sure that any tight loops which pass structs around do so by ref rather than by value.  I had some by-value passing in my collision code which runs frequently and replacing everything by ref gave me some serious performance boosts.
    • Run the CLR profiler.  This is probably causing even more of a problem.  The garbage collector on the 360 is not as efficient as on the PC.  Once I reduced nearly all of my runtime heap allocations my application ran incredibly smooth.
    --Vic--
    www.FlatRedBall.com
    Cross-platform game engine (XNA, Silverlight, MDX)
  • 10/06/2009 1:28 In reply to

    Re: Game running slow on XBOX 360

    Hey Jusy,

    I also have the same problem, where I hit a framerate of ~130fps on PC and around ~40fps on the XBOX.

    Using the Remote Performance Monitor for the XBOX, after 1 min of running time, I had:
    - Garbage Collections: 50
    - GC Latency Time (ms): 478

    My major problem is in the Garbage Collector.

    so here's the architecture of my game engine:
    - In the Initialize() method of the XNA Game, I create my Game and Initialize it which performs the following:
        // Init the sounds of the game
                InitSounds();
                // Init the models supported
                InitLoaders();
                // Init the Graphics Engine which creates all the supported shaders effects
                InitGraphicsEngine();
                // Init the physics engine
                InitPhysicsEngine();
                
        // Init the levels, here I'm allocating once all the objects (enemies, items, etc...) for the whole level, I guess they are being allocated on the heap, right?
                 InitLevels();

    So my question is: How do I reduce the runtime allocations? I can't allocate the objects at offline, right?

    Thanks in advance for the help!

    Available Now: Galactic Escape

  • 10/06/2009 4:24 In reply to

    Re: Game running slow on XBOX 360

    50 GCs for 60 seconds is horrendous, I'm not sure how you can be getting even 40 fps.

    My advice would be to run the CLR profiler on a Windows version of your game, if at all possible. The way you allocate your objects won't be different between the two platforms (unless you are going out of your way to make it so), so the windows version will still show you the areas where the most objects are allocated, what those are, and where you should focus your efforts. Hopefully you'll find a few places where you can do some one-time allocations and see a significant speed up.
    www.dadoogames.com
    Curling 2010 - in playtest soon, this month or next, this year for sure (maybe)
  • 11/06/2009 1:11 In reply to

    Re: Game running slow on XBOX 360

    The text was actually ambiguous. Was it 50 GCs a minute or 50 GCs total at that point? It really doesn't hurt anything if your menus and game initiation steps are causing GCs since framerate isn't a big deal at that time, but 50 GCs over the course of a gameplay minute is something to look into.
  • 11/06/2009 3:58 In reply to

    Re: Game running slow on XBOX 360

    MrLeebo:
    The text was actually ambiguous. Was it 50 GCs a minute or 50 GCs total at that point? It really doesn't hurt anything if your menus and game initiation steps are causing GCs since framerate isn't a big deal at that time, but 50 GCs over the course of a gameplay minute is something to look into.

    Yeah actually it's a bit less now, so after I load my game (levels and everything), I see right away 46 GCs on the RPM.

    So I guess the 46 initial GCs are during the loading time, but afterwards, I'm getting some increase during time, right? (because I felt that the RPM app shows you the statistics from the start of you application till the end by incrementing the numbers rather than displaying them for every frame. Please correct me if I'm wrong).

    I watched the numbers and saw the following:
    - The GCs' number goes up by 1 every 10 seconds --> 6 GC's/1 min
    - And the "GC Latency Time (ms)" field is increasing by ~11 or 12ms when the collection occurs --> so I think that 1 GC is taking 12ms, right?

    So it seems that I got it right that the RPM app is increasing the numbers (statistics) and never resetting them, correct?

    If that's the case I should be fine that every 10 seconds, I skip 12ms which is less than 1 frame (16.6667ms), right?

    Thanks for helping me understand, because I really need to know where's my performance problem so I can optimize :)!

    Available Now: Galactic Escape

  • 11/06/2009 18:30 In reply to

    Re: Game running slow on XBOX 360

    o KB o:
    - The GCs' number goes up by 1 every 10 seconds --> 6 GC's/1 min
    - And the "GC Latency Time (ms)" field is increasing by ~11 or 12ms when the collection occurs --> so I think that 1 GC is taking 12ms, right?


    Yep. Those numbers look fine, so GC is not your problem.

    This talk has some info that might be useful. I would start by making sure you aren't doing any of the Really Bad Things (tm), such as reading renderstate values back from the GPU, or using StateBlock or SaveStateMode. Once you eliminate those possibilities, use a Windows profiler (eg. NProf) to find out where your CPU time is being spent in the Windows version of your game, then try to speed up whatever methods it shows as the hotspots.
    XNA Framework Developer - blog - homepage
  • 11/06/2009 21:05 In reply to

    Re: Game running slow on XBOX 360


    using StateBlock

    Why would using StateBlock be slow, assuming you configure it once and use it many times?
    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 11/06/2009 21:19 In reply to

    Re: Game running slow on XBOX 360

    The D3DX stateblock implementation is inefficient even on Windows, but spectacularly inefficient on Xbox.
    XNA Framework Developer - blog - homepage
  • 12/06/2009 4:18 In reply to

    Re: Game running slow on XBOX 360

    Shawn Hargreaves:

    This talk has some info that might be useful. I would start by making sure you aren't doing any of the Really Bad Things (tm), such as reading renderstate values back from the GPU, or using StateBlock or SaveStateMode. Once you eliminate those possibilities, use a Windows profiler (eg. NProf) to find out where your CPU time is being spent in the Windows version of your game, then try to speed up whatever methods it shows as the hotspots.

    Thanks a lot for the link to the GDC2008, it helped me a LOT :D!

    I used the NPerf to measure my methods and noticed that the method that was settings the Effect params was taking most of the time, due to the fact that I was using:
    effect.Parameters["...."].SetValue

    So I created EffectParameters in my effect and go the parameters at init time, then at each loop I used the EffectParameter to set them! so this gave me a boost of ~20fps!!

    Then I did some Camera to Object culling that gave me a boost in perf as well.

    So now I'm at 65->85fps through the whole level!

    Thanks again!

    Available Now: Galactic Escape

Page 1 of 1 (10 items) Previous Next