Text Object drops the Performance on Mobile significant

Bugs will be moved here once resolved.

Post » Wed Jun 18, 2014 10:10 pm

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)
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 ;)

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)
B
68
S
28
G
7
Posts: 85
Reputation: 7,496

Post » Thu Jun 19, 2014 12:27 am

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)
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Wed Jun 25, 2014 2:43 am

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.
B
18
S
5
Posts: 80
Reputation: 1,338

Post » Wed Jun 25, 2014 3:10 pm

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.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Wed Jun 25, 2014 4:30 pm

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.
B
18
S
5
Posts: 80
Reputation: 1,338

Post » Wed Jun 25, 2014 5:04 pm

@narFsnw maybe check out this video i haven't tryed it myself, but maybe it helps you.
And thanks Ashley for the info about the text object.
B
68
S
28
G
7
Posts: 85
Reputation: 7,496

Post » Sat Aug 02, 2014 3:15 am

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.
B
16
S
4
Posts: 248
Reputation: 2,267


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests