Am I mad to ignore dynamic content scaling?

Hear me out :slight_smile: I’m continuing my exploration of Corona and I’ve spent the last couple of days playing around with the sprite support. What’s become really apparent is that, using dynamic content scaling and ensuring that I load in the correct sprite sheet for higher resolution devices (and do my own scaling, as the higher resolution sprites don’t appear to be pulled into the dynamic scaling anyway), the scaling does inevitably lead to a blurring of the images due to the variety of scaling amounts on different devices with different aspect ratios. I know this isn’t limited to sprites, but using sprite sheets is what I’ll be doing a lot of.

My problem here is that I just cannot live with that - I wouldn’t want to pay for a game that looked fuzzy, I’m sure others wouldn’t either. For instance on a 1024 x 600 tablet, the scaling necessarily means that imagery is no longer sharp.

Whilst I definitely think that dynamic scaling can be used in some situations, I’m wondering if for my needs I should just ignore it and do my own positioning and decision making.

So, what have other people done? I surely can’t be the only one to think about not using dynamic content scaling and so if you didn’t use it as well, what were your experiences like? And if you did, and released something with it, did the blurring lead to any negative feedback? [import]uid: 115159 topic_id: 20717 reply_id: 320717[/import]

i prefer dynamic scaling because of the ease of use
and really, it sometimes very hard to position all things according to every device out there and it just plain not worth it and can damage game structure

only problem with dynamic scaling is black bars on devices whose aspect ratios different from iphone 3 and 4 generations, thats all [import]uid: 16142 topic_id: 20717 reply_id: 81346[/import]

I take it you mean with letterbox scaling you get black bars? That’s easy to remedy with an oversized background image that’s large enough to cover the variations in widths and heights. Or you can position outside the normal area as well for more control. At least, that’s the kind of things I’ve been doing during my tests.

In terms of positioning all things according to every device, for sure I think it’s more work ignoring dynamic content scaling but the big negative to using it is lack of sharpness on your app full stop on many devices. I think that’s a big negative to be honest. [import]uid: 115159 topic_id: 20717 reply_id: 81348[/import]

If think the best way is to use dynamic scaling and simply provide enough resolutions to scale nicely for all screen sizes. [import]uid: 84637 topic_id: 20717 reply_id: 81349[/import]

If you use Flash to create your animation, you can use Spriteloq, and it supports dynamic content scaling for spritesheets that it generates. I don’t have to think twice about it. It’s no brainer for me, and I cannot live without it. (If you don’t use Flash, I’m sorry I can’t help.)

http://www.loqheart.com/spriteloq/

https://developer.anscamobile.com/forums/spriteloq-flash-corona®-exporter

Naomi
[import]uid: 67217 topic_id: 20717 reply_id: 81350[/import]

Ah that’s an interesting view but, taking the example of 1024 x 600 where ideally I’d want no scaling at all in comparison to the iPad, that’s not really about providing enough resolutions, it’s about refactoring the same imagery for a slightly narrower screen. With scaling that’s out of your hands, isn’t it? That’s what I’ve been coming across, trying different configs etc. [import]uid: 115159 topic_id: 20717 reply_id: 81353[/import]

Hi Naomi, it’s not really about the generation of different resolution imagery, that’s no problem. It’s that in using dynamic content scaling, regardless of what tool you use to create sprite sheets, you will always have devices that necessarily have the content scaled, leading to output that is not sharp. [import]uid: 115159 topic_id: 20717 reply_id: 81355[/import]

Hey @moopf, if I’m not mistaken, with dynamic content scaling, we could set up various scales (not just 1x and 2x) and try to accommodate various device. (That said, I’ve been working on iOS version only, and until I actually work on Android version with various device, I wouldn’t really know what it’s like in practice.)

Naomi [import]uid: 67217 topic_id: 20717 reply_id: 81358[/import]

Hi again Naomi. Yes you can setup various scales, that’s correct (although using sprites you still have to do all the scaling yourself, but that’s a different issue) but there are a couple of real downsides to getting too granular with this:

  1. You’d bloat your app considerably with all the different image versions and,

  2. It still doesn’t resolve not wanting to use different resolution images on a tablet that’s 1024 x 600 and the iPad with its 1024 x 768, but rather reusing the same resolution images but altering the display. [import]uid: 115159 topic_id: 20717 reply_id: 81360[/import]

Ah, yes, @moopf, about the point #2, I see what you are saying. I haven’t worked on Android device, so I didn’t really think carefully about what you were saying. It sounds like something I should keep in mind when I port iOS version over.

Naomi [import]uid: 67217 topic_id: 20717 reply_id: 81383[/import]

Yes Naomi, something like 1024 x 600 is certainly a different case. Dynamic content scaling, whilst it might be easy, won’t come out with sharp results on such a screen (or wouldn’t on an iPad, depending on the setup of your config file) and that’s why I’m really thinking about ditching it and taking the more painful route, to ensure clarity on all screens.

Hmmm going to be fun doing it, isn’t it :slight_smile: [import]uid: 115159 topic_id: 20717 reply_id: 81468[/import]

