Pixel perfect for a 2d tile based game

Hello!,

We are trying to make our game pixel perfect with tiles of size 64x32, we are a using an orthographic camera.

The thing is we want to maintain the same orthographic camera size independent of the resolution of the game, because we don’t want to see more or less of the game, how can we achieve the pixel perfect ratio with a configuration like this?¿,

Thanks for your help!,

You’ve chosen wrong tool for the job then. Unity (at least until 4.3) sucks at 2D, so you’d be better off with GameMaker or similar tool.

Pretty funny joke…

You have to add e.g. black bars to sides and/or top+bottom of the screen if you want maintain the same aspect ratio on all devices.

Thats a really bad reply Did you only see keyword 2d and automatically replied with no experience about the issue or even 2d? 4.3 changes have nothing to do with the question he is asking.

To the question, like its been said use black bars or some tiled texture and decoration art that fits the game theme.

Hello to all, thanks for the responses!,

We thought of adding black bars or something like that but we don’t want that solution, we are trying to find something different…, like changing the size of the tiles depending of the resolution, changing the size of the textures…

you can always scale the game area in either axis but in the end one of the sides must have black bars or filler gfx to maintain aspect ration of the game area/board

find games similar to yours and see how they have done it from youtube or demo version

sueythelaw, I asked myself the same question for the game I am doing. It is not a commercial project but I had to make the same decisions. At the end I kept the camera size fixed and targeted my art to highest resolution. Currently I am testing my game in 3 devices, Galaxy S2,S3 y S4 and so far no problems. All my sprites are together in an atlas 2048x2048. My texture size base is 64 and my display target is 1920x1080, so my camera size is (1920/64)/2 = 15. I added an extra tile in right and left sides.

My considerations at the beginning were if I wanted to use different camera sizes I had to detect devices screen resolution and use different tiles sizes according to it. So if I had a 1920x1080 resolution I was going to use one atlas and for 800x480 another. If you keep the same art you will lose objects if the resolution decrease.

Please consider I am not an Unity expert. This is my first time with Unity and my first time programming. There are many Unity 2D games out there and I am sure this is something already solved. Good luck.
Learner//

Ostwind is correct. In order to maintain an aspect ratio, you have to perform some form of letterboxing. There are simply too many options as far as screen resolution is concerned. Sooner or later you are going to run into a situation where the aspect ratio of the screen doesn’t match your chosen aspect ratio.

I would personally recommend the overlay approach. It is decently scale-able, and more visually engaging than just straight black bars. You can use Unity’s OnGUI method to render the overlay in proper 2D.

I actually cooked up a decent letterboxing component a month or so back, but have been too busy recently to post it on the Asset Store. I’ll try to get around to it in the next few weeks.