Wrox Programmer Forums
|
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 26th, 2007, 04:50 PM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think we have some of these issues happening indistinctly on Windows and/or the 360. I get the impression not a lot of people are testing this on the 360 so I will research the console separately since I am programming for the 360 almost exclusively while others are already actively researching the Windows side and report back if I find something meaningful. I must confess I don't see many problems on the Windows side anyway outside of this frame correction and update timing issues. The XBox is handling that fine.

I wonder if some of what we see is related to the XNA refresh since the book was written for the 1.0 version of the framework. I doubt it but it is a possibility. I have had to correct program behavior in Visual Studio after installing it in Vista despite the Vista SP1 patch... so this is not far fetched...
 
Old August 22nd, 2007, 02:06 PM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After reading this blog post: http://blogs.msdn.com/shawnhar/archi...-gametime.aspx

I did a little experiment. One thing that stood out was when he says:
"We will call your Update method exactly 60 times per second
We will call your Draw method whenever we feel like it"

So, I just created a bool called drawCalled. I check for drawCalled in Update and only proceed if it is true (I reset to false). In Draw, I set drawCalled to true. It seemed to help quite a bit.

Note that I haven't experienced this issue on the 360, only on Vista.

 
Old August 22nd, 2007, 02:09 PM
Registered User
 
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just tried a different experiment and it also worked pretty well (again based off what I read in that blog post).

In my Game class, I set IsFixedTimeStep equal to false and things run pretty good now.

-Mark

P.S. In my previous post, I think I meant to use this quote:

"We do the same thing in response to all four causes of slowness:

Set GameTime.IsRunningSlowly to true.
Call Update extra times (without calling Draw) until we catch up.
If things are getting ridiculous and we are too far behind, we just give up."


 
Old November 8th, 2007, 05:25 PM
Registered User
 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was having the same problem with pong, then I changed this

float moveFactorPerSecond = 0.5f * (float)gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0f ;

And now the ball moves right

The original was
float moveFactorPerSecond = 0.5f * (float)gameTime.ElapsedRealTime.TotalMilliseconds / 1000.0f;


Or simple change to

float moveFactorPerSecond = 0.5f * (float)gameTime.ElapsedGameTime.TotalSeconds;

And avoid dividing by 1000.0f to save some processor time (I think)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pong... cshmny BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 October 1st, 2008 09:47 PM
Error Pong? bxrtuff24 BOOK: Professional XNA Programming 2nd Edition ISBN: 978-0-470-26128-6 0 September 28th, 2008 10:33 AM
Export Access Report to Excel - Total column moves rklass BOOK: Access 2003 VBA Programmer's Reference 1 June 9th, 2006 08:50 AM
mouse wheel moves to new record on subform lhedquist Access 7 January 19th, 2006 11:42 AM
Record Pointer moves, do not get current fields jamesf Access VBA 2 August 30th, 2003 12:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.