Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old June 26th, 2007, 04:50 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
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...
  #12 (permalink)  
Old August 22nd, 2007, 02:06 PM
Registered User
 
Join Date: Aug 2007
Location: , , .
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.

  #13 (permalink)  
Old August 22nd, 2007, 02:09 PM
Registered User
 
Join Date: Aug 2007
Location: , , .
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."


  #14 (permalink)  
Old November 8th, 2007, 05:25 PM
Registered User
 
Join Date: Nov 2007
Location: , , .
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)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.