Thinking about this more today. Is it at all possible, in the config or build settings for a Corona app to do the following:

  1. If the device is a given resolution then don’t employ scaling, but do scale for other resolutions. This would then allow me to get sharp imagery for the more standard, popular sizes (e.g. 600 x 1024, 768 x 1024, 800 x 1280 etc.) but allow me to also catch all on other, less standard sizes.
  2. Omit files from Android or iOS builds to avoid bloating one or the other (most likely bloating the iOS build with sprite sheets not required)

Any thoughts welcome. I’m not sure how complex you can get with the config or build settings. [import]uid: 115159 topic_id: 20717 reply_id: 81478[/import]

Dynamic scaling works well with sprite sheets. The trick is to specify your “sweet spot” in the config.lua for when the high-res should kick in.

My standard config.lua looks like this
[lua]local dFPS = require(“dynamicFPS”);

application =
{
content =
{
width = 320,
height = 480,
scale = “letterbox”,
fps = tonumber(dFPS.currentFPS());
antialias = false,
xalign = “center”,
yalign = “center”,

imageSuffix =
{
["@2x"] = 1.6
}
}
}[/lua]

As you can see above I’ve instructed Corona to kick in the high-res graphics when the resolution of the device running the app is at least 1.6 times the base resolution (320x480). This covers the Galaxy tab and the Kindle Fire.

As for being able to exclude resources from Android/iOS builds, I use Corona Project Manager for that.
What I do is set up 2 projects. One for iOS and one for Android. They both share the same source code, but the resources are different (icons, aac for iOS, ogg for Android etc).
This ensures that I only get the relevant resources in each platform binary without any bloating.
[import]uid: 70847 topic_id: 20717 reply_id: 81484[/import]

Hi swipeware. I’m not contesting that dynamical scaling works, it just doesn’t give me results that I’m happy with. I can’t see why I shouldn’t be creating an app that looks sharp on any device - I would expect that as a customer.

Regarding your config.lua, that’s pretty much the same as I’ve been using. I haven’t got a problem with switching to higher res graphics, I have a problem with the scaling full stop making imagery blurred as Corona scales the canvas to fit. 320 x 480 does not scale perfectly 2x for a tablet that’s 600 x 1024 so, regardless of using higher resolution graphics, they will still get scaled and lose clarity.

There is no sweet spot with dynamical scaling to have no loss of image sharpness - that’s the nature of scaling.

Thanks for your second tip though, that’s a really good idea. [import]uid: 115159 topic_id: 20717 reply_id: 81486[/import]

I’m not sure I understand what you mean.
If you have used 1.6 set as the “sweet spot” then you will get the @2x version (640x960) displayed on a 600x1024 device which is basically identical (and is sharp). [import]uid: 70847 topic_id: 20717 reply_id: 81488[/import]

Hi again swipeware. OK, I think I’m missing something here. I’ve just downloaded your Big Fat Goalie app on Android to my tablet which is 1024 x 600 and yet it looks sharp, like the sprites haven’t been scaled. Are you manually scaling your sprites to retain that, basically by combining the dynamic scaling amount and scaling the sprite so, in effect, it’s shown at full size? Or are you doing something different? I’m wondering if there’s something I’ve missed on dynamic scaling now. [import]uid: 115159 topic_id: 20717 reply_id: 81489[/import]

Yes but my understanding of dynamic scaling is that it scales as much to fit, so the actual scaling won’t be 2x in that example (as there’s only 600px of width, for full 2x scaling it would need 640px) [import]uid: 115159 topic_id: 20717 reply_id: 81490[/import]

This is the beauty of Coronas’s way of handling dynamic scaling, and as you can see it works very well. It doesn’t need to match exactly 2x.

In my app I only have 2 images
320x480 base image
640x960 @2x image

The important thing to define is what I call the “sweet spot”, which I’ve set to 1.6 in config lua.

If you have the same image setup as I do (320x480, and 640x960) try it yourself.

[lua]-- I assume you probably have something like this?
imageSuffix =
{
["@2x"] = 2
}

– change it to this and you’ll get the same results as I do
imageSuffix =
{
["@2x"] = 1.6
}[/lua]

[import]uid: 70847 topic_id: 20717 reply_id: 81493[/import]

Yeah, you know what, I’ve been massively over-thinking this and have gone back to my tests and can see what I’ve been doing incorrectly. I just need to scale the sprites for hi-res 0.5 regardless and they come out sharp (I was trying to take into account the actual scaling that Corona does as well, stupidly). I was trying to be too clever, or rather didn’t quite understand the implications of dynamical content scaling.

So thanks ingemar, what you’ve said has made me realise that I’ve been getting too hung up on it and interpreting it incorrectly. Thanks! [import]uid: 115159 topic_id: 20717 reply_id: 81495[/import]

I’m glad that I could help!

However I’m not letting go just yet :slight_smile:
Are you scaling your sprites yourself? why? [import]uid: 70847 topic_id: 20717 reply_id: 81497[/import]