2
How I fixed Pixel Snapping / Jitter in my game using a subpixel camera to achieve smooth pixel perfect movement.
Access my Subpixel Camera files by supporting me ❤️
https://www.patreon.com/c/barrysdevhell/posts
Join my Discord server!
https://discord.gg/NgRZBAYMBP
Buy me a coffee ☕
https://ko-fi.com/barrysdevhell
Business Email ✉
barry@devhellstudios.com
Aarthificial video – https://www.youtube.com/watch?v=jguyR4yJb1M&t=30s
Picster video – https://www.youtube.com/watch?v=zxVQsi9wnw8
00:00 The Problem
00:41 My Game
01:18 True Pixel Art
02:53 Imperfect Pixel Art
03:40 The Cause
05:36 The Struggle
07:33 The Fix
source
43 comments
Some people don't mind, or even like pixel snapping, but for people like me who don't, I hope you find this video helpful! You can access the project files now on my Patreon, and the tutorial should be next week! Thanks for the support ♥https://www.patreon.com/c/barrysdevhell
I think this is the first time ever i see a video about game dev in which I know all the games used as examples (glory to Inmost and Momodora)
What is the song that starts playing at 3:35? I know I've heard it in a game before but I can't remember.
Next video: How to crack Windows
Activate windows mate
Good video though, cool
I feel physically hurt by the people commenting 'actually I liked the not smooth lerp'. NO, this is amazing, problems like this drive me up a wall. Just like bad fps in minecraft, or texture popping in an unreal game, or shader compilation stutters or ugly post process effects / upscalers/ framegenration. Just give us a clean smooth image for gods sake. I see that stuff very clearly and it makes the game less enjoyable.
Thanks for sharing
This method is so easy, yet so good and cool!
I've got a problem which is comparable in a way… Sort of… I think you have the right mindset to think about this. I made a walking animation of 30fps. The feet stand exactly on the floor if I also move the character 2 pixels every second frame. If I move the character 1 pixel with 60fps everything goes wrong. You can see the foot going forward and backward by 1 pixel because I only go to the next image every 2 frames. I Hope you understand this. Do you have any advice on how to fix this or work around this? I could just move the character every second frame but I'm not sure if I like that…
This is why most indie devs never finish a game.
My issue is the posing and animations. The posing have weak movement and animation has weak impact. Example, some runs are too goofy for the genre while the ninjarun is good cause it looks like an arrow and displays good direction. It's mostly western devs and indie I see this issue with.
Is it really a problem? it looks stylish
Really helpful thanks for making this, keep up the good work!
This reminds me of a game: Core Keeper. Core Keeper is the perfect pixel game that satisfies your needs. The pixels of all scenes and elements are aligned with each other, even the ripples rendered by the water surface shader and the pixels of the shadows of objects are perfectly aligned with each other, only the camera is not aligned.😌
tbh i like pixel snapping, it fits with the style
You may want to dive into how elaborate "camera" systems worked for oldschool pixel games, because the smoothed camera really annoys me. Games like Super Mario World had a system where there would be a safe zone, and the camera would only move when the player character would move outside of the safe zone. The camera can also move forward to give the player more foresight. So I think a good camera system for a platformer is not just something that tries to keep the player in the center of the screen in a smoothed manner. Personally I don't even like the way it slowly smoothes. A faster stop would make it way less noticeable too.
dumb question, setting the position of the camera to the absolute of the lerp, won't it achieve the same result?
Pixel art attempts to emulate old consoles so it makes sense that scrolling will have those same limitations. Look at any 2D game from the snes, genesis, hell even saturn or playstation and you'll see this same pixel scrolling. This isn't a bad thing and not something that should be hated on. Frankly I can't stand imperfect pixel scrolling because it breaks the magic of it being a pixel art/retro game.
Aarthificial mentioned 🗣🔥
This is just off the top of my head, and is untested, but you can maybe use a similar shader approach like A Short Hike to get the pixel look, which uses a RenderTexture and a 3D Quad (plane) that draws this RenderTexture in a material and 2 cameras.
One camera has the render texture and is your main camera, follows the character, etc.
The other camera is looking at the quad, and is actually what the player sees.
Then you can use similar shader logic to the shader on the quad's material in the same way as the viewport shader in Godot.
I'm not familiar with Godot, I've never used it, but I kinda want to test this out now.
So basically just disconnect the camera from the pixels and connect it to the actual screen size. Sounds simple. And as a programmer myself, I know that if something sounds simple, it's also always simple to implement, so absolutely no problems there.
I also think it's a bit disingenuous to call it "imperfect" pixel art. I'd rather refer to the styles as true pixel art, and simulated pixel art.
after you show pixel snapping in detail, I can't unsee it and it's really ugly and annoying
activate windows
I prefer the snapping because it's more retro, but I don't prefer it enough to fight whatever default setup the engine has to care either way, because smooth movement is also nice.
As a little bug person, i dont often realise or notice the snapping xD
This is a feature to pixel art style. And it’s not the most games has this “problem” it’s a choice.
Same as I don’t like to much smooth gradients and lighting when then other objects has less shades. It’s for me resulting in a bad art style.
If pixel art games that runs higher res than their core art want to have it smoother they would have done it easily
That's cool. I personally didn't notice it before, but I fear I won't be able to unsee it after this video, lol
I was thinking on how Katana Zero deals with this. I was thinking that it usually looks smooth, but damn I noticed it after some random movements, even though you don't usually see complex backgrounds in that game.
but then it's not "perfect pixel art" anymore lol
6:28 I KNEW IT WOULD BE AARTHIFICIAL!
Will he ever activate Windows?
but pixel snapping is what happens when you dont want sub-pixels
its just a stylistic choice, nowhere near a "problem"
Okay, maybe i'm crazy. But what if you render the game in "imperfect pixelart" mode aka full display resolution (1080p), and then simply scale the entire rendered frame buffer down to the intended render resolution (270p) and then back up to the target resolution. And then you have a second camera that mimmicks the exact position of the first camera, but renders only the already scaled frame buffer?
Since the camera information is sub pixel this should work, no? The first cam renderes the scene and scales the image down, which causes all the assets to align to the pixel grid and unifies the pixel presentation. But after scaling it back up, which means we could "display" the image at a higher resolution. But instead of doing that we have a second camera that mimmicks the position of the first camera but is able to "pan and scan" across the now upscaled pixel art. And that image we use to display to the player. Sure, we now render twice, which could be seen as "expensive" but the second time it's literally just an offset of the frame buffer, which should be virtually free.
As an alternative solution, since this effect seems to be caused by interleaving 0px and 1px moves, which is an aliasing effect created by subpixel camera moves of distance <1.0px, I wonder if it would also work to require the camera to always move by at least 1.0px unless that would overshoot the target.
An interessing case of W godot
Buy Windows before you make another video.
Could have called integer and float pixel movement
Its definitely a camera issue. A perspective camera is causing the jittering, where as a orthographic camera would keep everything consistent with the art. Perspective camera naturally creates the parallax effect, but the caveat is the pixels moving around being technically in a 3D space. Orthographic camera snaps everything into place but you lose the natural parallax effect. So you would need to code the layers of the background to move based on the location of the character or something to that effect. You can achieve orthographic pixel art in unreal.
i only see the active windows line 🤣🤣
Its rare to find pixel games that are designed 1:1, but Holocure is. And yes there are way too many fonts based on the size needed. And the only zoom in that happens is 2x.
My man! This is exactly my pet pieve as well. THANKS YOU
man the hollow knight ost in background is a masterpiece of all time.
Activate Windows
Go to Settings to activate Windows.
Or just use Linux instead.
I don't even notice the thing you're describing.
Amazing tutorial that would’ve taken me hours of pulling hair to figure out. Let’s go Godot!
Comments are closed.