0 Favourites

Text Object drops the Performance on Mobile significant

  • Problem Description

    FPS are ~50% lower with the text object than they are with the sprite font object.

    (especially bad, because it's a tip in the manual under performance tips https://www.scirra.com/manual/134/performance-tips)

    [quote:2xdrsoek]You can create an in-game display of these values with a Text object to keep an eye on performance while testing your game, using an action to update it Every tick:

    Set text to fps & " FPS, " & round(cpuutilisation * 100) & "% CPU (" & renderer & ")"

    Attach a Capx

    https://onedrive.live.com/redir?resid=D ... le%2c.capx

    Description of Capx

    A cluttered tilemap for the background

    A sprite that has scrollTo gets moved by 2 sine behaviors

    2 Timers are running to measure the average FPS

    every tick text and spritefont are set

    a button for convenient switching between text/spritefont object

    Steps to Reproduce Bug

    • start the .capx with preview over wifi
    • open the demo on an android phone in chrome or firefox
    • the demo starts with spritefont obj. for the displayed text
    • touch the button in the bottom left to switch to the text obj.
    • watch the frames drop <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    Observed Result

    FPS are ok with the spritefont obj.

    FPS are droping when the text gets rendert with the text obj.

    [ EDIT ] it seems the problem only occurs with webgl, not with canvas2d [ EDIT ]

    Expected Result

    FPS are the same with both, text obj. and sprite obj.

    Affected Browsers

    ONLY MOBILE !!!

    Desktop is running fine

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (NOT TESTED)

    Operating System and Service Pack

    Windows 8.1 Pro

    tested on

    • LG Electronics Optimus 4X HD P880 (Android 4.3.1)
    • samsung galaxy s5 (Android 4.4.2)

    Construct 2 Version ID

    Construct 2 Release 173 (64-bit)

  • While it is not a bug per say, but how the text object works, it cannot really be corrected (unless there would be some way to verify if the text is the same before updating it), however I do agree that this saying in the manual should be removed. (I personnaly use the default spritefont for that usage)

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • When I try to run your capx in ludei's CocoonJS Launcher, I get a low framerate (around 14-15) with both the text object and the sprite font.

    Actually, CocoonJS with WebGL seems to have terrible performance everytime your update a text object. So if you do that every tick, the performance are terrible.

  • Closing as won't fix. The problem is you size the text object really big. In the WebGL renderer every time the text object changes, it has to upload a new texture to the GPU with the new text. The texture is the size of the object, and the bigger the texture, the slower this is. Your text object is huge (827x462) despite only needing to display a small bit of text in the top left; resize it smaller and it performs far faster and can get nearly 60 FPS here on a Nexus 5.

    There is not much we can do about this since this is the only way text can be rendered in WebGL mode other than using sprite font. If performance is critical then this is a reason to use sprite fonts instead.

  • The thing is, as I mentioned, the sprite font have equality bad framerate. The framerate was equivalent (arount 14 and 15) with both the text object and the sprite font.

    Actually, what would be the best way to produce a iOS app if I'm going to refresh a text object or text sprite every tick? I've been looking everywhere yesterday for information about this. Should I use CocoonJS? Should I disable WebGL somewhere so that I don't have this problem? Again, the game I'm doing runs at 60fps in Safari browser, in Web App mode or in CocoonJS's Webview. It only lag when I use "Canvas 2D/WebGL" in CocoonJS Launcher App.

  • narFsnw maybe check out

    Subscribe to Construct videos now
    i haven't tryed it myself, but maybe it helps you.

    And thanks Ashley for the info about the text object.

  • Your post really saved me after breaking my head for several days to figure this out. You can disable WebGL in the Project Configuration settings "Enable WebGL:Off" export to CocoonJS and run in Canvas+ (Not Webview) it runs and renders Super Fast even with SpriteFont+ or SPriteFont.

    If you are not using any of the WebGL effects then you are in luck , otherwise it's horribly slow.

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