Max FPS - Is it possible?

0 favourites
From the Asset Store
Support AdType ( AppOpenAd, Banner Ad, Interstitial Ad Rewarded Ad, MREC Ad) support c3 build service
  • Ayyy,

    The main question I have, is, is it POSSIBLE for C3 to have a "max FPS" option for those who want to disable vsync, or is this impossible to add in? Whether or not Scirra feel it is right to implement, I'm mostly curious if it is an absolute "no this is impossible due to how C3 is designed" or not.

    I'm a year into a Rhythm game, desktop only, which I plan to release, but there's two thing at the back of my mind that could be a deal breaker when release day comes: lack of control over vsync, and no way to set max FPS.

    I haven't isolated the issue yet on a blank project, but my project is a bit jittery when vsync is on, as well as slight input lag (as always with vsync). This happens even on a 240hz monitor with vsync on. Obviously it is unacceptable to release a rhythm game where the notes aren't smoothly moving and there is noticeable input delay.

    With vsync off, there is no more jitter at all, input feels perfect. But as we know, the downside is the fps shoots up to like 600, which is bad for laptop battery, and makes the fans of your computer go wild.

    Like many other desktop games, I'd love to be able to add an options menu to allow the player to choose to have vsync and whether to cap their framerate.

    Gdevelop has an option for max FPS, as well as any Source engine game (altho hidden as a console command, but it's set to 300fps by default), spyro reignited has a FPS option, etc.

    There are other uses for a max FPS feature, such as someone on a lower-end device might want to cap their FPS at 30fps, so that they don't have a variable framerate if their device floats around 40 to 50fps.

    Anyway, yeah, I really hope I can pinpoint the jittery issue with vsync being on, I tend to forget it exists because I almost always run my game with vsync off, but I know this won't be acceptable on release. Unless I made 2 builds, one with vsync on, one with vsync off, which sounds like a very sloppy workaround, and still has the issue with players on laptops as we can't limit the max FPS. I'm worried and hope I can find a solution.

    Thanks for reading!

  • I haven't isolated the issue yet on a blank project, but my project is a bit jittery when vsync is on, as well as slight input lag (as always with vsync). This happens even on a 240hz monitor with vsync on.

    At 60 Hz the frame display latency is 16ms; possibly 32ms if it takes two frames for a change to appear. At 240 Hz the frame display is around just 4ms, or 8ms if it takes two frames - a fraction of a single frame at 60 Hz. This suggests vsync is not actually the thing imposing latency; it may not be the cause of jittering either. Are you sure it's not that your project is using too much CPU/GPU? That would also explain why it would be difficult to reproduce in a blank project.

  • I see what you're saying. I have tested on a 60hz monitor on the same computer, but still jittering and such.

    I'll double check stats later but on 60hz monitor with vsync, generally cpu is like 10% usage, gpu unsure but it is heavy gpu stuff (video playback, particle effects, layers with effects, etc.). I do feel competent with designing my events efficiently, but everyone is capable of mistakes.

    I wonder why would it work so nicely without vsync, but jittery with vsync, even if it is related to cpu and gpu usage. It makes me worry, if I can lower the usage of cpu and gpu on my high end computer to fix the vsync jitter, then great, but it might jitter on a low-end computer, even if they see it says its a solid 60fps. I still think it is vital to give the player the option to choose.

    EDIT: Just to add, the video playback, when vsync is off, it is buttery smooth. With Vsync on, it's very noticeably choppy. Again, not been able to reproduce on blank project, could still be gpu related and such, but it's such a tease to see my whole project working perfectly when vsync is off (ironically using more resources but giving a smoother experience).

    EDIT 2: Another way I would approach this issue, even without jitter issues: If I were a player, the first thing I would do in a game is make sure video settings are set to my own preference, such as when I play a rhythm game or FPS, I turn off vsync and such. It doesn't feel right to NOT offer a way for players to disable vsync, when like every other game, old or modern, does offer the option.

  • Being able to cap/uncap fps has been a little bit overdue imo. Right now we have 60 fps vsynced or 7000 fps maximum overdrive, no inbetween and no "underclocking". I'm not sure if that's really related to the issue you are having tho.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The feature to cap max FPS is very much needed. I've been running into issues for years now because of this, always having to resort to some trick, workaround, or completely remake a whole system.

  • It's not really clear from this thread if the problems are caused by v-sync or would be solved by a max FPS.

    Turning off v-sync brings its own problems too. For example if the display updates at 60 Hz, if the game ends up running at 85 FPS it might look jankier than running at 60 FPS. In that case ticks won't line up with displayed frames and so there is an inconsistent amount of movement every frame. So if the goal is perfect smoothness, this doesn't seem like the way to go.

    The best solution is to make sure v-sync works solidly. It seems to work perfectly smoothly for me if I open the "flying along" template. I'm not sure why it wouldn't on other systems. I think the best thing to do is file issues with browser makers if any particular browser is not v-syncing perfectly smoothly.

  • It might not the way of solving this problem but I think too that Construct needs an option to throttle the performance. Laptops, mobiles and so many low-end devices need a FPS cap for better battery life and user experience.

  • Browsers don't currently provide a way to drop the framerate. There's this Chrome issue about that, but it's quite old now.

  • Wouldn't it be an option to limit the engines tickrate while keeping the framerate?

  • Like I said, if the goal is perfect smoothness, then running the engine at a different tick rate to the display rate probably won't look perfectly smooth.

  • Would it be preferable to include support for setTimeout() if requestAnimationFrame() wouldn't get us support for limiting fps? At this point, I think it is worth it.

    The cons of not using requestAnimationFrame() are tolerable compared to working around the uncontrollable application fps, especially on mobile. Unless you recommend us to only make simple games.

    It is so easy to skip frames in Construct 3, especially since the event sheet already has a huge overhead than JavaScript. Having a 120Hz mobile phone, that leaves us little processing time per cycle, it's not farfetched to think that it could only take a For each condition in a RTS game to create phantom stutters on runtime. Especially since it is already hard to optimize smoothness for a 60Hz mobile phone.

  • I wouldn't even suggest this considering you could waste your time when browsers eventually support this, especially since you have a small team.

    However, I think most would agree that your time is better potentially risked to be wasted here than something like Animate, which your subscribers probably rarely use.

  • I do agree that something like this is more important than Animate, but I wouldn't call anything a "waste" of time - I like to think there's probably some gap that Scirra have spotted which might be why they wanted to pursue an animation software. Saying that, personally it's not for me.

    GDevelop has a max FPS value for projects. I tested this on my 120hz phone, dropping it down to 30fps, and it seems fine - It felt as smooth as 30fps would typically feel, but I was unable to figure out how to show fps/cpu/gpu utilisation in GDevelop, so I wasn't able to determine if this would save on cpu and gpu usage (and therefore better battery life and such).

    I especially think vsync should be toggle-able for time-sensitive games such as a rhythm game, but obviously if vsync is switched off, the framerate will race to the thousands and be detrimental to battery life. I'm making a rhythm game, and whilst it's acceptable with vsync on, I know that many others will want the option to switch this off.

    The following reddit post shows that many others agree, although the replies are likely other game devs and not necessarily players: reddit.com/r/gamedev/comments/wlupkz/thoughts_on_forcing_vsync_on

    Edit: Wording

  • What's the goal here?

    If it's perfect smoothness, like I say, I don't think a fixed framerate will achieve that reliably. I don't see it solving the problem. Perhaps in some specific cases it will look like it solves the problem, but in others, it will probably make things worse.

    So what other reasons are there for a fixed framerate? Perhaps there are some, but I don't see "achieving perfect smoothness" as one of them.

    I also have no idea what this has to do with Construct Animate or why anyone even mentioned that.

  • My OP was about jittery video when vsync is on, but I need to revisit this as this was 3 months ago and this post got bumped recently.

    But, generally, I think the goal would be to allow everyone to choose what's best for themselves depending on their setup.

    Some might choose to enable vsync and enjoy the smooth experience with no tearing, at the cost of slight input delay, and/or the cost of battery life if the game is trying to run at 120hz on a phone when it really only needs to be at 60fps.

    Some might set their FPS to 30fps, for better battery life, and perhaps for a more consistent framerate if the player is getting around 50fps on their device. A buttery smooth experience isn't the goal in this case, as this is for someone that would want to play the game without draining their battery and don't mind a lower refresh rate.

    Some might set their max FPS over 60fps and disable vsync for less input delay, at the cost of having visible tearing. If a max FPS cap existed, then CPU usage won't reach 100% as the FPS could be limited to 100fps or 200fps, allowing the player to play the game with vsync off without their desktop fans screaming at them.

    Personally, I play all games with vsync off on my laptop. Nvidia has a feature to limit the max FPS in games to any desired framerate, which works great!... Except it doesn't seem to work for C3/Chrome games, the framerate still shoots as high as it can.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)