Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Creating precise 1920x1080 non-scrolling 8-bit style game in Unity?

Discussion in 'General Discussion' started by eindoofus, Feb 22, 2015.

  1. eindoofus

    eindoofus

    Joined:
    Feb 22, 2015
    Posts:
    3
    I'd like to create an 2D 8-bit style non-scrolling game (like classic Donkey Kong) in Unity where each sprite's pixel is 1:1 with the pixels displayed on the screen.

    For example, a 30x30 sprite will be displayed as exactly 900 pixels even if there are sprites above or below it. I fear that Unity's 3-dimensional nature could cause this 1:1 pixel ration to get thrown off since the way sprites may be layered on an axis may cause them to be slightly closer or farther from the player, and thus loose their original sizing.

    Is this type of precision possible in Unity when working in 2D? And if so, is it natural to do this in Unity (as in user-friendly)? Are there any tools that you would recommend that would aid in creating such a game?
     
    Last edited: Feb 22, 2015
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,500
    What do you mean by this, and what practical effect do you want from it?
     
  3. eindoofus

    eindoofus

    Joined:
    Feb 22, 2015
    Posts:
    3
    Sorry, reworded my question to be more clear. I'm worried that in layering sprites it's necessary to use the dimensions depth, and if this is the case some sprites may not scale the way they were originally created since they're closer or farther from the player.

    Also, how difficult is it to work with pixels in Unity? The game demos I've seen so far probably aren't designed with pixel precision in mind. They are also all using a scrolling environment. In my case I'd like to create for a fixed 1920x1080 canvas similar to classic Donkey Kong.
     
    Last edited: Feb 22, 2015
  4. Limyc

    Limyc

    Joined:
    Jan 27, 2013
    Posts:
    29
    If you use an orthographic camera, things will look the same size no matter how far away from the camera they are. But really, you don't need to move sprites on the z-axis since you can setup sorting layers which will handle the draw order of sprites.
     
  5. eindoofus

    eindoofus

    Joined:
    Feb 22, 2015
    Posts:
    3
    Hate to beat a dead horse since you've mostly answered the question but I guess I'm also looking for a definitive yes or no since I'm a bit anxious about using Unity and not sure how natural sorting layers are in 2D.

    Is it possible to create a 1:1 pixel game specifically designed for 1920x1080 as long as I use sorting layers? And if so, are sorting layers typically used in 2D games or would this be somewhat of an unnatural hackish solution?
     
    Last edited: Feb 22, 2015
  6. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    There are a mountain of other things you need to worry about before you can babysit every individual pixel.

    Just try using Unity. Spend a couple weeks playing around with it and figure out either how to make what you want properly, or whether what you want is unrealistic.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's a definitive yes. Use one unit per pixel measurement or multiple thereof.
     
    Not_Sure likes this.
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Plenty of people seem to be building pixel perfect games fine in unity. There are some tricks to it, but a good search on the forums and answers will find them.
     
  9. Deon-Cadme

    Deon-Cadme

    Joined:
    Sep 10, 2013
    Posts:
    288
    1:1 pixel precision for 1920 x 1080 is definitely possible, the question is what you will do if a person got a monitor or device with greater or lower resolution?

    About scaling sprites based on distance, you should look closer at "orthographic" camera.

    You can use the existing layers, create your own or ignore features like this... but... it might be helpful to have layers like background, foreground, main gameplay area and so on to manage your content :)

    I would suggest though that you ignore the pixel perfection stuff for now and simply concentrate on learning Unity, programming and how to make good 2D games... and maybe read up a bit on how graphics work in general.