[SOLVED] Pixelated graphics on tiled sprites with parallax behaviour sometimes glitches in some screens

Hi! I’m making a pixelated platform game with graphics that resamble the NES. The first stage has a parallax background. In the early versions of the game I used a very simple image as a placeholder and it used to work well in all the screens I tested including my cellphone’s. But now that I changed to a more elaborate image it gets distorted when the character walks. Some pixel columns disappear, others get duplicated. I wonder why it didnt happe before but is happening now. I tried checking and unchecking the round pixels box in the properties but it didnt work. I’d be grateful if someone could help me to fix this problem, making my game look decent in different screens. Im gonna attach some images. The problem is in a building in the background.



This happened to me too, I think it may be a problem related to rendering especially for pixel games when game window size is not set at specific resolutions it tends to render weird pixel sometimes wilder and larger pixel but when I press full screen everything is fine but when I back to the window not full screen it happens, for me I fixed my pixel moving and rendering weirdly by this properties


I’m not sure about mobile maybe change this to other options or maybe it’s not related at all idk

1 Like

Thanks for your answer. I’ve tried changing many of those configurations but never tried letting the anti alias on. Because I dont want my pixels to get blurry. But I’ll see what happens if I turn it on. Never tried before.
This problem only happens in cellphones and in an old laptop with Windows 7 that I have. In the other PC screens I’ve tried, it’s fine. Ironically, I’ve just found out that this old laptop has the same screen resolution of my new one, which is 1366×768. It possibly takes down the hypothesis that the screen resolution could be the only problem. There must be something else.
I dont know… the game looks fine in most screens I’ve tested, so maybe I should try to move on with that problem unsolved. :disappointed: But I’d still be very happy if someone came up with any ideas that solve this problem.

I say sorry if I’m OT and it maybe isn’t related with this problem.

My games had a minimum of 20 FPS and a maximum of 60 FPS.

My character had an object stuck with the Sticker behaviour. The object was stuck an was following my char but with a distance of one pixel although I’ve attached it in the right point of my char. During the movements, my char was flickering, changing size and shape of about one pixel, and coming back to normal, while the attached object was flickering as well and moving of about one pixel far and close my char.

When I’ve changed to a minimum of 60 FPS and a maximum of 0 FPS, the stuck object didn’t flicker or wasn’t pixel untouched from my char anymore, and my char stopped to flickering as well.

Hope this can be helpful, let me know if it was.

2 Likes

Thanks! I think I’m gonna give it a try. Increasing the FPS. Hope it works.

1 Like

Have you tried going to landscape mode? I don’t think its supposed to be played in portrait.

1 Like

Yes, I have. The same thing happens, no matter if it’s in landscape or portrait. I should have made the print in landscape. But I’ve tried both rotations and it’s the same.

I’m afraid that you will have to keep your game assets scaled 2x or 4x (it wont distort your assets), because I think since the camera is going to floating numbers because of the zoom, maybe that would cause pixel distortion.

1 Like

That’s right. Maybe the pixel distortion is because of camera going to floating numbers. I’ve read in other topics that scaling up the assets and changing the zoom could fix problems like this. But my game is almost half done, with lots of assets, so I dont think there is an easy way to do that. Or is there?

I don’t think there is an easy way, that will be a hard task…

Because not only you have to multiply the asset scale, if you are using conditions like “object distance is 10 pixels”, you will have to make it to “object distance is 40 pixels” and so on

1 Like

I’ll try it for my next project. If I scale the assets 2x, for example, each pixel we see will actually be 4 pixels grouped to form a little square. To make this square work as a real pixel, maybe I’ll have to use the pixel perfect behaviour to make the game treat these groups of four pixels as being one and never place the sprite in a position where these “fake pixels” would look like they could be split in half. Complicated. :sweat_smile:

PROBLEM SOLVED!
Apparently the image with the parallax effect is “moved” based on a value that is not always an integer number.
That’s why only the parallax background glitches, while the other elements on the screen are fine.
What I had to do was:

  • Go to the extensions list

parallax1

  • Click on the parallax extention and open it in the editor

parallax2

parallax3

parallax4

  • Use the round(number) expression to round the value in the “Change the X Offset of Object” action, making it always an integer number.

parallax5

And voilà, the parallax effect works perfectly fine, with no more distortion!

I’ve tested it on my PC and my cellphone and it’s running well on both devices. So I’m gonna mark it as solved for now. But let me know if you think my solution might cause performance issues or something like that.
Thank you guys for all the comments. :slight_smile:

4 Likes