HTML5 Builds Performance

Hello (it’s me again, hope I’m not being a nuisance here :p)

I’ve just completed my first game on Defold – I think it’s a very straightforward and easy-to-use tool to quickly develop games.

However, after I bundled a HTML5 package, I realize that – while the HTML5 build runs fine and smoothly on a laptop (and to a certain extend, an iPad), it runs horribly slow on other smartphone devices. I’ve tried it on my LG G3, Samsung Galaxy Note 5, and Sony Experia Z3, all of which has a frame rate of around 2 frames/sec, while the laptop and iPad didn’t have this problem.

I would like to know if this is a known issue, or if there’s some tips in optimizing the game itself?

The graphics add up to about 600k, and the sound files are about 20k.

Thanks!

1 Like

Hi!

Are you bundling the release version? Release and debug versions of the engine, differ a bit in performance, especially for HTML5. (The main reason being we check for OpenGL errors in the debug build.) :slight_smile:

1 Like

Hello Sven,

Thanks for the quick reply!

Yes I’ve also just tried the release version, and there’s quite a significant improvement. I think it’s around 8-10 frames a second now. However, Is there anything I should check to make it even smoother?

Best regards,
VT

I think other people are better at coming with performance suggestions on a game level. :slight_smile:

But one interesting thing to start using is the visual profiler: http://www.defold.com/manuals/debugging/#_visual_profiler It might give you some idea of where the engine spend most of the frame time. :thumbsup:

1 Like

HTML5 on mobile devices is not great performance wise. How are you with drawcalls and overdraw?

1 Like

There aren’t many objects on the screen, but they are animated.
here’s the game: http://www.appedia.sg/gaia the animation is an upward animation and the objects are destroyed before adding new ones in.

Could you please enable the visual profiler and see how many draw calls you have? The performance will rapidly degrade if you have many draw calls. Post back with a screenshot or a draw call count and we’ll be able to provide you with better help.

I hope this is it, thanks a lot!

Ok, so 7 draw calls shouldn’t really be a problem, but the game is running really slow on my HTC One M9. How does the visual profiler look if you run it a target device instead of on a PC? On a PC the engine hardly has anything to do at all, but obviously everything bogs down on mobile.

I think I manage to solve it (hopefully) –
http://www.appedia.sg/gaia now the game runs smoothly.

What I have done:
The bubbles are at a Z-position of 0.4, the backgrounds are on 0.1 to 0.3, and there’s the atmosphere at 0.5 and 0.6. I suspect that the rendering need to handle the bubbles in between the layers slowed the frame rate. As such, I simply removed an atmosphere layer at 0.6 (can’t tell the difference as I’m not designer :p, still looks good to me).

Am I doing the right way?

Best regards,
VT

Ah, if you have large transparent layers of graphics there will be a lot of overdraw which puts stress on the graphics card.

4 Likes

Ok, good to hear that you managed to improve the performance. I don’t know the size and type of the assets you are/were drawing. As I said, seven draw calls shouldn’t be much of an issue, but maybe there was a lot of overdraw (ie several large textures drawn on top of each other)?

2 Likes

yep, there’s lots of large textures with different level of transparency being drawn on top of each other. i have since flatten the layers and reduced the layers to 2 (we are not animating the background so this is good).

thanks britzl, sven and sicher! it’s really nice to have such a helpful community around (which features the actual development team member)!

4 Likes