GameMaker Make camera area bigger without pixelization

D

DerfMilar

Guest
Hello!

I currently have a room set up where I've enabled viewports, set the viewport to visible, and set the camera/viewport size to the default 1024x768.

Sprites in the game are all 64x64.

My question is this: I'd like to make the camera area larger, so that more of the room shows around the player, but any time I increase the camera beyond 1024x768, things look horribly pixelated. How can I increase the viewable area without losing quality? Is this possible?

Thank you for any help!

(Attached is a screenshot of my camera/viewport settings)
 

Attachments

RangerX

Member
You seem to have a pure mathematical issue here. Let me help.
If you scale your cam area (resolution of your game) with anything else than an integer, you will logically get graphical deformation because fractions of pixels don't exist. A screen cannot light up a fraction of pixel, it lights up or it doesn't.
This means your 1024x768 will be "perfect" only if scaled up by a factor of 2,3,4 and so on.

2048x1536 (x2)
3072x2304 (x3)
4096x3072 (x4)

ANYTIME you scale up by a fraction you will get graphical deformation. Anytime you would downscale you would also lose detail.
 
D

DerfMilar

Guest
You seem to have a pure mathematical issue here. Let me help.
If you scale your cam area (resolution of your game) with anything else than an integer, you will logically get graphical deformation because fractions of pixels don't exist. A screen cannot light up a fraction of pixel, it lights up or it doesn't.
This means your 1024x768 will be "perfect" only if scaled up by a factor of 2,3,4 and so on.

2048x1536 (x2)
3072x2304 (x3)
4096x3072 (x4)

ANYTIME you scale up by a fraction you will get graphical deformation. Anytime you would downscale you would also lose detail.
Hey, I appreciate the reply! What you're saying makes perfect sense. I still seem to be missing something. If you could help clear up where I'm going wrong, that would be amazing.

I did as you suggested. I multiplied my camera and viewport by a factor of 2, from 1024x768 (where the sprites look how I want them to) to 2048x1536. And that size, I'm getting major deformation. Any thoughts?

Thank you again for your help.

(I've attached one image at 1024x768 and another at 2048x1536)
 

Attachments

RangerX

Member
Because this depends also how you display your game on screen. Is it windowed? (therefore probably being the same size as what you set in the room tab) or is it fullscreen? (therefore being displayed at your monitor's resolution) ?
Because picture this. Let's say your game is 1024x768 but you fullscreen it on a 1600x900 monitor with "keep aspect ratio" checked in your global settings (so the game doesn't get stretched), this means the engine grows your game 1.173 times ending up as: 1201x900 (and obviously the graphics are all messed up)
 
D

DerfMilar

Guest
Because this depends also how you display your game on screen. Is it windowed? (therefore probably being the same size as what you set in the room tab) or is it fullscreen? (therefore being displayed at your monitor's resolution) ?
Because picture this. Let's say your game is 1024x768 but you fullscreen it on a 1600x900 monitor with "keep aspect ratio" checked in your global settings (so the game doesn't get stretched), this means the engine grows your game 1.173 times ending up as: 1201x900 (and obviously the graphics are all messed up)
Those are great points to consider, thank you.

Based on your suggestion, I've disabled "start fullscreen" and changed scaling to "full scale" instead of "keep aspect ratio". So my project is currently windowed and it no longer is keeping the aspect ratio. But, unfortunately, I still seem to be having the same graphical issues.

Frustrating that I can't seem to get my brain around this.

Thanks!
 

RangerX

Member
What's your monitor's resolution?
And your game is 1024x768 right?

Don't put "full scale". This option is a bit useless as this will just stretch your game to whatever a screen size is. Almost no game will ever need that ever. I even wonder why its in the options.
You either want "keep aspect ratio" so your game never ever gets stretched or you scale it entirely manually -- a bit more complex but perfectly doable thing.
 
Top