Can you get 60FPS on Windows Phone?

Monkey Targets Forums/XNA/Can you get 60FPS on Windows Phone?

benmc(Posted 2012) [#1]
My new game is running at 60FPS pretty nicely on iPhone 3GS+, my Android devices, Flash, GLFW, and HTML5.

However, on my new Windows Phone, I'd say it's barely topping out at 30FPS.

Does anyone know why this might be? Is it just the limitations of the phone? I can play other games on the phone, Angry Birds, and everything is normal. Just my Monkey games.

The problem is definitely in onRender. When I move all my updates into onRender, it goes SUPER slow, but when I move them back out to onUpdate the "pace" of the game is right again, but the rendering is very choppy. So it can run my onUpdate easily at 60FPS, but it has trouble rendering.

Are there any tricks to speedier rendering on Win phones?


benmc(Posted 2012) [#2]
After some tweaking, I found that drawing a background image was killing my frame rate the most.

Cutting down on the number of draws is helping, but I find it strange because all the images displayed are from a single sprite sheet and each image is defined using "GrabImage"


benmc(Posted 2012) [#3]
Figure I'll update this thread in case others are experiencing slow down on Windows Phone devices.

Things I had to do to get my app appearing to run as smooth as possible on Windows Phone and as close to 60FPS as I could.

1) Could absolutely NOT have my OnUpdate code running in OnRender. I don't know if the device ever topped 30FPS in my game, so having OnUpdate in OnRender did kill the flicker/jumping, but it ran like a snail.

2) I had to turn off mojo backbuffering (no idea why, just trial and error, but it was night and day)

3) I had to do a Release build, and in Vis Studio, I also had to turn off Debug build in the Build properties.

4) I reduced the amount scale at which my Push/Pop Matrix was doing for the entire scenes. I don't know if this had any affect at all.

So anyway, this is my trial and error insight, maybe it'll be helpful to someone else in the future.


MikeHart(Posted 2012) [#4]
Thanks Ben for the info. I might get into Windows Phone dev beginning next year and for sure, this will be helpful!


dave.h(Posted 2012) [#5]
ive just tested a game im working on which has a flash version here and it runs at 30 fps as well on a windows phone.It runs at 60 fps on xna on my pc.

http://www.gamecentaur.com/

heres the thing though i designed it to work at 30 fps in my setupdate and it does so very well but if i change it to 100 in my setupdate it still runs at 30 fps.In fact its exactly the same speed either way i set it.I suppose it could be its at its speed limit but you would think i would get at least 1 or 2 frames more but its the same.


benmc(Posted 2012) [#6]
@dave.h For 30FPS, your game runs very smooth in Flash.

At 30FPS my game looks super choppy for some reason. I'm working on altering some of my velocities, friction, etc, for objects in my game to see if I can get it looking and working well at 30FPS, but 60FPS is just so silky smooth, I hate having to do this.

And what really bugs me is that my almost 3-year-old 3GS iPhone runs my game perfectly at 60FPS, but my brand new Windows Phone is choppy and slow when running the game.


dave.h(Posted 2012) [#7]
ive just done some more testing on my nokia luminia 800 and it appears that no matter what you run it will never go above 30 fps.I just tested it with a simple hello world program and it wont go above 30.

Now having discovered that i still have never noticed any slowdown on anything that ive put on my phone and it definately runs my apps faster than my android experia x10 because occasionally i have had slowdown on that.

The only time ive had slowdown on my windows phone has been my fault and its always occured when using fontmachine.The problem i had was placing a displaytext function in the wrong place like inside a large loop.So the result was i was displaying something simple like credits left but doing hundreds if not thousands of times within the loop.This caused massive slowdown,But once i discovered this its an easy fix and everthing ran great.You probably already know this but sometimes its easy to overlook things.Ive never had slowdown yet associated with velocities,friction ect but i suppose this would depend on how many objects you are throwing around the screen.Sorry i cant be more helpfull.


benmc(Posted 2012) [#8]
I'm starting to wonder if this is a bug with SetUpdateRate or something. I KNOW that other games on my brand new Windows Phone are running at full 60FPS easily. I've played some impressive games already.

So if Monkey games can't peak past 30FPS even with it set at 60FPS, there may be a problem.


Rone(Posted 2012) [#9]
Did you try to change the PresentationParameters.PresentationIntervall to .IntervallONE?

did not Test it, but should work if the device Supports more than 30.


dave.h(Posted 2012) [#10]
No but I didn't know about that.thank for pointing it out but where do I find it


Rone(Posted 2012) [#11]
Searching in the native Project or the xna mojo source

But it really depends on the device, my lumia vor example can only Show 30fps..


benmc(Posted 2012) [#12]
@Rone does your lumia only show 30FPS on Monkey games, or do you have this problem on all games?

I did re-configure the Program.cs source to try the IntervallOne approach, but I'm still not hitting 60FPS on my Lumia 900.

I just can't tell if it's Monkey or not. Some of the bigger game titles I've tested must be running at 60FPS because of how smooth they run (tho I don't know for sure)


marksibly(Posted 2012) [#13]
Hi,

Have you upgraded to Mango? According to this:

http://wmpoweruser.com/mango-xna-screen-refresh-rate-can-now-go-up-to-60-mhz/

XNA games can only go at 30fps max pre-Mango.

C++ (ie: 'big publisher') games can probably go at 60fps pre-Mango.

I'm currently looking into related issues on PSM so I'll have a look at this too.


dopeyrulz(Posted 2012) [#14]
From memory the base monkey project for WP is 7.0. If you delete the phone project and re-add it, it should prompt you to select 7.0 or 7.1 (mango).

Saying that Mark may have changed this at some stage to default to 7.1


benmc(Posted 2012) [#15]
Thank you. Is Mango a phone update or an XNA software update?

I'll have to check that out, I had no idea there was a 30FPS limit. How odd.

EDIT:

Well, I upgraded the project to 7.1 and then implemented the changes here the best I knew how:

http://msdn.microsoft.com/en-us/library/hh221580.aspx

Buuutttt, no luck getting 60FPS for some reason.

This must be it tho, I'll keep reading.


benmc(Posted 2012) [#16]
This is all fixed up in MonkeyPro66 now!!!

When the Windows Phone project is built, I still open it in Vis Studio and upgrade it to 7.1 tho.


dopeyrulz(Posted 2012) [#17]
We should get mark to update the base project as Microsoft basically no longer support pre mango now. They announced a while ago that all handsets have been upgraded and everyone should move up to mango releases.


dave.h(Posted 2012) [#18]
Im still having probs with this as ive just started a game with 60fps prob not installed something correctly but i cant seem to upgrade my project to 7.1.Also ive just noticed my Experia x10 doesnt go past 30 fps and thats an android device has anyone any info on that.Im only moving 31 objects around so it should easily handle that.


benmc(Posted 2012) [#19]
Have you installed the 7.1.1 Windows Phone SDK update?


dave.h(Posted 2012) [#20]
thought i had but id better check