Windows Phone slow startup

Hi,

My game works fine on Android, but it takes almost 5 seconds to start on Windows Phone. Reason? Seems to be compiling shaders. Any idea or suggestion to improve it? @stammen please, have you noticed it? Working with a lumia 435 with latest win10 (not insider) and compiling with visual studio 2015 community update2 release mode. Tested also with a lumia 640

Thanks in advance

You should probably pre-compile your shaders. May have to re-write your GLSL as HLSL.

1 Like

Hi @stevetranby

I was silent since I managed few days ago to compile shaders at runtime and store them on wp8 for future uses following this tutorial I found. I was trying to clean code a bit to try get it merged with cocos2d-x v3.10 when v3.11 got released :smiley: still, my solution isn’t that good because your first run will be painfully slow.

Gotta check yours and see how it works.

Thanks for your post.

Hi @stevetranby

After re reading the post you gave me, I think you didn’t got my problem.

My problem is that by default, a cocos2d-x game running on a windows smartphone has a SLOW startup due the shaders cocos2d includes by default.

As an example, I’ve created a new empty project with cocos2d-x 3.11.1 and deployed it to my Lumia 435 (dual core 1GB ram, lowest profile microsoft device). It takes about 5 seconds to show the screen with the cocos logo, and this has nothing to do with compiling custom shaders as it’s what you get using the 'cocos new ’ command.

In my project, I managed to speed it up modifying the cocos library to compile in runtime the shaders that cocos library has by default, but this is useful for the second run. On first one, you still get the black screen for 4-5 seconds.

I thought it would be enough, but I get many errors on my microsoft dashboard of people closing the app while it’s starting on first run (my guess is that they think it’s not working as 4-5 seconds is too much for an app to start, so they uninstall and don’t give a second try that would run faster as shaders have been already compiled and saved on local phone).

If creating an empty project gives such slow start, I think cocos2d-x should try to find a solution as every windows game created with it will face this slow startup problem. I can add code to precompile shaders on first run and do a pull request on cocos code, but still, I think it’s not that good solution as many users of my game don’t seem to be patient enough to wait for first run.

Adding a scroll bar on first run saying something like ‘please be patient’, would be enough too, but I don’t know how to do that in windows XAML (can’t use cocos code for that as cocos shaders aren’t compiled yet :frowning: )

.

Thanks for the info. You should submit a github issue.

Done, thanks for your support :smile: