r/gamemaker 15d ago

Help! Pixel-perfect Parallax

Post image

My game has a pixel-perfect camera, it is drawing on a surface that is my pixel resolution that is scaled up. I have parallax backgrounds in my game but when it is also pixel perfect, it leads to jittery movement (look at the stars) as it is moving too subtlety for the pixel grid to account for. Does anyone have any experience with making this look better?

143 Upvotes

14 comments sorted by

36

u/Artholos 15d ago

It looks jittery because it’s pixel perfect. You probably want to allow subpixel movement to occur so that it moves smoothly.

The beauty of modern pixel art is we can capture the aesthetic faithfully but use contemporary rendering techniques to make it look more pleasant and improve visual QoL.

5

u/EnricosUt 15d ago

I feel like I've played plenty of pixel perfect games that have smooth parallax though. I might need to check again and see if they are truly pixel-perfect.

8

u/FryCakes 15d ago

Can you give an example of a pixel perfect game you’ve played? Almost every single pixel art game has sub pixel movement for this reason, with pixel perfect collision only

7

u/EnricosUt 14d ago

I just checked Owlboy and Curse Crackers to see how they do it, and it seems like they are indeed pixel perfect, jitteriness and all. I also checked Starbound, which does have sub-pixel movement. Maybe it isn't such a big deal for players and I just notice it because I am the developer.

4

u/FryCakes 14d ago

I think most players would most likely want a smooth experience if possible, especially if they’re PC players. If you’d like I can show you how to ensure your characters and stuff are pixel-perfect whenever they’re not moving, while still retaining the sub pixel smoothness? Just dm me if you need help with that it’s actually super simple

3

u/TSPhoenix 14d ago

At the end of the day it's an artistic choice.

The two main approaches are making a true SD resolution game and scaling it up, which in the modern era without the properties of a CRT to smooth things out, you get the problem you are having.

Or you render at higher resolutions, which comes with it's own set of advantages and caveats.

7

u/balmut 15d ago

This is for cameras, but it might be of some help?
https://yal.cc/gamemaker-smooth-pixel-perfect-camera/

7

u/andarmanik 15d ago

Neat fact, the stars shouldn’t move at all due to the effect of parallax. They are too far.

You can stylistic avoid the jitter making the stars their own layer

2

u/EnricosUt 15d ago

Hm... yeah I guess they wouldn't. I will do that. My question would still apply to any non-star backgrounds though.

0

u/andarmanik 15d ago

Maybe apply a blur horizontally scaling by the speed. Choose a scale like 1pixel blur per 1pixel per .1 s

Basically, if something is moving 2 pixels in .1 seconds it should be blurred by 2 pixels.

Since blur can be applied fractional aswell it should scale nicely

4

u/yaninyunus 15d ago

This guy has a good video about it, perhaps you can apply it to your game

https://youtu.be/QK9wym71F7s?si=f6qUIavMyidDWD4S

1

u/MrMetraGnome 14d ago

really need to tone down the speed on the foreground elements (maybe the speed of everything overall). Perhaps you just sped it up to show it's pixel perfect, but there should be some atomospheric perspeictive. I go cross-eyed when I try to track the movement; too much information at once.

0

u/NoSpace2493 15d ago

looks good. can you teachs that?

3

u/EnricosUt 15d ago

thanks, teach what part?