Author Topic: Dynamic resolutions  (Read 4212 times)

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Dynamic resolutions
« on: 2011-Oct-31 »
Ok so lets say you want to make a Universal app (I'm thinking iDevice but it can apply to all supported devices). You code it for retina but allow scaling so it will work on any resolution (ie. set project resolution to 9998x9999 or the other way around). Excellent, so essentially it will run at 320x480 on a pre-retina, 640x960 on a retina, and 768x1024 on an iPad. No worries there.

Your game runs smoothly on the pre-retina device and well on the iPad, but the retina device (I'm thinking specifically of the lower powered iPhone4 (not S) and iPod 4th gen) just doesn't quite cut it. It looks better sure, it is 4x the pixels, but the power of the device just isn't enough to make it as smooth as the non-retina device.

Ideally you would want the retina device to then run at the non-retina resolution so it can be smooth. But you still want the iPad to be full res.

So how do you go about making it a universal app but actually for an iPhone4 and iPod 4th gen it should be retina resolution? Infact more complicated is the idea that the iPhone4S and iPod 5th gen should have enough juice to smoothly run retina for your game. So how would you make sure the iPhone4 runs non-retina and the 4S runs retina, all off the same universal app?

Just to make it more complicated, lets say your game looks good but seriously there is no amazingly obvious difference between the retina and non-retina version. ie. it's not such a big impact and is hard to notice the difference. Fair enough you could then make sure that non-iPad devices all run at non-retina but the iPad itself runs at full-HD (for a universal app). However there is no reason why your menu or help screens (especially for small harder to read text) cannot be full retina. What I am saying is it possible to change the resolution on the fly for iDevices (or any device really) and if not then why not? Is it not possible once the app has run or can GLB be updated to allow it?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10816
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Dynamic resolutions
« Reply #1 on: 2011-Oct-31 »
Oh dear. I think it's not so easy to switch the resolutions after the engine has initialized.
I mean - with a very lot of work, it might work, but... oh dear.

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: Dynamic resolutions
« Reply #2 on: 2011-Oct-31 »
Would be nice though. I mean at this point there is no way to make a universal app if one of the devices hasn't the capability to handle it's native resolution (but would work fine if reduced to a supported lesser resolution like the iDevices can do). Just that would be quite nice. Not sure what other devices do but because an iOS device will automatically fill the screen fine if running a non-retina app then why not have an option in project settings that if you select iPhone will allow you to set the resolutions against each iDevice type? Ideally it would have a list of each OS (not restricted to one which is only used when you compile) and you can say which resolutions against each device. So can do a universal app where iPad is set to iPad resolution, 4S is retina, ipod 5th gen is retina, 4 is non-retina, and so is ipod 4th gen (and all devices are too). The user can then change as they wish (if the device supports it). So if your game doesn't lag at retina resolutions then can change the iphone4 and the ipod4 to be retina. That wouldn't be that hard to do would it? Esp with the small list of iDevices. Perhaps have a way to add a custom device (uses the name tag to identify it somehow) and an exception resolution (ie. use this if don't know what it is - although I guess it would always be 9998x9999 or 9999x9998 to get the highest resolution for the device)

The end result of changing resolutions at a whim (eg. so menu, help etc options are much more detailed but the game itself is lower res to speed things up) would be perfect, but not exactly amazingly important. If you could perhaps put it down as a low priority task then that would be brilliant. Out of interest I wonder how many games are called HD or Retina and in actual fact only have HD menus. If it can be done on an iDevice then I'm sure people have done it and then tagged them as retina/HD. After all the game itself can be very difficult to tell the difference with resolutions, especially when running fast, whereas small text and the like on the menu/help is much more obvious.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
Re: Dynamic resolutions
« Reply #3 on: 2011-Oct-31 »
Just make a "normal" (non-retina) app and another called HD for iPad. Also, if a user has a iPad + iPhone will have to buy you 2 versions instead of one  :nana:

The Last Angel was always "hd", but a mistake in xcode prevented it running at native ipad resolution. So I uploaded a "hd" version with the idea to have it exposed to iPad owners that missed it on the first launch (as it was buried when the "update/fix" was done for non-hd-that-really-was, as they are also avid of "HD" things for their devices.

This marketing "trick" did work great for iPad and TP  :D
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: Dynamic resolutions
« Reply #4 on: 2011-Oct-31 »
Yeah I know, but is a pain if the whole app is coded to work at any resolution, and doesn't look as good as a single universal app. Plus more of a pain to update.

On the other hand would be better for reporting purposes I guess, plus gives the user the chance to choose which they want and even is good for us to attract HD/Retina lovers.

It suppose that could be ok for now (although I may just stick with the universal idea at the minute as it runs ok on my iPod4), but would be good to have this sort of functionality in the future. Even the first idea (device specific resolution in project settings) would be a good addition and surely not that hard to implement aye Gernot? :)

At this rate though we need to pretty much have every device on the planet to make sure it will all work! Re-mortgage perhaps? ;) On this subject, coupled with our test device thread, how easy is it to test iOS apps on other non-JB devices? Would be great if we could do that without including code. Actually didn't Gernot say there was a way of sharing encrypted gbas files so code was protected? If so that might be the answer. A bit like we did with your TP photo app but for iOS.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
Re: Dynamic resolutions
« Reply #5 on: 2011-Oct-31 »
You have ask yor betatesters their UUID, then add it in the provisioning profiles portal, and sign your app with your testers devices IDs. You can only have 100 devices, and even if deleted, their "slot" is not recovered.

Easy.

With JB it is even easier ;)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: Dynamic resolutions
« Reply #6 on: 2011-Nov-22 »
Whoops forgot I still actually had a thread for this rather than a question in another thread. Anyway I've just asked this elsewhere but better if mention it here really. Basically Gernot do you have any thoughts to what I said about project options and specific device overrides? Essentially I don't like the idea of upset people buying a HD version which is too slow for their ipod4 at retina so they have to buy the non-HD instead too. I mean how do you give money back? A better scenario is it turns out a certain model is sluggish (and you didn't know it) at HD so you simply change the settings in project options for that model to use non-HD. Every other HD model carries on working fine. A single update to Apple and then the person is happy (assuming they don't mind their retina device can't handle your retina game).

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1785
    • View Profile
Re: Dynamic resolutions
« Reply #7 on: 2011-Nov-22 »
Sorry, but your profile pic is putting me off, when I read I hear the boss from the IT Crowd in my head...
 :S
« Last Edit: 2011-Nov-22 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10816
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Dynamic resolutions
« Reply #8 on: 2011-Nov-23 »
I am unsure how to deal with other screen sizes. I see if I can enable setscreen after the program start

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: Dynamic resolutions
« Reply #9 on: 2011-Nov-23 »
Quote
Sorry, but your profile pic is putting me off, when I read I hear the boss from the IT Crowd in my head...
Close but not quite. Watch Darkplace for exactly how I sound in my head, and for about 2 weeks in real life at the time :)

Quote
I am unsure how to deal with other screen sizes. I see if I can enable setscreen after the program start
Would be awesome if we can change the screen res after the program starts. For iOS devices we could even do simple benchmark tests to see how fast the hardware is running and then decide on the res for the main game based on that and still have a high res for the menu/cut scenes. Can we access how much memory is available? That could be another consideration.

Failing that though a simple change to the project settings would do. I mean you already have the target resolution in project settings, all you need to do is add a list of devices for each OS. Against each device have the target resolution. Make it so it either uses the default res for the OS (probably 9998x9999 if using scaling code which lets face it you should be to even talk about this subject) or a new overriding res. Then when the app starts check the device and set the resolution not to the default res, but the device res if it has an overriding setting. Ok so not as good as giving us total control over the resolution so we can change it at will, but a good compromise. As I said before, then if someone complains the iPod4/iPhone4 is sluggish (because you were only testing on the 4S) then you can quickly change the ipod4/iphone4 devices (maybe only ipod4 as it maybe a memory issue and iphone4 would be fine) to low-res, recompile, and send to Apple for an update.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

  • Guest
Re: Dynamic resolutions
« Reply #10 on: 2011-Nov-23 »
What I do, after the user changes resolution is effectively re-start the program, ie all graphic, sounds etc are deleted and then re-loaded after a screen resolution change.  Seems to work on most platforms...

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: Dynamic resolutions
« Reply #11 on: 2011-Nov-23 »
+1 for being able to set the iDevice resolution so we're able to do universal binaries to support 480x320, 940x640, 1024x768 and sudder the thought but the iPad 3's 2048x1536.

Talking of 2048x1536 which is now the iPad's 3 display (confirmed as far as screen production goes). Are we seriously expected to believe that the iPad 3's GPU will be able to handle full on 60fps games at 2048x1536? - My thinking is that games will really still need to be at 1024x768 and the 2048x1536 will only really be used for non gaming apps.

But I digress... +1 for being able to change resolution to allow for universal iDevice binaries  :good:

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3958
    • View Profile
    • Space Fractal
Re: Dynamic resolutions
« Reply #12 on: 2011-Nov-23 »
You should, if you ask me, always support any native resolutions the device support. Users have brought retina devices to see HD graphics, not SD graphics (howover not all type of games might not need retina support of course throught).

Howover if the device can't support 60fps, you could fall back to 30fps instead, and/or remove some graphics details for that hardware. This is what I does (I also have some code to detect which hardware people have and set some settings for that automatic under launch).

I could also been some upset if I brought a HD, that run slow (under 30fps) and need to get a SD version for more mone.

Apple have not released that many device, so its easy to detect. Its much worse for Android, here I could no other to let possible to change graphics details for those users.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline Crivens

  • Prof. Inline
  • *****
  • Posts: 913
    • View Profile
Re: Dynamic resolutions
« Reply #13 on: 2011-Nov-23 »
Quote
+1 for being able to set the iDevice resolution so we're able to do universal binaries to support 480x320, 940x640, 1024x768 and sudder the thought but the iPad 3's 2048x1536
You already can. Set the resolution to 9998x9999 or 9999x9998 (depending on orientation) and it will use the default resolution of your device. Use scaling code and all is good. The problem occurs when a device is not powerful enough or have enough memory to handle the default resolution. A good example is a 3D routine I wrote a while back which did hardly anything really but had a fair few objects. It ran fine on pre-retina devices and better than retina devices (Touchpad). But my ipod4 dropped a lot of frames. Everything else was maxing 60fps but the ipod was only getting 30FPS. Drop the resolution on the ipod to 320x480 and it was fine (which iOS then fills the screen with so you don't even know the resolution has dropped). Another example is memory. So there is hardly no difference between the ipod4 and the iphone4 but memory is twice as much in the iphone. All this could be handled if we had a list of devices with independent resolutions in project options (at least for iOS. I don't know what happens if you try a low res on android). The ability to change the res on the fly would be good too as you could use benchmarking to decide the resolution and size of textures to load.

Quote
You should, if you ask me, always support any native resolutions the device support. Users have brought retina devices to see HD graphics, not SD graphics
I see what you are saying, but don't really agree. A lot of games are not that easy to tell the difference between HD and SD, plus sometimes it's just impossible to get 60FPS at full HD. Just fill the screen with a complicated textured 3D plane (ie. flat panel) and watch an ipod4 drop it's FPS in retina, but be fine in non-retina. The screen is the same size so it's just a matter of sharpness and even then put them side by side without small text and it's not that easy to tell the difference. It's pretty minimal. Personally my current 3D development game looks so similar side by side (even though graphics are made for retina) with SD and HD (3GS and ipod4) that I could get away with not bothering with HD.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: Dynamic resolutions
« Reply #14 on: 2011-Nov-23 »
Quote
You already can. Set the resolution to 9998x9999 or 9999x9998 (depending on orientation) and it will use the default resolution of your device. Use scaling code and all is good.

I know =D but I, like you, want to be able to in certain circumstances (universal binary) set the resolution for all iPhones to 480x320 even when it's a the HD display but still allow for iPad's. Currently I can do a universal binary but as you mentioned it will default down to the max resolution of the device. This is all well and good some of the time but not all of the time, for example 3D flows much smoother in the iPhones at 480x320 resolution (excluding the 4S as I don't have one to test).

I also would like to be able to (on iPhone 4+) allow the option for the user to run in HD mode. This way they can choose between super sharp graphics vs super smooth game play.

Quote
I could also been some upset if I brought a HD, that run slow (under 30fps) and need to get a SD version for more mone.

Well really it's Apples fault for releasing the iPhone 4 which at 960x480 can't match the performance of a 3GS running at 480x320. The fill rate wasn't substantially improved until the iPad 2 and I assume the 4S applies to that too. It's a bit crazy when you can develop a 3D games for the 3GS and it runs slower on the iPhone 4 due it's HD resolution and underpowered GPU.

The iPhone / iPod Touch 4 running at it's native resolution *should* really be able to outperform earlier iDevices running at their native resolution but they dont unfortunately, eg iPhone 4 vs 3GS.