How do masks perform on Android?

Hi,
I am trying to build a puzzle app for Android. I already made the app for iOS and it works well.
On Android, the loading is slow, severe delay between the touch and drag and the screen refresh.

I am running it on a samsung galaxy tab 2 10"

The puzzle pieces are made by masking the main image with a puzzle piece. The puzzle pieces range form 9-25. 9 is slow to load and respond. 25 pieces is hell. On the ipad 2 there is no difference.

Is there some kind of trick to use masks on Android?

Thanks [import]uid: 100901 topic_id: 33145 reply_id: 333145[/import]

I’m sure the iPad has a much faster processor and GPU than the Galaxy Tab and this is one of the reasons you’re seeing a difference. The lag could be caused by what your app is doing while you’re trying to drag the pieces around. Do you have an enterFrame listener that is doing something in the background? If so, I would try disabling sections of your code to determine what’s giving you the delay.

If all you’re trying to do is drag images around, it could be that the device is underpowered for what you’re trying to do.

You could try running the DragMeMultitouch sample and see if you notice any lag is dragging the objects around. [import]uid: 7559 topic_id: 33145 reply_id: 131622[/import]

The delay is only at the screens that use a mask to create the puzzle piece. I also have screens that don’t have masks but are regular png’s that are dragged around. No enterFrame listeners. I think there is a code on the code exchange that uses a similar method I am using made by Jonathan Beebe. Also everything is set up from an imagesheet to better conserve memory.
Will see if I can find something to turn off that could be slowing it down.

Isn’t the samsung galaxy tab 2 one of the better android devices? And this was tested on the ipad 2 not the newer ones.

Thanks for the reply. [import]uid: 100901 topic_id: 33145 reply_id: 131626[/import]

I’m sure the iPad has a much faster processor and GPU than the Galaxy Tab and this is one of the reasons you’re seeing a difference. The lag could be caused by what your app is doing while you’re trying to drag the pieces around. Do you have an enterFrame listener that is doing something in the background? If so, I would try disabling sections of your code to determine what’s giving you the delay.

If all you’re trying to do is drag images around, it could be that the device is underpowered for what you’re trying to do.

You could try running the DragMeMultitouch sample and see if you notice any lag is dragging the objects around. [import]uid: 7559 topic_id: 33145 reply_id: 131622[/import]

The delay is only at the screens that use a mask to create the puzzle piece. I also have screens that don’t have masks but are regular png’s that are dragged around. No enterFrame listeners. I think there is a code on the code exchange that uses a similar method I am using made by Jonathan Beebe. Also everything is set up from an imagesheet to better conserve memory.
Will see if I can find something to turn off that could be slowing it down.

Isn’t the samsung galaxy tab 2 one of the better android devices? And this was tested on the ipad 2 not the newer ones.

Thanks for the reply. [import]uid: 100901 topic_id: 33145 reply_id: 131626[/import]

Hey Juf,

I was hoping to get our input. I am trying to do something similar right now by making a puzzle app and masking the main image with the piece masks. I am having strange results. What are the dimensions of the puzzle images you are loading?

Thanks,
Scott [import]uid: 79834 topic_id: 33145 reply_id: 133983[/import]

Hey Juf,

I think you should change your frame rate in config.lua from 30 fps to 60 fps.
Add the following line in CONFIG.LUA and check
fps = 60,

Most probably,It will solve your problem.

Regards,
Haroon [import]uid: 108129 topic_id: 33145 reply_id: 133993[/import]

Thanks Haroon will try that.

For the puzzle images, make sure there is enough black space around your image. In the masking section of the manual there is a guide on what your image should be.
There should be a black area of a few pixels wide. Also the image resolustion should be dividable by 4 I think.
If you don’t follow these rules your masks turn out wonky and mismatched. [import]uid: 100901 topic_id: 33145 reply_id: 134052[/import]

Hey Juf,

My puzzle images and masks meet this criteria. On my 9 and 12 piece puzzles, I notice no performance issues. However, once 12 pieces are placed on the puzzle, every piece after has noticeable slowing as it is dragged around (so that by piece 24 on the 24 piece puzzle, it is skipping a very large amount of frames and the piece jumps around as it is dragged).

I do an animation at the end. Initially all the animations were slowed, but found that setting all the pieces to isVisible = false resolved this.

Do you have performance issues on the 24 piece puzzles?

The other odd thing is that no performance issues occur on iPhones, but do on all tablets I’ve tested on. This hold true even when I remove the @2x and @4x puzzle images.

Any feedback would be appreciated.

Scott [import]uid: 79834 topic_id: 33145 reply_id: 134054[/import]

Hey Juf,

I was hoping to get our input. I am trying to do something similar right now by making a puzzle app and masking the main image with the piece masks. I am having strange results. What are the dimensions of the puzzle images you are loading?

Thanks,
Scott [import]uid: 79834 topic_id: 33145 reply_id: 133983[/import]

Hey Juf,

I think you should change your frame rate in config.lua from 30 fps to 60 fps.
Add the following line in CONFIG.LUA and check
fps = 60,

Most probably,It will solve your problem.

Regards,
Haroon [import]uid: 108129 topic_id: 33145 reply_id: 133993[/import]

Thanks Haroon will try that.

For the puzzle images, make sure there is enough black space around your image. In the masking section of the manual there is a guide on what your image should be.
There should be a black area of a few pixels wide. Also the image resolustion should be dividable by 4 I think.
If you don’t follow these rules your masks turn out wonky and mismatched. [import]uid: 100901 topic_id: 33145 reply_id: 134052[/import]

Hey Juf,

My puzzle images and masks meet this criteria. On my 9 and 12 piece puzzles, I notice no performance issues. However, once 12 pieces are placed on the puzzle, every piece after has noticeable slowing as it is dragged around (so that by piece 24 on the 24 piece puzzle, it is skipping a very large amount of frames and the piece jumps around as it is dragged).

I do an animation at the end. Initially all the animations were slowed, but found that setting all the pieces to isVisible = false resolved this.

Do you have performance issues on the 24 piece puzzles?

The other odd thing is that no performance issues occur on iPhones, but do on all tablets I’ve tested on. This hold true even when I remove the @2x and @4x puzzle images.

Any feedback would be appreciated.

Scott [import]uid: 79834 topic_id: 33145 reply_id: 134054[/import]

I was using ipad sized images. I will see if iPhone 5 images work better. This is only an android problem. I get the slow down on 9 images and up. The framerate option helped a bit, but the loading times are still ludicrous compared to iphone and ipad.
I also turned antialiasing off.
As it is an android only problem and android isn’t really a sustainable platform income wise. I am not sure if I will put the effort in. For every 100 iPhone apps I don’t even sell one android. Still might be nice if I found out why it doesn’t work as well as it does on iOS devices. [import]uid: 100901 topic_id: 33145 reply_id: 136693[/import]

I was using ipad sized images. I will see if iPhone 5 images work better. This is only an android problem. I get the slow down on 9 images and up. The framerate option helped a bit, but the loading times are still ludicrous compared to iphone and ipad.
I also turned antialiasing off.
As it is an android only problem and android isn’t really a sustainable platform income wise. I am not sure if I will put the effort in. For every 100 iPhone apps I don’t even sell one android. Still might be nice if I found out why it doesn’t work as well as it does on iOS devices. [import]uid: 100901 topic_id: 33145 reply_id: 136693[/import]