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
  #1 (permalink)  
Old May 26th, 2007, 04:25 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Pong and Breakout weird jerk moves.

I finished now the chapter 2, and after trying the breakout game, I notice that the ball and paddle sometimes make some weird jerk moves. And that was also happening with the Pong game.
Why this is happening?

  #2 (permalink)  
Old May 29th, 2007, 08:09 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe youve got a slow PC??

  #3 (permalink)  
Old May 29th, 2007, 03:44 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

The framerate might be too high or too low. You can fix it by setting a fixed framerate in the Initialize method, maybe that helps. The first couple of games were developed really rapidly, the later games should work better.

http://abi.exdream.com
  #4 (permalink)  
Old May 30th, 2007, 07:23 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Zulbaric, my machine is not a slow one.

abi.exdream.com, I just tried the xna shooter and racer and I still see the same problem, but with so much intensity as the pong and breakout games.

  #5 (permalink)  
Old June 14th, 2007, 07:14 AM
Registered User
 
Join Date: Jun 2007
Location: Brisbane, Qld, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to glenncottrell
Default

I too noticed this occasional jerking of game movement and tracked it down to spikes in the elapsed time.

moveFactorPerSecondTotal: 0.008294599 : 16.5892
moveFactorPerSecond: 0.008 : 16
moveFactorPerSecondTotal: 0.0078088 : 15.6176
moveFactorPerSecond: 0.008 : 16
moveFactorPerSecondTotal: 0.0167239 : 33.4478 <-
moveFactorPerSecond: 0.008 : 16
moveFactorPerSecondTotal: 0.0167239 : 33.4478 <-
moveFactorPerSecond: 0.008 : 16
moveFactorPerSecondTotal: 0.00822645 : 16.4529
moveFactorPerSecond: 0.008 : 16
moveFactorPerSecondTotal: 0.00827825 : 16.5565
moveFactorPerSecond: 0.008 : 16

So from this I simply changed the following
Code:
//float moveFactorPerSecond = 0.5f * (float)gameTime.ElapsedRealTime.TotalMilliseconds / 1000.0f;
float moveFactorPerSecond = 0.5f * (float)gameTime.ElapsedGameTime.Milliseconds / 1000.0f;


  #6 (permalink)  
Old June 15th, 2007, 05:42 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That didn't help.

  #7 (permalink)  
Old June 26th, 2007, 07:42 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Has anyone else had this problem and managed to fix it?
Like the original poster, all the projects move quite jerkily.
I've not got a slow computer.
I tried Glenns idea - Better, but still jerks.

Maybe the framerate's the way to go, but I'd like a way of setting that up per PC configuration? Otherwise it would look great on my pc, but rubbish on others.

Other than this, everything's working brilliantly, and can't wait to knock up my own game with the engine!

Cheers,
Tom.
  #8 (permalink)  
Old June 26th, 2007, 11:05 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tom,

a bit of a spill over from my other post on blank screens but I am curious... when you say "other than that everything is working brilliantly" are you including the XBox 360 too? Because I agree everything is working very well on Windows (I see the issue with some jerkiness too, notwithstanding) but on the XBox I can't get the games to work for the reasons explained in my other post...

thanks for your comments.
  #9 (permalink)  
Old June 26th, 2007, 11:57 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah... no.
Afraid I don't own a 360 yet. I was planning on seeing how far I got with my game before splashing out on that.
I was hoping Ben would have had some time to look at this problem.
Ah well, maybe I'll actually look at it myself instead!

Tom.

  #10 (permalink)  
Old June 26th, 2007, 01:42 PM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I too am having the same problem, and the suggestion I get the most is to check the game's framerate. Any clue on how to do that???
 


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 04:23 AM.


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