Frame rate randomly locks at 48 FPS (PC)

Started by
17 comments, last by pacifistcottage 12 years, 6 months ago

It could be that something that happens during gameplay causes the game to become CPU bound (e.g. it starts doing an expensive calculation every frame). I'd suggest using a CPU profiler when it's running with the high CPU usage to find out if that's what is happening, and if so where.


That's a good call, and reminds me of the time I had added extra objects to my draw lists for each frame, but had managed to let a bug creep in where they didn't get removed for up to maybe 10 frames or so. Cue escalating frame times and mysterious performance loss until I tracked it down.

Might also be worth doing a before and after comparison of your API calls using something like PIX (or whatever the XNA equivalent is) just to confirm that the same isn't going on here too.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Advertisement

[quote name='Adam_42' timestamp='1317910611' post='4869782']
It could be that something that happens during gameplay causes the game to become CPU bound (e.g. it starts doing an expensive calculation every frame). I'd suggest using a CPU profiler when it's running with the high CPU usage to find out if that's what is happening, and if so where.


That's a good call, and reminds me of the time I had added extra objects to my draw lists for each frame, but had managed to let a bug creep in where they didn't get removed for up to maybe 10 frames or so. Cue escalating frame times and mysterious performance loss until I tracked it down.

Might also be worth doing a before and after comparison of your API calls using something like PIX (or whatever the XNA equivalent is) just to confirm that the same isn't going on here too.
[/quote]

Yeah, I will check this out as well, although it seems slightly less likely in this particular instance, since the issue is really only occurring on a single machine, and happens with my own game plus another developer's game. I will test all of these options, though, and I really appreciate the suggestions, so thank you all very much!

Does anyone have a recommendation for a good profiler for XNA 4? I tried a few out yesterday, but didn't have a lot of success, as most of the ones I found did not work well with .NET 4. (To be fair, I did not try PIX, because I didn't want to download the entire DX SDK just to get it, but if that is "the one to try," I will gladly do it.)

Thanks again!
So unfortunately, none of this helped. I did find a setting in my video card control panel to completely disable vsync, but it didn't help. I have basically gone from frustrated to hopeless at this point...

Also, to prove I'm not completely off my rocker, I took a fun little screenshot. I made a brand new game and did NOTHING to it except for change the window size for the sake of the screenshot (even left good ol' cornflower blue on the background). You can see it here, running at a solid... 51 FPS. Doing nothing...

I also included my system specs in the screenshot, and I like I said, this is my main gaming machine, and while it's certainly not top-of-the-line, I have done a lot of pretty hefty gaming on it. There is NO reason that it should be running an empty game at 51 FPS.

http://imgur.com/N0Woh

So... Any ideas here? Should I consider the possibility that I have a virus causing this? It seems unlikely, but I did notice that MSE was wanting to scan my machine every single day for a couple weeks, which seemed unusal. If you guys have any other suggestions, I would love to hear them, because I am stumped, and basically resigning myself to just using my laptop for XNA development (which, as I mentioned, does not have any of these issues, even though it is a bit slower).

If I cannot fix it, I may just have to nuke it from orbit and re-install Windows (it's the only way to be sure), but I really do not want to do that.

Again, I just want to say thanks for all the suggestions so far. Whether I get this resolved or not, I am very appreciative of all the replies. :)
If it's happening with other games it's probably either a driver issue or a hardware issue. My first guess would be that the graphics card gets hot, and the driver then restricts performance to try to bring the temperature back down.
Watch the memory consumption. How big is when running at 60fps? How big is when running at 48fps?

If it's happening with other games it's probably either a driver issue or a hardware issue. My first guess would be that the graphics card gets hot, and the driver then restricts performance to try to bring the temperature back down.


What's weird, though, is that it works fine with much more demanding games. I was playing Darksiders just a couple days ago with resolution and settings maxed, and it worked just fine. Yet it chokes on an XNA game doing nothing but displaying a blue screen... It just doesn't make sense.


Watch the memory consumption. How big is when running at 60fps? How big is when running at 48fps?


Memory is pretty much the same whether it is running properly or slowly, and even shows pretty much the same on both of the machines I have been testing on. You probably saw it above, but the CPU does ramp up to 25% on the "bad" machine when it drops the frame rate, but no unusual memory activity that I have noticed.


I don't know... I have more or less resigned myself to re-installing Windows this weekend unless someone has any other ideas that might fix it in a less... dramatic way. To be honest, it's probably time anyway, as it has been almost two years, and I have installed/un-installed a lot of junk in that time. I do not look forward to it, but I can just continue working on my laptop while I get my desktop back up to speed. If it still doesn't work right after a re-install... I don't know, maybe I will buy a new video card. I just don't have the patience to keep troubleshooting such a non-sense issue like this. It is soooooo frustrating...

Anyway, thanks again for all the advice! Much appreciated! (And I am still receptive if anyone has any other suggestions besides re-installing Windows.)
Just one last update, in case anyone is still reading. I just tried Terraria and Capsized, two games in my Steam library that I know to be made in XNA. Terraria sort of bounced back and forth between 48 and 60, but Capsized was locked steadily at 48.

I have a few more hours worth of work to do on a Flash game I am finishing, but after that I am just going to do a clean install of Windows, and hope that fixes the problem. Thank god for Ninite!

What I cannot get my head around is why the GameTime and frame rate don't agree. Game Time shows a consistent 16ms draw/update rate, even though Fraps reports 48 FPS, and you can clearly see that the game is running choppy. (Normally, I would use the time difference to smooth out the motion at slower frame rates, but I can't even do that, because the game still thinks it is running at 60 FPS).
May be a timer bug due to your process bouncing in multiple cores even if it's single threaded? Try locking your app to just one CPU (preferably the first one) in your task manager.

May be a timer bug due to your process bouncing in multiple cores even if it's single threaded? Try locking your app to just one CPU (preferably the first one) in your task manager.


Yeah, I tried that as well, and still no luck. :(

I actually did find one more person having the same issue in the GameDev section on Reddit, but we have not been able to pin down a common cause...

Also, I went through with the clean install of Windows. Right off the bat, I installed the video driver, MS Security Essentials, VS 2010, and XNA GS, and sure enough, it was still doing it with no more software/drivers than those on the system. I also got desperate and tried one-by-one disabling some of the CPU power-saving features in my PC's BIOS, and none of them fixed it. Furthermore, I even tried removing any extra hardware that could be causing conflicts, and still no luck. Basically, at this point, I am just going to have to stick to my laptop, because the issue doesn't happen there. The only other thing I can think of is to try replacing the video card, but I am not going to do that, because I just bought my current one a few months ago.

Anyway, thanks again for all your help. Sorry I couldn't come out with a happier outcome. :(

This topic is closed to new replies.

Advertisement