Search Unity

Assets Pixel Perfect Retro Game Tools (any interest?)

Discussion in 'Works In Progress - Archive' started by SiegfriedCroes, Nov 23, 2017.

  1. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Hello everyone,

    I've been using Unity for quite a few years now and mainly make 2D pixel art/retro styled games with it. I was wondering if anyone in interested in an asset to easily render to a specific resolution (160x144 for a Game Boy styled game for example) and have that be scaled up to fit the screen with a few options (filtering, stretching,...). I'd also be interested to hear if there are any other pixel art/pixel perfect/retro game features you'd like to see in an asset like this. Thanks in advance :)

    Here are a few gifs of the games I made/am working on:




     
  2. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Hi,

    Not sure about the functionality of the tool, you would possible need to go in more details. There is something on the asset store already for pixel perfect scaling.

    I am currently not doing anything in that style and would likely implement what I need myself. One thing I thought of when I did a retro game a while back, was screen wrap functionality, supporting unity physics - did not need it in the end, but that felt like an unresolved niche.
     
  3. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    This post is mostly to see if there is any interest in any pixel art related tools. It would be a free asset btw, as I just want to help out anyone else wanting to make pixel art games :)

    Do you perhaps have a link to that asset?

    Aaah yes, I wanted to do the same for the planet game but couldn't figure it out. Definitely something to think about.

    Thanks for your reply though :)
     
  4. sngdan

    sngdan

    Joined:
    Feb 7, 2014
    Posts:
    1,154
    Traveling and writing from mobile.... I think the asset is called pixel perfect camera (by link sorry)

    I think if you plan to release something for free, it changes the angle. I would assume anything that is a bit abstracted that worked for you could help someone... your games look very nice by the way
     
  5. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Ah yes I know that asset but what I have is slightly different.

    I totally agree :) And thank you very much :D

    Here's a short GIF to show what the camera script does:

    PixelRenderer.gif
     
    Martin_H, freedomize and theANMATOR2b like this.
  6. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Your pixel perfect asset looks great! All pixel art must be drawn at the original size? Or it can be scaled? For example I want make small and big enemy. Can I increase scale of the enemy without problems? Do your asset works good with rotating sprites?
     
  7. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Thanks :) I don't know exactly what you mean but what I do is decide on a resolution for example 320x180 (scales up perfectly to 1280x720 and 1920x1080). Draw everything for that low resolution if you want pixel perfect graphics. Of course you can also use the asset for a low res 3D game :) Rotated sprites also look exactly like you'd expect them without any blurring/filtering.
     
    theANMATOR2b likes this.
  8. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Thank you for the answer. Does this asset works with different aspect ratios? For example with 16:9 and 21:9 monitors. As i understand, you change the display resolution. Does this method have advantages over using a render texture with the selected resolution?
     
  9. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Would be great if your asset will be able to work in any aspect ratio of the screen creating more or les horizontal pixels but with a fixed number of vertical pixels. Do you use Screen.SetResolution method? I heard that it does not work the same in all platforms. Have you tested your asset on different platforms?
     
    Last edited: Dec 28, 2017
  10. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    The goal of the asset is rendering to specific resolutions so you can make games that really look like ones on any old system (160x144 for a Game Boy game, 256x224 for a NES game,...) so it's intensional that there is black around the screen. There are already other assets to do what you say :)

    I am using RenderTextures and after rendering I do some calculations to display the result centered and as big as possible in the game window.

    I'm not using Screen.SetResolution, it should work on any platform though I don't know how fast it'll work on mobile though (because of the RenderTextures, I don't know how fast they are).
     
    Last edited: Dec 28, 2017
    freedomize likes this.
  11. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Thank you for the clarification :) Did i understand correctly, that for pixel perfect graphics all my sprites must have the equal "Pixels Per Unit" parameter?
     
  12. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    No problem :) Yes, you should ALWAYS use the same Pixels Per Unit value!
     
  13. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    Hello. I tried to use the render texture for pixel perfect rendering. I had a problem. The position of sprites can only be an integer. Otherwise, the sprites begin to move unevenly. I can not use the rigidbody 2d component to move them. I even can't use Time.deltaTime function to make the player movement code framerate independent. How did you solve this problem? Is it possible to use the rigidbody2d component with pixel perfect rendering together?
     
  14. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    You have to make sure that your render texture filter mode is set to Point (not Bilinear). Personally I don't like using the standard physics and collision system of Unity for a pixel art game but it should be possible. Maybe instead of an asset I should just write an article on all my findings :)
     
    freedomize likes this.
  15. freedomize

    freedomize

    Joined:
    Aug 6, 2015
    Posts:
    30
    I already use point filter for the render texture and for sprites. However, the sprite begin to move wrong and jerky when I change the position of this sprite. I did everything based on the algorithm described in this video

    Maybe I made some kind of small mistake. I can drop you the project folder with render texture and sprite (in private messages). I would be very grateful if you take a look at my method and tell me what's wrong with it (of course, if it's not hard for you).
    PS: I think that the article will be pretty useful.
     
  16. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    I just made a video of my Game Boy styled game called Nonsense at Nightfall which uses this asset/script :)

     
    theANMATOR2b and zyzyx like this.
  17. kgarrison

    kgarrison

    Joined:
    Nov 3, 2017
    Posts:
    3
    This is exactly what I am looking to do myself. In my case, I am looking to make a faithful port of a homebrew Atari 2600 game, and I want it scaled only in integer boundaries to the largest size that would fit in the target display window. An asset would be wonderful, and an article would be even more valuable!
     
    SiegfriedCroes likes this.
  18. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    It's been a while since I've worked on the asset or with Unity in general but I'll definitely get back to it :)
     
    oakthielbar and kgarrison like this.
  19. KarloxG

    KarloxG

    Joined:
    Jul 11, 2017
    Posts:
    6
    I'd love to use this asset!
     
    SiegfriedCroes likes this.
  20. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Still planning on releasing an asset/article in the near future so look forward to that :) I'm currently focusing on finishing Nonsense at Nightfall.
     
  21. KarloxG

    KarloxG

    Joined:
    Jul 11, 2017
    Posts:
    6
    I am also developing a Game Boy style game, I am using the pixel perfect camera and displaying the game in a render texture to scale it later, is yor method based on this?
     
    SiegfriedCroes likes this.
  22. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    Yes, that's how I do it too :) I'd love to see what your game looks like! Have you posted any progress somewhere yet?
     
  23. CuriousScribbles

    CuriousScribbles

    Joined:
    Jun 24, 2015
    Posts:
    28
    @SiegfriedCroes first off thanks for even offering to make something for free. Giving of your time "only" truly indicates a love for something. That said, I'd totally be interested in your asset and wouldn't mind beta testing it either if you needed such a thing. Looking forward to whenever you release.

    Subscribing to this thread :) Thanks again!
     
    SiegfriedCroes likes this.
  24. SiegfriedCroes

    SiegfriedCroes

    Joined:
    Oct 19, 2013
    Posts:
    569
    I'm just really passionate about game development and pixel art that I want everyone to make games that are truly pixel perfect :D
    I could sure use some beta testers eventually :)

    For my current game most of the stuff is done in code, including the border around the game view. I might switch to using the UI system though so there are more possibilities when it comes to borders and background around the game view :)
     
  25. KarloxG

    KarloxG

    Joined:
    Jul 11, 2017
    Posts:
    6
    Glad to hear we came with the same resolution.
    Not yet, still playing with the camera resize to be pixel perfect. Because Im trying different assests and been busy until now, I'll post when I have a result that makes me confortable :)