Timing issues

Last post 05-09-2008, 9:50 AM by spinor. 2 replies.
Sort Posts: Previous Next
  •  05-09-2008, 7:18 AM

    Timing issues

    I'm currently working on a top down shooter game, and the speed I move the objects at is scaled by gameTime.ElapsedGameTime.Milliseconds to make sure they move at a constant speed independent of the framerate.  However, sometimes there are stutters and they don't always seem to move at a constant speed.  I thought this could be cause by sudden drops in the framerate so I tried smoothing the value with previous frametimes, but this still does not give the desired result.  I also remember reading somewhere that GameTime is not very accurate on the Xbox360 so I tried to use DateTime.UtcNow.Ticks instead, but this does not seem to make any difference at all.  Any thoughs on this issue would be greatly appreciated.

    Regards,
    Dennis

  •  05-09-2008, 7:44 AM

    Re: Timing issues

    This thread may help.  It's also possible that stuttering is a result of garbage collection, so make sure you're not repeatedly creating and deleting a lot of reference types.
  •  05-09-2008, 9:50 AM

    Re: Timing issues

    Thanks! I'll give TotalMilliseconds a shot.
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback