Search Unity

Porting 2D game to higher resolution

Discussion in '2D' started by kurismakku, Apr 20, 2016.

  1. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    66
    Hi!

    We are upscaling the game from 720x580 px to 4k resolution.
    For this, we will create new art assets in 4k resolution. Widths and heights of new assets around 3.721x bigger than originals.

    Does anyone have experience what is the best and fastest way to do this?

    One of the possible problems is that in original version of the game, we used specific numbers to set the distances between parent and child sprites. For example, turret.y = tank.y - 10.
    My guess is that for this higher resolution I will need to change this values ( in example above, from 10px to 37 px ).

    I am wondering, is there a technique to avoid this?

    Thanks !
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    You should be able to scale up any values by that multiplier that you scaled up your textures by.

    You can do the multiplication directly in the inspector fields like a calculator.

    Alternatively you can import your new art with a scaled-up Pixels Per Unit, to compensate for the difference. That will make your higher-res art proportionally use the same units as your smaller art.
     
  3. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    66
    Does Pixels Per Unit work with floats? I need to multiply with 3.725f. Right now my PPU is 1.

    Would changing PPU somehow mess up the game logic?
     
  4. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    Yes, I believe PPU is a float value.

    The only thing that it will affect is the size of your sprite relative to the rest of the game.

    If a lower resolution sprite had the dimensions 3x2 in unity units, and 300x200 in pixels, then the PPU would be 100. If you then increase that sprite's resolution to 3000x2000 (multiplier of 10), then without changing the PPU from 100 it would have the dimensions 30x20 in unity units. So you could then change the PPU to 1000 (multiplier of 10), and the dimensions would be 3x2 again in unity units.

    So try using a PPU of 3.725, which will make your larger resolution image appear the same size as your lower resolution image (when the PPU was 1), and see if it messes up any logic.

    You can always change it back to 1.
     
  5. kurismakku

    kurismakku

    Joined:
    Sep 18, 2013
    Posts:
    66
    I guess this will work only if I don't change the native resolution? So I should keep it set to 720x580, and than change only preview resolution? Otherwise changing PPU makes the sprites too small or too big since they look exactly as they should when I set camera resolution to 4k.
     
  6. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    You should be able to set your game view to the final resolution, and unity will downscale to fit it into your editor window.