Arima's Recent Forum Activity

  • You could try always rounding positions of objects and the scroll x/y.

    That can affect the gameplay subtly though, so you might want to make an invisible object without the rounding that is used for the gameplay, and a visible sprite with a rounded location for rendering.

  • Nice, thanks for testing, and thanks for checking so many browsers, newt!

    It worked perfectly! I'm not sure these results are 100% accurate due to them changing and what not. But the improvement was incredibly visible. Fantastic job!

    Yeah, my test isn't meant to be super exact, it's mainly to check if the bug is there or not.

    Anyone out there with other devices?

  • I think I've found a way to fix a major performance problem on iOS retina devices that occurs in fullscreen landscape mode in safari and with web apps on the home screen, but I need help to make sure the fix works on all devices.

    Please tell me:

    • What device it is
    • Reported window width and window height
    • The upper/lower values of how many sprites it says are in the layout in both portrait and landscape modes in both tests (if the text is offscreen, tap the screen to place it).
    • If it can manage 30 fps

    The first test, an unmodified export as a point of comparison to check if the bug even happens on your device: http://www.amirai.net/ipad/renderingbug/

    If it happens, you should get normal performance in portrait and terrible performance in landscape. My ipad 3 gets 10 fps with only one sprite in the layout!

    Test 2 with the fix: http://www.amirai.net/ipad/renderingbug/fix/

    Hopefully in that test performance in landscape should be equal to that of portrait.

    Results, iPad 3:

    Test 1

    portrait: 1536x1836 pixels, 893-837 sprites at 30 fps

    landscape: 2048x1344 pixels, 1 sprite at 10 fps

    Test 2

    portrait: 1534x1836 pixels, 919-863 sprites at 30 fps

    landscape: 2046/1344 pixels, 895-842 sprites at 30 fps

    What's the fix? 2 tiny tweaks to the index.html (the edits are the -1's in bold after both the width()'s):

              // Size the canvas to fill the browser viewport.

              jQuery(window).resize(function() {

                  ?cr_sizeCanvas(jQuery(window).width()-1, jQuery(window).height());

              });

              

              // Start the Construct 2 project running on window load.

              jQuery(document).ready(function ()

              {              ?

                  ?// Create new runtime using the c2canvas

                  ?cr_createRuntime("c2canvas");

                  ?

                  ?cr_sizeCanvas(jQuery(window).width()-1, jQuery(window).height());

              });

    My best guess of what's going on here is ios is automatically adding 2 pixels to the size of the texture of the canvas (like c2 does in the image editor so that textures can rotate smoothly without jagged aliased edges), making the texture in use 2050 pixels wide when its gpu can only handle 2048 pixels, causing a huge performance hit. So if the width and height of the canvas are clamped to 2046, it fixes it. Or something like that.

    Any results are highly appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This should be supported in the next beta release.

    WHOO HOOOOO

    Definitely my most desired feature! :D

  • Thanks for pointing this out. However, while I get you simply wanted to test if it was working or not, do not edit people's comments to change what they are saying. If you wanted to test it you could have added something else like a punctuation mark on a new line. What comment did you edit so I can change it back?

  • I'm not sure why you think that performance on an ipad 3 in retina mode is that bad. On my sprite test, someone with an ipad 2 said they got about 450 sprites at 60 fps, from 350 on an ipad 3. That's a noticeable difference, but far from bad performance in comparison. My ipad 3 is easily powerful enough for the Zelda-like game I'm making, playing at a smooth 60 fps with dozens of enemies onscreen, and the only reason the fps dips below 60 if I add more is because of the JavaScript, not the rendering, because if I disable the game logic I can have tons more onscreen at 60 fps.

    Might it have to do with the fact that performance when previewing over LAN is somewhere around a third or less of the exported HTML's performance? I only get about 100 sprites in my sprite test when previewing over LAN.

    Regardless, I think I may have actually found a way to fix this, but I need to make sure it works on multiple devices. I started a thread with the test here: edit, test was flawed, had issues making it difficult to get an accurate result

  • Pode - thanks. I'm not sure that's it though as the demo bug page they show works fine on my io6 iPad 3. I also tried adding both pieces of code to the page and neither of them seemed to fix it. I might have done it wrong though, as I don't know how to write HTML or JavaScript well.

    Edit: I should mention this post in another thread where I found the exact pixel height at which the bug occurs, if that might help any: http://www.scirra.com/forum/forum_posts.asp?TID=58532&PID=360878&title=my-game-lags-in-landscape#360878

  • 0plus1

    As I don't have an iphone, I'm curious what the performance difference is. Can you let this test sit for a minute or two and tell me how many sprites you get on an iphone? Don't test it as an app on the home screen though, that causes it to not work, simply please check it in safari: http://www.amirai.net/ipad/r105/

    On the ipad 3 ios6 I get it wavering between about 350-400. On ios 5 it was about 250.

  • I think you can do that sort of thing with BMT micro. I haven't tried it myself, though.

  • Ashley

    Found some new info. I modified the test before, and discovered that the problem happens in fullscreen letterbox landscape mode as well in some scenarios.

    http://www.amirai.net/ipad/r105/ipadfps.zip

    This is the sprite test in full screen letterbox mode with a canvas size of 2048x1345. Works smooth: http://www.amirai.net/ipad/r105/

    Lower the vertical resolution in the properties by 1 pixel to 2048x1344, and the bug happens: http://www.amirai.net/ipad/r105/2/

    Also, if I load those links above to the exported versions, I noticed if I rotate the device before the page has finished loading and the blue bar under the web address disappears, it doesn't resize/adjust the canvas to fit the window. It only readjusts it properly if the device is rotated after it's finished.

  • Yup. Just checked it, happens on preview over LAN and after export on an ipad 3 with iOS 6.

    http://www.amirai.net/ipad/105/

  • I checked and the problem doesn't happen with retina mode disabled, but it's not an issue of the ipad just not being able to handle it because it handles fullscreen retina mode just fine with letterbox mode selected instead.

Arima's avatar

Arima

Member since 11 Jun, 2007

None one is following Arima yet!

Connect with Arima

Trophy Case

  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

19/44
How to earn trophies