|
  
|
|
|||||||
| Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
|
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. ![]() |
|
|
|
|
|
#2 (permalink) |
|
you lost the game.
zB Programmer
Section Staff Zune Freak Join Date: May 2008
Posts: 1,216
Reputation: 460
|
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. ![]() |
|
|
|
|
|
#3 (permalink) |
|
Jr. Member
Join Date: Jun 2007
Location: Mass
Posts: 312
Reputation: 78
|
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. ![]() |
|
|
|
|
|
#4 (permalink) | |
|
you lost the game.
zB Programmer
Section Staff Zune Freak Join Date: May 2008
Posts: 1,216
Reputation: 460
|
Quote:
__________________
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. ![]() |
|
|
|
|
|
|
#5 (permalink) |
|
Jr. Member
Join Date: Nov 2007
Location: Pennsylvania
Posts: 389
Reputation: 25
|
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. ![]() |
|
|
|
|
|
#6 (permalink) | |
|
Purger of Ignorance
zB Programmer
Section Staff Super Zuner Join Date: Jun 2008
Location: In my own world
Posts: 1,670
Reputation: 231
|
Quote:
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. ![]() |
|
|
|
|
|
|
#7 (permalink) |
|
Jr. Member
Join Date: Nov 2007
Location: Pennsylvania
Posts: 389
Reputation: 25
|
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. ![]() |
|
|
|
|
|
#8 (permalink) | |
|
zB Programmer
Jr. Member Join Date: May 2008
Location: Bremen, germany
Posts: 454
Reputation: 246
|
Quote:
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. ![]() ![]() ![]() ![]() |
|
|
|
|
|
|
#9 (permalink) | |
|
Purger of Ignorance
zB Programmer
Section Staff Super Zuner Join Date: Jun 2008
Location: In my own world
Posts: 1,670
Reputation: 231
|
Quote:
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. ![]() |
|
|
|
|
![]() |
| Thread Tools | |
|
|
| |