So I’ve been reading up about making a ‘pixel perfect’ style game and I have a few questions. Sorry if these are stupid questions but I’m fairly new to this.
So I am seeing alot of people say that 1 pixel per unit is how I should have my sprites, but when I do this they appear huge. Is it ok to just change their scale so that they fit as I like in the camera view or does that stop them being pixel perfect?
Also does the resolution of my sprites matter? I have sprites that range from 8x8 to 64x64 and some different v/h such as 48x64. Does the resolution of these have an effect on whether or not they are able to be pixel perfect or not?
The ONLY way you will have pixel perfect is if you set things up to have exactly 1 pixel in the sprite appear as exactly 1 pixel on the screen. Usually that means one fixed screen resolution, plus a camera that’s set up to the exact right size, plus scaling on the sprite being correct, so that the ‘grid’ of the sprite exactly maps to the ‘grid’ of the screen pixels. And this will apply only to ONE resolution and ONE set of sprite data.
As soon as you want to support other resolutions it is literally impossible to have a 1:1 pixel mapping without forcing the sprites to become larger or smaller - you can still do pixel perfect if you don’t mind everything changing size depending on what screen res you use. Otherwise you need a whole separate set of source material ie sprite data designed specifically for each resolution you want to display on.
There are some ways to minimize or optimize the results you get when using one set of sprites for all resolutions but it will not ever reach ‘pixel perfect’ on all resolutions. It’s simply impossible. You can’t make a 10x10 pixel sprite fit into an 8x8 pixel area and call it pixel perfect, with no blurring or scaling or interpolating. It’s sort of up to you what kind of quality loss you are willing to live with. Bilinear filtering is not too bad for moving objects.
Fixing the resolution to only one (or ones that are multiples) to target specific devices is one option. e.g. iPad - 1024x768 or 2048x1536 (double) allows you to know exactly what the res will be, so if you make all your art render at 1024x768 and just let everything exactly ‘double’ in the retina display, then your sprites will always be pixel perfect with no size changes. But if you try to support phones… tons of resolutions… pc or mac… tons of resolutions… web… tons of resolutions… but something also like AppleTV for example you could just target ‘HD’ 1080p and forget the rest.
There really needs to be THOROUGH documentation about all this so that people can be pointed there because this has really been rehashed and discussed to the death already in so many threads.