Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by phi

I have a problem with Ejecta when it is running on a real iDevice.
After the EJECTA logo the screen is black and you can see in the Xcode window that the resources are loaded. It is also creating a lot (!) of offscreen Canvases for about 30 seconds (see excerpt below).

When its done the screen briefly shows the loading bar and the game starts.
This is only happening on a real device. In a browser or a simulator it works normal (loading bar right after the logo and about 3 seconds before the game starts).

Ejecta[4812:416431] Creating Offscreen Canvas (2D): size: 422x9, retina: yes = 422x9, msaa: no
Ejecta[4812:416431] Creating Offscreen Canvas (2D): size: 422x9, retina: yes = 422x9, msaa: no
Ejecta[4812:416431] Creating Offscreen Canvas (2D): size: 1688x36, retina: yes = 1688x36, msaa: no
Ejecta[4812:416431] Creating Offscreen Canvas (2D): size: 32x32, retina: yes = 32x32, msaa: no
Ejecta[4812:416431] Creating Offscreen Canvas (2D): size: 128x128, retina: yes = 128x128, msaa: no
[..]

9 years ago by Joncom

Other than "creating offscreen canvas", are there any other messages that might be relevant?

9 years ago by phi

The first message:
objc[5391]: Class JSWTFMainThreadCaller is implemented in both /System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore and /private/var/mobile/Containers/Bundle/Application/[..]/Ejecta.app/Ejecta. One of the two will be used. Which one is undefined.

Then 2 (?) Canvases are created (iPad 2 screen size)
Creating ScreenCanvas (2D): size: 1024x768, style: 1024x768, retina: yes = 1024x768, msaa: no
Creating ScreenCanvas (2D): size: 1024x768, style: 1024x768, retina: yes = 1024x768, msaa: no

Then all assets are loaded (4x each)
Loading Sound(OpenAL): media/sounds/coin.mp3
Loading Sound(OpenAL): media/sounds/coin.mp3
Loading Sound(OpenAL): media/sounds/coin.mp3
Loading Sound(OpenAL): media/sounds/coin.mp3
[..]

And after that 96 offscreen canvases of different sizes are loaded
Creating Offscreen Canvas (2D): size: 48x32, retina: yes = 48x32, msaa: no
Creating Offscreen Canvas (2D): size: 192x128, retina: yes = 192x128, msaa: no
Creating Offscreen Canvas (2D): size: 32x32, retina: yes = 32x32, msaa: no
Creating Offscreen Canvas (2D): size: 128x128, retina: yes = 128x128, msaa: no
Creating Offscreen Canvas (2D): size: 422x9, retina: yes = 422x9, msaa: no
Creating Offscreen Canvas (2D): size: 422x9, retina: yes = 422x9, msaa: no
Creating Offscreen Canvas (2D): size: 1688x36, retina: yes = 1688x36, msaa: no
 Creating Offscreen Canvas (2D): size: 128x128, retina: yes = 128x128, msaa: no
Creating Offscreen Canvas (2D): size: 512x512, retina: yes = 512x512, msaa: no
[..]

The last message is a memory warning
Received memory warning.

Did I forget something? I just put the App folder into the Ejecta folder. It is a fairly simple scene that runs nicely at 60fps once it is loaded. The main problem is the long loading time with the black screen (no loading bar). Apple might reject the Game because of that.

Could someone please post the Xcode output for a simple ImpactJS scene in Ejecta?

9 years ago by Joncom

I don&039;t see anything concerning in the output you shared. Maybe try putting a few #console.log('Tracer'); calls throughout your code. Like in the game init, the player init, etc. So you can see how far it gets. Maybe the game is running, but there is something wrong with the drawing?

9 years ago by phi

Everything is loaded as it should be (is it normal that every sound is loaded 4x?).
The main problem is that on the iDevice everything seems to be loaded before the loading bar is shown (-> the screen is black after the ejecta logo).

On mobile Safari/Chrome loading takes about two seconds (loading from a server!).
The compiled Ejecta App on the device loads about 15 seconds while showing a black screen instead of the loading bar. Most of the loading time is used creating the offscreen canvases.

9 years ago by Joncom

Interesting. I don't suppose your game is hosted on Github and could be freely downloaded and tested? Or maybe uploaded somewhere else?

Regardless, one approach to figure this out might be:

1. Confirm that you can run vanilla Ejecta OK on your iDevice.
2. Start removing chunks of functionality from your app until it runs on your iDevice.
3. Whatever chunk you removed, right before it started working, contains the problem.

9 years ago by phi

I tried a blank Ejecta project and started to add content step-by-step.
As soon as Impact is loading the assets (≈ 300kb). The black screen thing (while loading) is only happening in Ejecta. I tried cocoonjs and the same project works there. The loading time is still >10 seconds but the loading bar shows as it should.

In a browser the game loads in about one second. Most of the Ejecta loading time is used creating the 90+ offscreen canvases. Is this normal?

9 years ago by Joncom

Regarding slow load-times, maybe this documentation is relevant?
when running under Ejecta, always call ig.main() with a scale of 1. Don't let Impact do the scaling, or load times will be really long
Regarding the black screen after Ejecta logo, are any of your images very high resolution? I know that's been a cause of issues for some people in the past.

9 years ago by phi

The Ejecta scale was the solution. I did miss that part of the documentation.
Loading is blazing fast now. Thank you very much for your help.

Edit:
There is a new issue now. Scrolling is very choppy even tough the frame rate is at a solid 60fps. I am using the Biolab camera plugin. This does not seem to work.

9 years ago by Joncom

A new unrelated issue might be better resolved under a new thread. Also, providing some code showing how you're moving the camera might be useful.
Page 1 of 1
« first « previous next › last »