Handling Resolution in 2D

I am making a classic arcade style game with classics like Pong, Brick Breaker, Break Out, etc. Just as a little personal test mostly while I am working on bringing my first game project to light. One thing I have never played with before is handling resolutions, and I have to admit I am struggling quite a bit with it. I have tried searching around and it seems like everybody has different methods, some which are even old and dated and don’t seem to work anymore. Question is which is correct, because some don’t work at all.

A perfect example is this here:

If I use the answer given there my brick which is 64 x 16 pixels is blown up and takes up almost the entire screen on 1920 x 1080 resolution. Yet the answer seems to claim pixel perfect results. I just want my games to look the same on every resolution, every aspect ratio. Is there a simple solution to this problem or?

I’ve been going through this recently. It’s my third time round with unity. These types of matters, that we out of my hand, usually take sometime for them to sink through but I feel it finally has with me.

Basically, one thing to keep in mind is that Unity’s camera and game scene, are more proportional in resolution than exact representation. Let me give you an example.

I am working for mobile development. When I set the game scene to be 1536x738 it is. However, I could zoom my main camera to a very wide, or tight range. In which case, it could be argued that 1536 pixels of Unity world space is no longer in perfect match with the screen. However, proportionality is.

So, when I build a scene, in regards to renderers. I build the textures I use to be ideal for the largest resolutions possible. In my case, 2048x1536, iPad 3.

I use EZGUI, it has a SimpleSprite component that sets a sprite to be pixel perfect relative to a camera, zoom (orthographic size).

Once I set a sprite, I remove the pixel perfect effect. With different resolutions, the item would be scaled differently and I don’t want that. Now, I have sprites that are proportionally perfect to the scene view. Now when I run the game on any decide the scene remains perfect in relative proportion.

Key things to remember are
1)even if you camera is zoomed into an extremely tight amount, if you scale your item down to match I proportionality, it makes no difference than if your camera was zoomed at the perfect level to match the sprite scaled to one.

  1. build you atlas’ to represent on the largest resoltuion formats.

  2. it’s all relative. Cam zoom to sprite size.

  3. device physical size. If I have a resolution of 3million x 2 million pixels, it makes no difference if my decide if 3 inches x 2 inches.

Hope that helps you sort out in your head how the basics work.