Jump to content


Photo

Resolution/dynamic re-sizing - best approach?


  • Please log in to reply
8 replies to this topic

#1 Thaudal

Thaudal

    GMC Member

  • GMC Member
  • 242 posts
  • Version:GM:Studio

Posted 08 June 2012 - 09:59 PM

I'm developing a game that is primarily just for iOS (Android may come later, but right now just iOS). It's going to iPhones as well as iPads.

Naturally I need to re-size the game according to the device's screen size.

My first thought was to have a room of 1536x2048 (ipad3) and then set the view in the room to whatever need be (for instance, 768x1024 if run on an ipad2).

But this way, game objects will appear a lot smaller on an ipad3 than on an ipad2, because the view is just re-sized. This isn't optimal.

Can anyone suggest some way to keep the aspect ratio in another manner that keeps everything just about the same size no matter what iDevice it's run on? Currently I have all the graphics in the highest resolution (1536x2048). If possible I would very much like to avoid having more than one version of the graphics, as well as making more versions of the respectable rooms.

Thanks in advance.
  • 0

#2 Lune

Lune

    hic quoque transibit

  • GMC Member
  • 526 posts
  • Version:GM:Studio

Posted 08 June 2012 - 10:26 PM

It's my understanding that Studio now converts to native resolution automatically when full screen. I haven't had the chance to test it on Android yet, but it does that for Windows and iOS.
  • 0

#3 Thaudal

Thaudal

    GMC Member

  • GMC Member
  • 242 posts
  • Version:GM:Studio

Posted 09 June 2012 - 11:01 AM

It stretches to fit, that is correct. However it looks sloppy and scaled if the device screen is too big/small compared to the game room/view, and it doesn't magically fix aspect ratio problems. What I am asking is how *I* can do something actively to make this look as pretty as possible on (at least) all iDevice (excluding iPods) resolutions.
  • 0

#4 Pstadler

Pstadler

    GMC Member

  • GMC Member
  • 58 posts

Posted 09 June 2012 - 12:49 PM

It stretches to fit, that is correct. However it looks sloppy and scaled if the device screen is too big/small compared to the game room/view, and it doesn't magically fix aspect ratio problems. What I am asking is how *I* can do something actively to make this look as pretty as possible on (at least) all iDevice (excluding iPods) resolutions.


If you want to make sure that it is going to look nice on all devices, you'll have to create different rooms with different sizes for all devices. Then check on startup which device the user is on and refer him to the related room.
  • 0

#5 dadio

dadio

    I miss my cupcake

  • GMC Member
  • 1845 posts
  • Version:GM:Studio

Posted 09 June 2012 - 12:56 PM

There's no easy answer to this. Ya have to think about what solutions you can come up with for your particular game.
Whether a game is single screen or scrolling makes a big difference for example.
I'm not a big fan of the auto sizing/scaling/blurry stuff myself... (especially when it comes to the 99 bajillion different Android rezes).

Ya say you're just targeting iOS.
So ya have it easier.

If it were me & I had a game that I had *invested alotta time & effort in that I really believed could do well*, & I was concerned about making it extra sparkly on iPad3, & extra optimal/speedy on others, I would release 2 versions of the game:

1. "HD" iPad3 version @ 1536x2048 (with crazy texture pages).

2. "Standard" iPad2 version @768x1024 with fallbacks (view size changes/extra filler draw outside view/ whatever) to 640x960.
This is stuff that's best thought about in advance & the game built around this idea of it working/looking/playing just as well within a 768x1024 as a 640x960.

If I felt like even more suffering, I might also consider a third version for older (320x480) iPhones (rather than a scaledown that'd be eating FPS)... *if* speed was a problem.

This way you get the most out of each device...
but ya also have a massive timesink on your hands...
*&* the fiddlyness of marketing multiple versions of the same game, which could cause ya a lotta headaches.
*shrugs*
So yeah, there's no easy/magic solution here really (if that's whatchya were wondering).
Anyway, hope that helps.
Somehow.
:turned:
  • 0

#6 Hugo_Peters

Hugo_Peters

    herp derp

  • GMC Member
  • 447 posts
  • Version:GM:Studio

Posted 09 June 2012 - 01:50 PM

Use display_get_width / height () and room_set_width / height (ind) and then room_restart() ;)
If you want to get rid of the portrait issue, check if the height > width and if so let a timer (5 steps) count down and then restart the game.
  • 0

#7 Mark Overmars

Mark Overmars

    Game Maker Creator

  • YoYo Games Staff
  • 805 posts
  • Version:Unknown

Posted 09 June 2012 - 02:57 PM

See my document http://www.gamemaker....com/gmios2.pdf for a solution that deals with the aspect ratio issue. It will still do scaling when required. If you want to avoid that you will have to do everything (including all sprites) at least double.


Mark
  • 2

#8 Thaudal

Thaudal

    GMC Member

  • GMC Member
  • 242 posts
  • Version:GM:Studio

Posted 11 June 2012 - 02:24 PM

See my document http://www.gamemaker....com/gmios2.pdf for a solution that deals with the aspect ratio issue. It will still do scaling when required. If you want to avoid that you will have to do everything (including all sprites) at least double.


Mark



Mark, I adapted your code from the guide. All my graphics are in 768x1024, and so are all my rooms. On iPhone4 it looks perfect, but on iPad2 and iPad3 everything vertical is moshed together (a circle becomes more wide than tall etc.). I thought this took care of aspect ratios - am I doing something wrong?

Here is the code, exactly (I believe) as is in the pdf:

  // Determine the size of the view 
  globalvar VIEW_WIDTH, VIEW_HEIGHT; 
  if (os_type = os_ios && os_device == device_ios_ipad) 
    { VIEW_WIDTH = 768; VIEW_HEIGHT = 1024; } 
  else 
    { VIEW_WIDTH = 640; VIEW_HEIGHT = 960; }   

  // Set the views in the rooms 
  room_set_view_enabled(rooStartscreen,true); 
  room_set_view(rooStartscreen,0,true,(768 - VIEW_WIDTH) div 2, 
           (1024 - VIEW_HEIGHT) div 2, VIEW_WIDTH, VIEW_HEIGHT, 
           0,0, VIEW_WIDTH, VIEW_HEIGHT,0,0,-1,-1,-1); 
   
  // Now go to the title menu room 
  room_goto(rooStartscreen); 

Hope you (or someone else) can help me solve this. Thanks in advance.
  • 0

#9 Thaudal

Thaudal

    GMC Member

  • GMC Member
  • 242 posts
  • Version:GM:Studio

Posted 12 June 2012 - 11:43 AM

I can't really tell wether this code is supposed to work out aspect ratio differences between 640x960 vs. 768x1024, so can anyone please confirm/affirm this before I spend any more time on it?

I'm close to just making 3 versions of every room, but seeing as there will be hundreds of levels, it would be very nice if there was some way around it - like hopefully the code above.

But right now, like I said, it squishes everything to be wider than taller on iPad2 and iPad3, whereas on iPhone4 it's perfect.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users