New CocoonJS plugin from Ludei! Open source!

Discussion and feedback on Construct 2

Post » Fri Aug 01, 2014 3:34 am

@RookieDev does it do the same thing with the Launcher?

If so, that will make troubleshooting at least faster. I would just start pulling aspects of your game out (obviously make sure you make a backup of your current version) and see when the issue goes away. Take something out, test, take something out, test. Etc.

Even if the game isn't working this way, if you can at least get past the white screen, it will give you a place to start.
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Fri Aug 01, 2014 4:44 am

ArcadEd wrote:@Silverforce

Out of curiosity, is there a reason you are not using Ejecta for your iOS build?

Have you posted the issue on the github page? Seems to be the only place they pay attention to anything.


Ejecta flag warnings about depreciated functions & code when I tried to build it using Xcode5.1 or 6, it refuses to build at all, and I changed all the required details and bundle id and sign/provisions properly so its not my end. Xcode reports a lot of the code in Ejecta is obsolete for iOS 7+.

No idea why, I downloaded the master zip from github straight from my MAC onto desktop, exported C2 game, put it into the app subfolder in Ejecta. Troubleshoot it for a few days but it did not want to work so I resorted to CJS. When it worked, it would get stuck at the Ejecta loading screen, and Xcode reports code errors in Ejecta leading to crashes. Btw, it was using up to 160MB of ram when it crashed. My game on CJS uses ~140MB.
Last edited by Silverforce on Fri Aug 01, 2014 4:47 am, edited 1 time in total.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Aug 01, 2014 4:45 am

RookieDev wrote:@Silverforce i have tested on mobile ever since i started working on my project but it seems now that i want to build,It wants to give me issues.
I would love to use Ludei but i can not figure out why im getting the whitescreen,If i could get help on what the reasons that cause it,i could maybe narrow it down to why its happening.
Right now i can not get a game to play on mobile and it is very stressful.
I am very open to any feedback you have to offer,im at my wits end.


I am willing to help, but I'll need to look at the CAPX to see if there's any concerns. Generally I have no troubles with CJS for Android, or previous XDK builds.

Put it on Google Drive and invite me to access it: [email protected]
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Aug 01, 2014 5:18 am

@Silverforce i sent it your way.Thank you for looking at it. @ArcadEd thank you for the tips,i really dont want to tear apart my project but if all else fails i guess doing that is better than trashing it.
Its really stressful to go through this,and to see everyone else having issues that nobody can explain makes it that much more stressful.All i want to do is make a game,and it feels like i keep hitting roadblocks everytime i get close.Thank you guys.Even tho we have a crap export we have the best Community any engine has by far.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Fri Aug 01, 2014 6:10 am

@RookieDev

I will be frank, forgive me if its seems harsh.

There are so many poorly optimized assets (almost every single art asset is poorly optimized for mobiles!), your game would probably take >400MB of ram on mobiles with CJS and crash on a lot of devices.

Just one example, your Laser Beam asset is a 5 frames of 710 x 20 pixels told to loop 30(!!) times per second. The amount of overdraw is horrendous for mobiles.

You have to think of what each art will be when its actually in the GPU as a texture.

Your Laser Beam, each frame occupies a 1024 x 1024 texture, because its width is too large for the next one down 512 x 512, it has to go to the next one up, 1024 x 1024. That's 4MB of texture memory for that single frame. Not only that, the entire frame is mostly empty and overdrawn (1024 x 1024 textures 30 times per second!). Just that laser beam by itself would kill performance on a lot of devices.

Another asset, your Explosion sprite (exsplosion) is 89 FRAMES! The problem with this is a lot of them are slightly larger than 128 pixels in dimension, so they occupy 256 x 256 texture and again, large areas of it is wasted on overdraw! A single 256 x 256 texture is 256 x 256 x 4 = 262kB of memory, with all your frames, that single explosion is 20MB of memory.

Your ingame background is 1280 x 720p, its the same mistake I did in my first game, making a single large BG, but the mistake here is going above 1024 width. Now that BG is a 2048 x 2048 texture in the GPU OR 16MB of memory. Your menu screen is the same, a 1282 x 722 image, but a 9-patch (not a sprite). I don't know if CJS can handle 9-patch that big as a 2048 x 2048 texture, it would be a black or white texture if it cannot handle it, or even crash.

I think I will write a tutorial to help other mobile devs when I get time, but you CANNOT make a mobile game like this. It won't work and even the best device will struggle to run it or even load it at all.

For now, just know this basic:

All images go into memory as textures, by the power of two sizes only.

16 x 16 = 1KB ram
32 x 33 = 4KB ram
64 x 64 = 16KB ram
128 x 128 = 65KB ram
256 x 256 = 262KB ram
512 x 512 = 1MB ram
1024 x 1024 = 4MB ram
2048 x 2048 = 16MB ram

Never go beyond 2048, many devices will crash since they cannot handle it. Most PCs can handle up to 4096 x 4096 (but some older ones cannot!).

Always try to ensure your sprites take the smallest texture as possible. Never have a thin line (laser) that's very long that it has to go into a massive texture. Make it as a 128 x 128 and stretch it out, change its width to whatever you need but the sprite itself is still 128 x 128.

Also, CJS doesn't support text boxes with input. Only normal text object, but it handles it very poorly if you update your text often. I highly suggest you look up Spritefont usage for your mobile games, its faster & it looks properly on mobiles (not all devices will have the font you specify, PCs have heaps of fonts, mobiles do not!).
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Aug 01, 2014 6:47 am

@Silverforce I do understand what you are saying.Right now when i test my game it runs smooth.It just recently stopped working on Cocoonjs launcher,Everything you explained i already seen working,i do know it can handle it.I have tested this game on my samsung galaxy phone and my samsung galaxy tablet and the FPS was no lower than 58.
Performance is not my issue,My app just stopped working on the launcher,and before the Intel XDK Update i was able to build a perfect Apk. I would never just create a game without testing every step of the way.
Thank you for your feedback and i dont see it as harsh i see it as getting right to your point.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Fri Aug 01, 2014 6:48 am

Great info Silverforce
B
101
S
32
G
11
Posts: 1,546
Reputation: 21,727

Post » Fri Aug 01, 2014 6:49 am

@RookieDev If it doesn't work on the CJS launcher app, most of the time its because the game is loading too much into the memory and it locks up. If you compile it on the cloud and test the debug APK, you can get a better idea of the memory usage (if it finishes loading without crashing).
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri Aug 01, 2014 9:37 am

@Silverforce i beg to differ,I now have my project running at 60 frames per second on XDK Crosswalk! Im so happy!!!
If you would like i could send you a demo to your email.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Fri Aug 01, 2014 11:10 am

RookieDev wrote:@Silverforce i beg to differ,I now have my project running at 60 frames per second on XDK Crosswalk! Im so happy!!!
If you would like i could send you a demo to your email.


Congrats.

XDK doesn't care about asset optimization as such because its just like on PC, it handles memory loading very well. That is its main advantage.

I'm still waiting for IAPs on XDK then its the goto compiler for Android.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests