I'm new to pixel art and game design. I'm confused about how pixel art "scales" in a game played at 1080p to the same game played at 4k (or vice versa). Since pixel art is not like a 3D game texture which may have various resolution settings, and pixel art itself is bound to its own resolution, how does this work? Is it set to one resolution and the total picture just gets bigger or smaller depending on the screen resolution?
Am I thinking about this completely in the wrong way?
Basically what will happen is the game will be scaled by x amount based on the original design resolution. The actual mechanic that accomplishes this task will vary based on the design platform. Achieving pixel perfect resolution while maintaining the EXACT same scene within the frame is impossible unless you are locked into a single resolution, and your design resolution is an exact integer of your target resolution (i.e. target of 1920 x 1080, therefore a design resolution of 320 x 180). There has to be some kind of buffer around the border of your scene to accommodate either the increase in width, height, or both depending on the factor on which you are limiting your game.
Example:
Original design resolution: 256 x 144
Playing resolution: 1920 x 1080
Pixel Scale Factor: 1080/144 = 7.5 >> Round to 7 or 8
(The numbers used in the factor equation will be based on whether or not you want the height or width to remain constant, just in case your game needs to cover multiple screen layouts i.e. 16:9, 16:10, 4:3 etc.)
Therefore, at 1920 x 1080, the pixels will be distorted UNLESS you adjust what shows up in the window in order to hit a perfect round number, which in this case will be 7 or 8. So if you round up to 8 the amount of space you will LOSE is going to be 144 - 1080/8 = 144 - 135 = 9. So 9 pixels worth of information from the original frame will be lost. 4.5 pixels from the top, and 4.5 pixels from the bottom. (half pixel losses are possible in this case because when upscaled the actual pixels lost is 9 x 8 = 72, so 36 from the top and 36 from the bottom)
Therefore, that buffer must be built into the game. 4.5 pixels of information both top and bottom need to be practically useless. Black bars are a cop out in my opinion though. Just don't put any vital information in those 4.5 pixels top and bottom.
Another Example:
Original Design Resolution: 256 x 144
Display Resolution: 1366 x 768
Pixel Scale Factor = 768/144 = 5.33 >> 5
Rounding up in this case would be 144 - 768/5 = 144 - 153.6 = - 9.6 pixels; 4.8 top and 4.8 bottom (upscaled 24 top and 24 bottom). So you need to add 4.6 pixels worth of information beyond the original design resolution.
The point is that if you want pixel perfect graphics in a pixelated game, and you aren't going to force a specific resolution, this scaling factor must be built in to adjust the actual pixel size based on the screens current displayed resolution. This is a major factor in the design of a mobile game using pixel art.
IMPORTANT NOTE: Going SMALLER than your original design resolution is impossible for pixel art. It can't be done without distortion or loss of detail. Someone please correct me if I am wrong.