Search Unity

[Question] Scaling 2D games for multiple resolutions.

Discussion in '2D' started by Christian-Tucker, Nov 21, 2018.

  1. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    I've been using Unity to create a few UI based games and scaling for mobile devices has never been easier by using the built-in canvas scaling system, however in my next project I want to incorporate physics, which means using the UI is out of the question.

    I've been doing some research, but it seems there isn't a holy-grail for scaling 2D games, I was just wondering what some more modern solutions are as most of the posts on google are from 2014-2015.
     
  2. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Scaling for multiple screens, especially in this modern age of mobile development, is very difficult. The nice thing about Unity's UI system is that it allows for adaptive scaling, where you can design your UI to stretch and squish based on changes to resolution and aspect ratio. This is somewhat similar to modern web design, and provides multiple approaches to optimizing UI for different screens. It's great.

    With a physics approach, you would be working with a system that can't be scaled. Physics run behind the scenes, and shouldn't be based on resolution. For your game, any physics based on pixels or screen properties are a no-no. Your physics will have to run based on float values for a "virtual space" and be completely unrelated to the displayed screen. Thankfully, there are physics solutions like this, and they should be easy enough to incorporate into a 2D game. I'm fairly certain that Unity's own 2D physics already operate on such principles.

    The real challenge is going to be in your level design. How on earth do you design levels or playfields to operate properly at different resolutions, aspect ratios, or orientations?