Framerate Stutter (achieve smooth fps)

0 favourites
From the Asset Store
Create a game inspired by great arcade classics as Operation Wolf
  • I've always used Cocoon.io with Canvas+ to compile my games since it provides really smooth fps on mobile. Other routes do not seem to have a steady 60 fps. Since Canvas+ has been discontinued, I've noticed that webview and webview+ are still fast, but I see obvious frame rate stutter in moving objects. Has anyone found a workaround to achieve smooth 60 fps on mobile?

    When I preview my game in Construct 3, I get no issues. It's only when I export an APK and install on my device (Note 8).

  • For the last 4 Months, I have been stragling with this issue I been testing to death untill I can handle it any more, there is nothing you can do or at last, nothing worked for me.

    There is a huge gap between Webview and Canvas+

    The Games that run smoothly at 7% Cpu on canvas run at 98% Cpu on Webview with the stutters all the time,

    Here is what I noticed with webview

    -The code gets executed much much slower with delays

    -stutters

    -Any minimum loop will break the Game and make the stutters unplayable

    -it cannot handle loops like the "For Each" , "For" ," While" or anything that needs to Pick by looping a little bit

    -The Gameplay feels slow much boring

    Canvas+

    -Amazingly fast, I was surprised with speed and the super low Cpu and steady Fps

    -but has a critical bug I reported here

    https://www.scirra.com/forum/app-memory-leak-closing-or-changing-layout_t201156

    Now the Problem becomes bigger because if you wanna use Canvas+ Not all the phones can handle it I don't know why

    Canvas+ works great on iPhone ("7" & "8" & "X") including using any loops

    but it doesn't work on iPhone 6 or less, the stutters are very noticeable making the Game unplayable

    So hence I have the big battle to choose canvas+ and loss the big market of iPhone 6 and less, which is huge market probably still half of the users of the Apple or choose Webview slow with stutters Plus removing crucial elements of the Game like the Pathfinder which it cannot handle the Webview on Iphone6 or less

    I'm so angry right not because I lost 4 full months with this and I didn't find any solution like you said on wifi works everything good and smooth but when you export it is a nightmare

    PhoneGap is out of the equation

    ===========================================

    [quote:1koqt2fi]Since Canvas+ has been discontinued

    jook00 What you mean with has been discontinued??

  • [quote:qzc6bitu]jook00 What you mean with has been discontinued??

    tarek2 Construct no longer supports Canvas+ according to this message from Ashley in 2015. You'll also notice this as Construct 3 to Cocoon with Canvas+ will render a game with scaling and sound issues. However, I've been using Canvas+ on all my games and didn't even know it was discontinued until now.

    Ashley's message on no canvas+ support:

    https://www.scirra.com/blog/154/evolving-construct-2s-export-options

    Scaling issue seen here:

    https://shatter-box.com/knowledgebase/build-construct-3-games-cocoon/

  • [quote:9jd9nfxy]jook00 What you mean with has been discontinued??

    tarek2 Construct no longer supports Canvas+ according to this message from Ashley in 2015. You'll also notice this as Construct 3 to Cocoon with Canvas+ will render a game with scaling and sound issues. However, I've been using Canvas+ on all my games and didn't even know it was discontinued until now.

    Ashley's message on no canvas+ support:

    https://www.scirra.com/blog/154/evolving-construct-2s-export-options

    Scaling issue seen here:

    https://shatter-box.com/knowledgebase/build-construct-3-games-cocoon/

    Haah ok I didn't know it was discontinued either haha, thanks for the links that cleared up many questions I had.

    I'm glad that I found out those things before will be to late.

  • Would it be possible to request a FPS feature so we control the framerate of the entire game? For example, if the FPS was 50, would it help the stutter issues I'm seeing for mobile webview?

    Will webview be fixed at some point to address FPS stutter? Thanks!

  • Webviews on modern devices are perfectly fast. I doubt you will be able to measure any performance difference to something like Canvas+, unless the device has a blacklisted GPU, in which case it will use software rendering and there will be a big difference. That only affects a minority of devices though; most are fine.

    We deprecated Canvas+ precisely because it was really buggy and limited. It involves building a significant fraction of an entire browser engine, which is an incredibly difficult project. It was buggy when we deprecated it in 2015, and if you are still finding serious bugs in it now, I am both unsurprised and very glad we deprecated it back then. Don't use it.

  • Thanks Ashley . I've tested on a couple devices including Note 8 and there are slight stutters every 5-10 seconds for Webview. It's subtle, but definitely there. Canvas+ doesn't seem to have the same issue so not exactly sure why some of us are experiencing this.

  • Ashley

    [quote:1dnkvluy]Webviews on modern devices are perfectly fast. I doubt you will be able to measure any performance difference to something like Canvas+, unless the device has a blacklisted GPU,

    A simple test can Revel the truth

    Capx:

    Its done really quick and I didn't look to make it perfect, but it shows my Point very clear

    https://www.dropbox.com/s/nzgkezqa6oehywo/1-WebviewTest.capx?dl=0

    Videos: Test done in an Iphone 6

    This is a test Exported with Cocoon WebView (but exactly the same happens with PhoneGap)

    https://www.dropbox.com/s/ni44kmt4g4svr ... w.mp4?dl=0

    And This is a test Exported with Cocoon Canvas+

    https://www.dropbox.com/s/568asek26khbc ... B.mp4?dl=0

    Steps to Reproduce

    Move around so the Enemies (Red Squares) can find a path to the Player, Every 1 second

    On the Trigger were they start looking for Path I set their frame to 1 which is = Yellow

    On Trigger Path Found I set the Frame Back to 0 which is = Red

    Observed Result

    WebView:

    it takes for Ever to find a Path, you will see that the frame stays Yellow for long periods of Time when it should only blink really quick, meaning that is that slow that sometimes they stack in the same position looking for Path.

    Maybe Here you will not appreciate much but when this happens on my Game where the enemies should continuously hunt the Player and they are about to catch the Player and suddenly they just stop taking a sun bath for long periods of time, doesn't look good at all you cant call it a Game.

    Canvas+:

    Is that Fast that you cant even see the blink from one frame to the other

    And again here you will not appreciate but in my Game, you can see how everything moves Fast, how quick they swap Directions, how quick they execute the Events and many more things, so yeah is a big Gap and you can easily compare them both and find out who is faster, I do.

    ===============================================

    And you would think ok maybe if I do my custom "Path finder" will be Much better but no is not the case, the same thing happens with "loops" you cant use them as it brakes the Game and the stutters make it unplayable swell. there is no solution whatever you do.

    Honestly, between Stutters and WebView processing the code so slow is making us the Live Hell and miserable at last for me, it shouldn't happen especially now that we pay 99 a Year

    I personally spend and waisted 4 exclusively months trying to make work a "Path Finder" that it supposedly should work out of the Box, let alone the Problem with the Stutters all of this thanks to WebView

    In four month how many games, or things I could have done?

    If I was making a living from Mobile Game Development how can anyone afford to lose such a long time just to make work a behaviour or Loops with Webview?

    When you guys gonna start to take seriously the Real problems that we face on our side. when are you gonna start listening to your customers? I mean this is getting really tiring.

    Is there anyone at Scirra doing Tests with Exported Games?? because it cannot be that only us experiencing these things.

    Are you doing anything to fix these Problems in the New Run Time??? I hope yes because it really starts to be depressing.

    I played many many Mobiles Games and I never experienced any of this problem on them only Construct does these things

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tarek2 - you've previously reported issues that sound like GPU blacklisting. If the CPU is tied up doing software rendering, that will impact other CPU-bound things like pathfinding too.

    The problem comes down to the GPU drivers, which are made by the graphics chip vendors. It's an industry-wide problem that affects everyone developing with graphics. It's completely out of our hands. Changing technology won't get you away from it: you still have to deal with the same GPU drivers. It's unreasonable to expect us to go and fix Qualcomm's drivers or something.

  • tarek2 - you've previously reported issues that sound like GPU blacklisting. If the CPU is tied up doing software rendering, that will impact other CPU-bound things like pathfinding too.

    The problem comes down to the GPU drivers, which are made by the graphics chip vendors. It's an industry-wide problem that affects everyone developing with graphics. It's completely out of our hands. Changing technology won't get you away from it: you still have to deal with the same GPU drivers. It's unreasonable to expect us to go and fix Qualcomm's drivers or something.

    Sorry I was tired and I forgot to mention that the videos test is done on an iPhone 6, are all the Apple Devices Blacklisted?

    Because it happens with all the iPhones, I Printed on the screen the render they use and they all say WebGl.

    One thing that I can't understand is why if the device is blacklisted why the delay it shows only on Webview and not in Canvas+? shouldn't be delayed in both cases?

    And I would like to say that we not here to blame scirra or give bad Reviews or anything like that, we just looking for if there are any solutions so it gets fix and so we can carry on making Games. I think now is the best time to talk about this as you are rewriting the new run Time so you should take into consideration these problems and maybe find a solution for the future.

  • No, Apple devices generally aren't blacklisted. But what has pathfinding performance got to do with this thread? Maybe you should start a new thread to discuss that separately.

  • I'm not sure. I havn't tested pathfinding on iphone, maybe the webview on iphone can't handle web workers? Detailed here in the manual under finding paths.

    https://www.scirra.com/manual/154/pathfinding

    As for the stutter, I'm experiencing as well across several devices and even on pc, but seems to be related to garbage collection. Maybe Canvas+ handles garbage collection more efficiently than webview and regular web-browsers?

  • As a fulltime freelancer I made a lot of mobile games with C2 for my customers and tested a lot of various features, and performance issues are not related to Pathfinding, LOS or any other CPU-related feature as various projects I worked with had a variety of features in and the issues was the same everywhere.

    I can surely say that apps wrapped with Canvas+ have the best performance and in the big majority of cases it's the only one wrapper that makes the app work at steady 60 FPS.

    WebView+ simply uses Crosswalk and is still better than WebView but in the huge majority of cases slower than Canvas+.

    WebView, in theory, should perform well starting from Android 5.0 but unfortunately, that's just a theory and in the real case scenario, it just performs the worst of all three. I think I was able to use WebView only in 2-3 projects throughout the years I work with mobile apps. Those were not games, but simple apps without any dynamic content.

    I tested apps on Samsung Galaxy S4, Samsung Galaxy S6, Samsung Galaxy S8, Ipad Air Pro, Xiaomi Redmi Note 2, Xiaomi Redmi Note 4, Sony Xperia Z (can't remember the number), and few others.

    WebView and WebView+ perform very well only on devices like Samsung Galaxy S8, so one of the strongest available devices at the moment. This is a good news because it means that once such devices will become widely used, we will have no issues anymore. But for now, only Canvas+ performs on the level that the game is playable on majority of devices.

    I don't know if it's a GPU fault, drivers or whatnot, but for the end user (and customers, so also developers) it does not matter. If I tell my customer that he can either have his game running at 45FPS with WebView or 60 FPS with Canvas+, then obviously he asks for Canvas+. Nobody cares what's causing the issue, people just pick what works better, and that's understandable.

    So again, it looks that we will get rid of the performance issue with WebView at some point (few years I guess). But at the moment for a mobile game C2/3 developer, Canvas+ seems to be the only reasonable pick, unfortunately (unless he's making something very simple). I say unfortunately because working with Canvas+ is not comfortable. It requires you to learn what to do and what not to do. It's not fully compatible with DOM elements, Text objects, XML documents, TiledBackground and so on. Nevertheless if one wants to have the game running smoothly, he needs to learn all that.

    Note that it's not C2 or C3 bug or issue because I used the same code for the test cases. It's purely about the WebView vs Crosswalk vs Canvas+.

  • Thanks everyone and Toby R for the detailed test cases. I had the same thought as Toby. Once faster mobile phones are more widely used, this will become less of an issue. I wish at least Note 8 would have a steady 60fps for webview, but I still get some noticeable stutter. For now, I will revert to Construct 2 and Canvas+ for production quality releases, but will still continue to build prototypes in Construct 3. Still a great web tool! Love it!

  • Sorry for jumping into the conversation but after testing some very simple C3 projects on different Android devices (all of which stuttered like hell) and reading this thread - is there any realistic way to make mobile games with C3 right now (do things run better on iOS)?

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