Jump to content

Weird drop on fps only on iOS browsers [reward if you find how to fix it]


totallybueno
 Share

Recommended Posts

Hi there,

I´m having a weird (at least for me) problem with a very basic game... the game is running at 60 fps on desktop and Android browsers (not .apk, only tested on browsers) but it gets reaaaaaaaally slow at some point on iOS browsers (tested with Safari, Chrome and Firefox on iOS)

If you test the game, only on iOS, and you get the parachute at the beginning of the game, you´ll see the the game gets really slow (not hapenning on desktop/android) and I don´t know why, I tried to find the problem but I´m not being able to find it... so you´ll have a reward if you help me to find it :) (a few bucks, don´t ask for too much money...)

 

Link to comment
Share on other sites

I noticed with Construct 2 that patterns (i.e. repeating images) in canvas2d is *super* slow on iOS. Doing the same in WebGL mode is perfectly fast though.

Looks like your game defaults to canvas2d (going by the console log) - I don't know why anyone would do that these days, WebGL is literally up to 10x faster.

Link to comment
Share on other sites

Hey totallybueno! Nice game concept, very catchy and fun to play! I tried this on my macbook pro, and it runs smooth as a button, tried on my Iphone 6, and it's sluggish. I'm not entirely sure of the reason why, however I have a few suggestions for you. 

1: Force Phaser to build the game as a canvas or WebGL. this may make significant different if it's on auto, and it's selecting Canvas or WebGL where it should be. 

2: Comment out all of your preloading code, so the game doesn't load any assets. what you should be left with is a black screen with lots of green boxes where the texture isn't rendered to the canvas. You can then test if it's the asset sizes that the gpu can't keep up re-rendering to the screen.

3: Disable any physics that currently take place and test in the browser. 

On a side note, I didn't take a look at the code, I'm not sure if it was minified or not, but don't have time right now, however, I noticed that even on an i7 250gb ssd 8gb ram, there was significant notice in fps drop during the state transition between the game state and the gameover state. this is when the screen fades black and changes state, or maybe in the same state, just hiding sprites. This won't be causing the issue as discussed above, but I thought I'd mention that you probably want to look at this at some point too :)

Link to comment
Share on other sites

Thanks guys, I changed to webgl and it seems that is getting faster buuuuuut, I´m getting a few errors that break the game, so the camera is not following the player so I can´t play anymore :(, but well, at least it seems that definitely is getting faster. Do you guys know what these errors "mean"?

 

Error: WebGL: texImage2D: Failed to get data from DOM element. Implicit width and height for this upload will be zero.
Error: WebGL: drawElements: Active texture 0 for target 0x0de1 is 'incomplete', and will be rendered as RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: The dimensions of `level_base` are not all positive.
Error: WebGL: texImage2D: Failed to get data from DOM element. Implicit width and height for this upload will be zero.
Error: WebGL: drawElements: Active texture 0 for target 0x0de1 is 'incomplete', and will be rendered as RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: The dimensions of `level_base` are not all positive.

Link to comment
Share on other sites

On 1/4/2016 at 11:28 AM, totallybueno said:

Error: WebGL: texImage2D: Failed to get data from DOM element. Implicit width and height for this upload will be zero.
Error: WebGL: drawElements: Active texture 0 for target 0x0de1 is 'incomplete', and will be rendered as RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: The dimensions of `level_base` are not all positive.
Error: WebGL: texImage2D: Failed to get data from DOM element. Implicit width and height for this upload will be zero.
Error: WebGL: drawElements: Active texture 0 for target 0x0de1 is 'incomplete', and will be rendered as RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: The dimensions of `level_base` are not all positive.

 

Phaser.Cache.isSoundDecoded: Key "bullet-sound" not found in Cache.

Can anyone help me with these errors? This is happening since I updated Phaser from 2.3.0 to 2.4.6 and I have no idea about this stuff :(

 

The sound error is being throw by aaaaaaall the sounds, and I´m using the setDecodeCallback(), wich was working perfectly in 2.3.0 (now seems to be working, this.startTheGame() is only a state change)
 

 

this.game.sound.setDecodedCallback([
            'bullet-sound',
            'another-sound',
            'third-sound',

             ...
            'last-sound'
            ], this.startTheGame, this);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...