Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About pacifistcottage

  • Rank
  1. pacifistcottage

    [XNA] Cleanly up-scaling a 2d game to fullscreen?

    Yeah, I thought that was the case, but I wanted to make sure I wasn't missing anything. And truth be told, if I simply set the game's resolution to 1080p, it scales up fine on my monitor, and solves this problem. But then, the frame rate drops so much that the game is nearly unplayable. So is there anything else I can do? I want to have my 720p-sized game area displayed in fullscreen in native res without killing performance. Or do I just need to accept the "stretched" look? As I mentioned in my first post, I am intrigued by Jamestown, because it has quite a bit going on graphically but still manages to run smoothly and look perfectly clean on my 1080p monitor, even though it is running at a pretty low resolution (and does not give you any resolution options). I feel like I am still missing some obvious part of this...
  2. Hi guys. I am hoping someone can help me out, because I am having a serious problem getting my head around this issue, and I have wasted quite a few hours trying to get it right, but have only reached partial solutions. Basically, the goal is this: my game's display resolution is locked at 720p. It is a 2d platformer that is heavy on exploration, so I want to make sure the amount of actual content being displayed never changes, even on monitors with different resolutions. Now, I can get the game to scale fine when it runs in windowed mode. Basically, I am doing the route of: (in the Draw() method) 1. create a 720p RenderTarget2d, and set it as the render target 2. draw everything to the render target 3. set render target back to null 4. draw everything to screen using an appropriate scale Matrix Like I said, this works fine for both scaling up and down (using SamplerState.PointClamp for scaling up, and SamplerState.LinearClamp for scaling down), and the results are a pretty clean scale. However, the issue comes into play when I try to go to fullscreen. The image gets displayed in fullscreen, but it seems like XNA is just blindly stretching it, rather than using the clean interpolation methods that it does when I run it windowed. So what I am missing here? What do I need to do to get my 720p-locked game to scale up cleanly without actually changing the back buffer's resolution (obviously, changing the actual game's resolution to 1080p will cause problems for people who don't have top-of-line graphics cards)? Two good examples of this right off the top of my head are Cave Story+ and Jamestown. They both have low resolutions (1024x960 & 1024x640, I believe), but can scale almost perfectly cleanly to a 1080p monitor in fullscreen mode. For what it's worth, I recognize that my knowledge on this subject is pretty weak. I also know that I should be focusing on developing the game itself instead of worrying about this, but I have sunk so much time into at this point, I feel the need to redeem myself and get it finished. I just have not been able to find any satisfactory answers to this question yet, so if anyone is able to provide any insight, I would be eternally grateful. edit: to give a more clear example, let me try this. If I set PreferredBackBufferWidth/Height to 1408x792 (i.e. 720p + 10%), and then pass in a scaleMatrix of 1.1f, everything displays perfectly and cleanly--it still only shows my 720 camera's display area, but it is scaled up and looks nice. I can even go super-low (this is just for testing sake, obviously), like 640x360, and set the scaleMatrix to .5f, and again, aside from being super-tiny, it looks really good and has the exact same display area. But going in to fullscreen at 720p does not properly scale it--it fills the screen, but it just looks like crap, even when the target monitor has the same display ratio.
  3. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    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.
  4. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    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).
  5. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    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. 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.)
  6. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    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.
  7. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    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!
  8. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    VSync can often be "forced" on or off in the graphics driver. Open your graphics driver configuration screen, you may find a setting where you can change VSync to "application controlled", or just force it off temporarily while testing. [/quote] Ok, I will check that out. I looked briefly last night, but did not have enough time for a thorough check. That does seem like the kind of thing that is going on here, though. I'll report back once I get a chance to test it. Thanks a bunch for the suggestion!
  9. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    So here's a small update, and it makes me even more confused. Perhaps I am just misunderstanding XNA's Update/Draw hierarchy, but I am baffled. This is with IsFixedTimeStep set to false, and VSync set to true (but it doesn't change anything if I turn it off). If I print gameTIme.ElapsedGameTIme to the Console during Update and Draw, it is showing a steady .0166667 every single frame, even when the game is running at 48/49 FPS. (I am using Fraps to display the FPS, but you can also visibly see that the game is running slower just by playing.) So, maybe I am missing something obvious here. Why would it be running at 48/49 FPS when ElapsedGameTime is showing a consistent 16ms (i.e. 60 FPS)? For what it's worth, one sure-fire way to make the frame-rate drop is to click out of the game on another window and back into the game. This will make it happen every single time (although even if you don't do that, it still happens randomly while you're playing).
  10. pacifistcottage

    Frame rate randomly locks at 48 FPS (PC)

    Nope, no calls to Sleep(), unless one of the XNA classes has calls to it built-in. None by me, though. To clarify: I am fairly early in development, so there is not a whole lot going on the game (hence the low CPU usage), and these figures are based on doing nothing at all--just standing there. I guess, taking another look, it's more like 3-5% on average when not doing anything, but the point is it still jumps up the 48 FPS/25-ish%, as compared to 60 FPS/3-5%, so obviously something is wrong. Typically, I wouldn't worry about performance this early in development, but as I said in my OP, it seems to be a system issue, rather than an issue with my code, because the same thing was happening in another game I tried.
  11. Hi all, Long-time lurker, but first-time poster. I am hoping someone can shed some light on an issue that is making me want to punch things. Basically, one of the PCs on which I do XNA development is having frame rate issues, seemingly randomly. I am working on a 2d side-scrolling platformer kind of game, and sometimes, with no warning, the frame rate will suddenly just drop and lock to 48 FPS. So, a few important points: When the game is running at 60FPS, Task Manager shows CPU usage at nearly nothing--between 1 and 3%. However, once the drop to 48 happens, CPU usage locks in at around 25%. Once it drops, it never goes back up. I just have to restart the game (sometimes it even does the 48 FPS thing immediately upon loading)The level I am testing on is built from Tiled maps, and scripted. There is no random generation of anything going on, and everything should be more or less exactly the same every single time I play it, which is why I say this is happening randomly. It also happens at random times, not like, when loading new maps or creating enemies or anythingThe PC I am working on is WAY overpowered to be having performance issues with this. It's not top of the line, but it's an i5, 8GB RAM, ATI 5770. I do plenty of gaming with pretty intensive games (not to mention other XNA games, like Terraria and Capsized) on it and it never breaks a sweat.I can run the game on another machine, and it has no serious frame rate issues--usually sticks between 55 and 60 FPS (and it is a slower machine). I assumed I had made a mistake somewhere in my code and left a faulty loop running somewhere or something, but then I tested another developer's game on my machine, and the exact same thing happened. The game just throttled to 48 FPS. The fact that it happened in more than one game, both XNA, leads to believe something is amiss with my system, rather than my code. Is this anything anyone has ever heard of? I updated my graphics drivers, Win 7 64 is all up to date, A/V up to date, etc. I also tried disabling vsync, thinking maybe it was trying to lock to a defective monitor or something, but it made no difference. Any ideas? Could it be an IRQ issue, maybe with a wireless internet dongle or FireWire audio interface (admittedly, I don't know a whole lot about about how video cards deal with other system hardware)? It is driving me insane, when I am testing new code in my game and the frame rate just randomly drops. Any ideas would be appreciated. Thanks a bunch!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!