Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Optimize your game for all resolutions

Discussion in '2D' started by Joralin, Mar 15, 2015.

  1. Joralin

    Joralin

    Joined:
    Aug 27, 2014
    Posts:
    30
    I nearly finished my first 2d unity game, and now im wondering how i can publish it the best way for all different type of screens (4:3, 16:10, 16:19).

    I want to create a web-built that runs in the browser.


    How do you manage it, that you game is always shown in the best way, no matter what aspect ratio the players screen has?


    I could of course optimize the game for 4:3 and if the player has a wider screen, more of the game background is shown.

    The other solution could be that on wider screens black barriers are shown on the sides.

    But i dont like both of these options.

    Is there a better way?
     
  2. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    I have the same question, i searched around and watched a few videos, but with unity 5 there are many options, from asset bundles to using the resources folder and switching at run time. Many ways to do this with UI also.


    But what is the best practice? if anyone knows, please share.
     
  3. Joralin

    Joralin

    Joined:
    Aug 27, 2014
    Posts:
    30
    Wow it seems that optimizing for resolutions is a sience for iteself.

    Thank you for the link.
     
  4. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Well, it is a science in itself.

    Take a moment and reflect upon the issue:
    • You have creative content.
    • You have multiple end user devices.
      • Different Control Schemes (Keyboard & Mouse vs Touch)
      • Different Physical Sizes (Monitors, Tablets, Phones)
      • Different Resolutions
      • Different Aspect Ratios

    Taking another medium - Film & Television...
    Watch this video for a history of the changes to aspect ratios in Film and Television, and while you're watching this, think all the time about how you could show these images on: A 4x3 tv, a 16x9 tv, any of the many mobile devices keeping in mind the solutions of stretching, cropping and letter boxing:


    Some highlights are:



    This sums up to why we have 16:9 for our "Wide Screen HD TV's":




    Which leads to Pillarboxing, Letterboxing or (still) Cropping to fit:



    This leads us to our creative product... playing on a larger variety of digital devices:

    This image is from this website: http://www.brinkbit.com/blog/starling-fullscreen-extension/

    I'm sure googling this subject will provide a wealth of information of the subject, and many solutions.

    These solutions, however, are not something that can be automated with a push button solution that acts as a magic silver bullet for you game or project.

    How do YOU want your game to look on these different devices?

    This image is from this website: http://www.brinkbit.com/blog/starling-fullscreen-extension/


    What do you want to do with this extra space outside of your minimally necessary game area?

    If you're making a pong clone:

    This image is from this website: http://noobtuts.com/unity/2d-pong-game


    Can you stretch it to fit the screen of your device? Do you crop it to fit? Do you letter- or pillar-box it? What about a ALL the devices you are deploying to?

    Now - What if it's multiplayer? If you have a strategy game and one player has a larger view to the sides because of a wide screen device, they'll get an advantage, as they'll see you before you see them!

    In some cases you don't need to worry about anything other than the built-in UI Anchors, as the screen resolution is set by the player and the UI fits as best as possible:

    2560x1440

    Image: Guild Wars 2 (https://www.guildwars2.com) Note: this game was not made in Unity (but you could!)

    1024x768

    Image: Guild Wars 2 (https://www.guildwars2.com) Note: this game was not made in Unity (but you could!)

    -

    In summation: There is no "best practice" for every game on every device.

    Multi-platform deployment has a number of inherent challenges.

    Unity reduces a whole ton of problems and issues for developers making projects and products to go cross platform.

    When developing our games, there are issues that must be considered from the very beginning and tracked throughout the development cycle. One is: "Will this be a cross platform game?" From that point, you can then approach what the key platforms we will need to consider and what user experience we want to support, and then start to look into solutions for these issues to when our game gets deployed to whatever target devices we choose.
     
unityunity