Resolution Question

Previous topic - Next topic

MrPlow

Hi

I am building a game and plan to port to iPhone...however the std res of iPhone is only 320 x 480 so this puts a lot of limits on what I am doing...

should i be bothered and just use the iPhone 4 resolution as my minimum or is the market for 320 x 480 too big to ignore at this stage??

G
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

hardyx

#1
There are many 3G/3GS iphones in the market that you can't ignore. I think the 30%/40% of the iphones/ipods are 3G/3GS, but this is changing everyday. There are a growing number of iphone 4/4S but standard resolution can be played in any iphone, and then you can made a special HD version if you want. But you must know, that in a smartphone the screen, the memory and cpu speed are very limited compared with a desktop computer.

Crivens

Yeah, you may find that something that works well for a 4S at retina is sluggish for a 4 and would be better with pre-retina. The ipod4 is also a good example as it has half the memory of an iphone4. Plus the screens are the same size so the difference in pixel density is only really how crisp the graphics are rather than limited space for your game.

You could look at auto resizing code. If you set the resolution to 9998x9999 then it will max the resolution in portrait mode. Browse the forum for techniques to automatically scale the graphics. I wrote one that will resize graphics (once) when the game is first loaded which has the advantage of using less memory and being faster but the disadvantage of requiring quite a bit of mucking about with calculations when drawing and pointing, and Ampos wrote one which resizes everything at the screen draw stage which has the advantage of being easy to use but uses up memory more and is slower (good for puzzle games which I intend to use on an older game of mine).

Even with auto-resizing I would like more control over resolutions. For example my latest game was a little sluggish (until I put in performance enhancements) on my ipod4 at retina resolution. All other devices (including non-retina iOS, and things like Touchpads with a greater resolution) were fine, so it must be that the ipod4 is maxing it's capability. I asked Gernot if I could change the resolution at any point but it would be too complicated for mobile devices apparently. Otherwise I could have snazzy high res menu and low res game (which is hard to tell the difference on my game). As an easier option I asked if instead (along with my auto graphics resize module) we could have a more complicated project options screen that could list all devices for the OS and you could select the resolution for each. So if your game is sluggish on the ipod4 for retina then set it to non-retina, but iphone4 (possibly same as ipod4 unless memory is effected) and 4S to retina, and so on. I haven't heard anything yet though I have been on holiday. Gernot, any thoughts?

Until then perhaps is better to have a HD and non-HD version. Only thing is how do you handle upset customers who buy the HD version, it turns out sluggish, and have to buy the non-HD version too? All because you didn't have all the hardware to test it all?

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

Slydog

If possible, try to keep your game logic and your presentation logic independent, so you can support multiple devices and resolutions.

For example, have some global settings defined (perhaps via an .ini file, or normal globals) for details such as graphic size, screen size, etc.  You may also need to have multiple graphic files, for each resolution / tile size.

iPhone3G.ini
Code (glbasic) Select
screen_size_x = 480
screen_size_y = 320
tile_size_x = 32
tile_size_y = 32


iPhone4.ini
Code (glbasic) Select
screen_size_x = 960
screen_size_y = 640
tile_size_x = 64
tile_size_y = 64


Then in your code you can calculate how many tiles fit on your screen:
Code (glbasic) Select
tiles_x = screen_size_x / tile_size_x
tiles_y = screen_size_y / tile_size_y


Use these variables in your game logic, so nothing is hard coded, such as:
Code (glbasic) Select
// Draw Tile Map
FOR x = pos_x to pos_x + tiles_x
  FOR y = pos_y to pos_y + tiles_y
    ...
  NEXT
NEXT


It may be a little more work up front, but it will pay off in the long run.
Keep in mind not all aspect ratios are the same, so on an iPad, the tiles_x will be a fraction, unless you make your tile size stretched a bit.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

spacefractal

You should do both SD as well HD, if possible. This mean you have much more market place to sell the game in as well other device (Android is a hell about 117 kinds of resoultions, if you are not aware about it). Some graphics might not need in both resolutions, its depend on the content. Example still pictures could been HD and scaling down to SD in code.

IPad is also use 4:3 , but you could eventuelly just center the screen, so its less notiable and then use use controls that suit for the bigger screen (eventuelly in the border, but its depend style of the game).

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/