Advertisement



Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions

New Member?



 
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related.

Reply
 
LinkBack Thread Tools
Old 07-31-2008, 10:49 AM   #1 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
Default Display FPS


Im sorry if this has already been addressed, but is it possible to display the FPS of a game. I now use GameTimeElapsedMiliseconds, i think thats it, im at work right now.. Its the miliseconds since last gamke update. I divide 1 by that number. I question this method, as I get 59.99 on the zune as well as my pc on my asteroids game, and Im wondering how that can be.

Thanks.



__________________
~Shutout5591~

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

If you like me work or I have helped you, + Rep me!

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




shutout5591 is offline   Reply With Quote
Old 07-31-2008, 02:26 PM   #2 (permalink)
you lost the game.
zB Programmer
Section Staff
Zune Freak
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 1,216
Reputation: 460
Awards Showcase
Best username 
Total Awards: 1
Default

VSync defaults to on for all XNA platforms, and it can't be disabled on the Zune. The Zune 30 has a refresh rate of 60 Hz, while the second gen Zunes have a 30 Hz refresh rate instead. Most monitors refresh at 60 Hz too.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

signature by
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




itsnotabigtruck is online now   Reply With Quote
Old 08-02-2008, 07:03 AM   #3 (permalink)
Jr. Member
 
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
Default

Oh, so the zune really does get 60 fps on my game? Im a gamer, so I know all about VSync, so I understand teh code may get over 60, but it is limited to 60 to prevent tearing, and frames being rendered but not displayed.

Any reason why they made the refresh rate at 30 for zune 2s?
__________________
~Shutout5591~

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

If you like me work or I have helped you, + Rep me!

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




shutout5591 is offline   Reply With Quote
Old 08-02-2008, 09:12 AM   #4 (permalink)
you lost the game.
zB Programmer
Section Staff
Zune Freak
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 1,216
Reputation: 460
Awards Showcase
Best username 
Total Awards: 1
Default

Quote:
Originally Posted by shutout5591 View Post
Oh, so the zune really does get 60 fps on my game? Im a gamer, so I know all about VSync, so I understand teh code may get over 60, but it is limited to 60 to prevent tearing, and frames being rendered but not displayed.

Any reason why they made the refresh rate at 30 for zune 2s?
To save battery power.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

signature by
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




itsnotabigtruck is online now   Reply With Quote
Old 08-02-2008, 10:20 AM   #5 (permalink)
Jr. Member
 
Link9228's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 389
Reputation: 25
Send a message via MSN to Link9228
Default

Whenever I added a FPS counter to my game on my zune, I was able to get over the 59.99 FPS by using these two lines of code.

//Do not synch our Draw method with the Vertical Retrace of our monitor
graphics.SynchronizeWithVerticalRetrace = false;
//Do not call our Update method at the default rate(1/60 of a second).
IsFixedTimeStep = false;

if i dont use them i get 59.99 or .98 or w/e, but i can get over 100 with these two things set to false.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Link9228 is offline   Reply With Quote
Old 08-02-2008, 01:39 PM   #6 (permalink)
Purger of Ignorance
zB Programmer
Section Staff
Super Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 1,670
Reputation: 231
Send a message via MSN to Netrix
Awards Showcase
Favorite zB Extremity 
Total Awards: 1
Default

Quote:
Originally Posted by Link9228 View Post
Whenever I added a FPS counter to my game on my zune, I was able to get over the 59.99 FPS by using these two lines of code.

//Do not synch our Draw method with the Vertical Retrace of our monitor
graphics.SynchronizeWithVerticalRetrace = false;
//Do not call our Update method at the default rate(1/60 of a second).
IsFixedTimeStep = false;

if i dont use them i get 59.99 or .98 or w/e, but i can get over 100 with these two things set to false.
What is the point of drawing more times? It is a complete waste of battery power. What I did for my Solitaire is make it not draw unless there was a reason to draw. That way, it does not run thousands of lines of code per second to do nothing useful.

However, having the update method run more times per second is useful in some cases, but still uses more battery power.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune!
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Zune Book Reader!
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Netrix is offline   Reply With Quote
Old 08-02-2008, 10:00 PM   #7 (permalink)
Jr. Member
 
Link9228's Avatar
 
Join Date: Nov 2007
Location: Pennsylvania
Posts: 389
Reputation: 25
Send a message via MSN to Link9228
Default

You raise a good point, and i suppose that it's not really important having those two lines. I'll take them out for the next release, and i guess it'll eat less battery.
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Link9228 is offline   Reply With Quote
Old 08-03-2008, 02:44 AM   #8 (permalink)
zB Programmer
Jr. Member
 
DiNoGames's Avatar
 
Join Date: May 2008
Location: Bremen, germany
Posts: 454
Reputation: 246
Send a message via Skype™ to DiNoGames
Default

Quote:
Originally Posted by shutout5591 View Post
Im sorry if this has already been addressed, but is it possible to display the FPS of a game. I now use GameTimeElapsedMiliseconds, i think thats it, im at work right now.. Its the miliseconds since last gamke update. I divide 1 by that number. I question this method, as I get 59.99 on the zune as well as my pc on my asteroids game, and Im wondering how that can be.

Thanks.
Just to clearify:

Doing this in the Update method does not give correct results. XNA code takes care of calling this method 60 times per second, if there is not enough CPU power to call it that often, it interpolates all calculations to give steady gamemovement.

You need to calculate the FPS in the draw method, where the drawing of a frame actually is done (you want to calc frames per seconds, not updates per second).
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.







DiNoGames is offline   Reply With Quote
Old 08-03-2008, 05:05 AM   #9 (permalink)
Purger of Ignorance
zB Programmer
Section Staff
Super Zuner
 
Netrix's Avatar
 
Join Date: Jun 2008
Location: In my own world
Posts: 1,670
Reputation: 231
Send a message via MSN to Netrix
Awards Showcase
Favorite zB Extremity 
Total Awards: 1
Default

Quote:
Originally Posted by Link9228 View Post
You raise a good point, and i suppose that it's not really important having those two lines. I'll take them out for the next release, and i guess it'll eat less battery.
I am not trying to shoot down what you found. Thank you for sharing it with us. I was not aware of the specific properties that needed to be changed in order to remove the limit for drawing and updating. It is just that on the Zune, it does use up more battery and should not really be done unless there is a good reason to. The Zune 30 will only display 60 frames maximum per second, even if you have those lines in there. The second generation Zunes will display a maximum of 30 frames per second. That is what I am sure of.

I think that if you have those lines in there, the Zunes will try to use all of its CPU power to run the draw and update functions as much as possible. So theoretically, if your game already runs under 60 frames per second on the Zune 30 (lags), having those lines of code in there should have no real effect. That means it would not use up more battery power, because the Zune is already working as hard as it can already. However, that would also mean that those lines are useless.

If anyone with more knowledge about this notices anything that I have said is incorrect, please say so. It is just what seems logical to me from what I know.
__________________
"Against logic there is no armor like ignorance." - Laurence J. Peter

Solitaire for your Zune!
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


Zune Book Reader!
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.




Netrix is offline   Reply With Quote
Reply


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -8. The time now is 07:44 PM.

 
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC8
vB Ad Management by =RedTyger=
(C) ZuneBoards 2006-2007
Copyright © 2006 - 2008 Zune Boards | About Zune Boards | Legal | A member of the Crowdgather Forum Community