Possible Frame Rate Issue? I'm not sure what this is

Hello all,

I recently discovered an issue while testing my app on the Corona Simulator. I used the tutorial for the ultimate config.lua file and I have since suspected that something was off.

I have done all the proper labeling of my graphics with the appropriate @2x prefix for images at a scale of 2X

I have noticed that when I test on devices where the @2x images should be used, it would appear as though the images were not as sharp as they would seem they should be. corners would look jagged and any circular images also looked quite choppy.

I tried posting about this a while ago and it was recommended to me that I alter one of my @2x images from the non-prefix image and see if it was in fact substituting the images.

I ran this test and it did seem to be the case that the images were getting substituted for the proper images with the @2x, so I decided to leave it alone for the time being and address it later.

I have since been testing on the devices that would not require the @2x prefix and everything has been going fine. I recently decided to switch over to a @2x device to check up on things and I noticed something that was not happening before…

When I test on the corona simulator with a @2x devices, the frame rate seems to take a huge dive and everything looks extremely laggy.

When I switch back over to a non-prefix device, everything runs smoothly.

I recorded a video of what was happening so you all could see and possible give me an idea as to how to fix it.

In the video I make sure to point out what device the simulator is on and I also highlight in to console window a print value that shows what prefix is being used (nil for no prefix).

Please excuse the naturally choppy quality of the video, I did notice that the recording seemed to make EVERYTHING lag a bit even when in reality the non-prefixed devices run smoothly, BUT you can see the huge difference every time I switch to a @2x device.

https://youtu.be/rO2Iz059xAQ

Can you post your config.lua?

Sure, basically just whats shown in the tutorial for updating the ultimate config.lua file

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.floor( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.floor( 800 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.3, }, }, }

Still no clear answer for this, hopefully someone will be able to look at it today and help me figure it out

Try changing your image suffix to this
imageSuffix =
{
["@2x"] = 2.0,
["@4x"] = 4.0
}

Also try changing your fps to 60

Also make sure your images are set at the right resolution. Example ball.png 100x100, ball@2x.png 200x200, ball@4x.png 400x400

Thanks for the suggestions.

I double checked all my images and they are correct for their sizing.

I tried your other two suggestions each individually. Changing to 60fps did not seem to help, so I put it back to 30fps and then I changed the suffix portion to ["@2x"] = 2.0  (I do not have @4x images). and it seems to have worked for the issues I was having with the phone @2x devices, so a big THANK YOU! there lol

I noticed that I am still having the issue with high res tablet devices (iPads) should I create the @4x images for iPad use? I suspect that would be the problem.

Yes

Just a quick explainer here. The way this works is Corona takes the physical screen width and and compares it to the defined with in config.lua (for letterbox)

if your with is 800 points and you’re on an iPhone 5 - 640 pixels wide, then your scale value is 0.8. 0.8 is < than the 1.3 you had in your config.lua, so it will use your normal 1x assets. In fact any screen less than 800 * 1.3 or 1040px wide will use the 1x assets and 1040px and greater would use your @2x assets. Changing the config.lua to 2.0 means you’re going to use your 1x assets on screens 1599 px or less and your @2x assets on 1600px and greater.

Now if you used a 320x480 content area, your @2x assets would be picked up on screens 640 and greater and if you have @4x assets they would be picked up at 1280px or greater (if you included the @4x option in config.lua).

Can you post your config.lua?

Sure, basically just whats shown in the tutorial for updating the ultimate config.lua file

--calculate the aspect ratio of the device local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 800 or math.floor( 1200 / aspectRatio ), height = aspectRatio \< 1.5 and 1200 or math.floor( 800 \* aspectRatio ), scale = "letterBox", fps = 30, imageSuffix = { ["@2x"] = 1.3, }, }, }

Still no clear answer for this, hopefully someone will be able to look at it today and help me figure it out

Try changing your image suffix to this
imageSuffix =
{
["@2x"] = 2.0,
["@4x"] = 4.0
}

Also try changing your fps to 60

Also make sure your images are set at the right resolution. Example ball.png 100x100, ball@2x.png 200x200, ball@4x.png 400x400

Thanks for the suggestions.

I double checked all my images and they are correct for their sizing.

I tried your other two suggestions each individually. Changing to 60fps did not seem to help, so I put it back to 30fps and then I changed the suffix portion to ["@2x"] = 2.0  (I do not have @4x images). and it seems to have worked for the issues I was having with the phone @2x devices, so a big THANK YOU! there lol

I noticed that I am still having the issue with high res tablet devices (iPads) should I create the @4x images for iPad use? I suspect that would be the problem.

Yes

Just a quick explainer here. The way this works is Corona takes the physical screen width and and compares it to the defined with in config.lua (for letterbox)

if your with is 800 points and you’re on an iPhone 5 - 640 pixels wide, then your scale value is 0.8. 0.8 is < than the 1.3 you had in your config.lua, so it will use your normal 1x assets. In fact any screen less than 800 * 1.3 or 1040px wide will use the 1x assets and 1040px and greater would use your @2x assets. Changing the config.lua to 2.0 means you’re going to use your 1x assets on screens 1599 px or less and your @2x assets on 1600px and greater.

Now if you used a 320x480 content area, your @2x assets would be picked up on screens 640 and greater and if you have @4x assets they would be picked up at 1280px or greater (if you included the @4x option in config.lua).