Search Unity

Resolved "Faux Pixelart" grid/resolution problems

Discussion in '2D' started by CBuckington, Sep 25, 2021.

  1. CBuckington

    CBuckington

    Joined:
    Sep 28, 2020
    Posts:
    20
    Hey guys,

    first of all I am really sorry if I make any mistakes while posting to the forums as I have never done that before.

    I am working on a little 2D Platformer game where all the objects will need to be pushed around and will have constant forces applied to them. Therefore they are suppossed to bounce around and rotate alot. To achieve this effect I wanted to simulate the pixel artsytyle and screen size of something like Celeste but with a much higher resolution to effectively rotate my sprites without them looking off or having a typical pixelart sprite rotation. After about 10 hours of trial and error I finally gave up and am asking this question here on the forum:

    How do you properly set up a Grid that matches the screensize perfectly? My tiles are all 8x8 Pixels, so naturally I thought that all resolution divideable by 8 should do, but every time the Grid ends up being like 2/3 off for one row. I tried so many resolutions and none of the larger ones worked.
     
  2. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    so you want the game to look like pixel art or not? Some contradictions in your post, its hard to understand what you are trying to achieve.

    If you use normal art and rotate it in unity without using pixel perfect packages it will rotate without looking like pixel art
     
  3. CBuckington

    CBuckington

    Joined:
    Sep 28, 2020
    Posts:
    20
    Sorry if I was a little unclear :) I want to use a pixel look but basically scaled up, so that for example every pixel in my sprites will be displayed by 2x2 or 4x4 pixels onscreen. My main problem is that I just cant get the math to work out the way I think it should with the Grid. If my tiles are lets say 8x8 pixels and I want to go for a resolution like 320 x 200 it would work, but just multiplying the numbers by 4 (1080x800) seems to set everything off grid and make it that the camera does not align with the grid anymore.
     
  4. rarac

    rarac

    Joined:
    Feb 14, 2021
    Posts:
    570
    so you have to coordinate this with your camera orthographic size, check this formula

    Code (CSharp):
    1. Orthographic size = ((Vert Resolution)/(PPUScale * PPU)) * 0.5
    ppu scale is how much you want to scale, use only int numbers 1, 2,3,4,5

    ppu is the ppu on your sprites
     
    CBuckington likes this.
  5. CBuckington

    CBuckington

    Joined:
    Sep 28, 2020
    Posts:
    20
    Sorry I totally forgot to answer back! The formula helped a ton and everything seems to go smoothly now :)
    thank you very much kind sir
     
    Last edited: Oct 2, 2021