I’ve just published a devlog of my journey trying to achieve 2D pixel perfection in Godot:
Although hindsight is a wonderful thing, something I learned making my first game, Unicopia , is naivety also has benefits, namely the ability to make ill-informed decisions while remaining blithely o...
It’s warts and all, is much about my naivety as it is the real challenges of pixel perfection, but might be useful for those making their first 2D pixel art game.
2 Likes
Did you see the 4.3 improvement for pixel stability?
godotengine:master
← adamscott:2d-pixel-art-stability
opened 03:54PM - 17 Jan 24 UTC
# tl;dr
This PR simplifies greatly the snapping of 2D transforms to pixel. Inst… ead of relying on flooring sprites, CanvasItems (so twice flooring for sprites) and the camera transform, this PR only rounds each CanvasItem position.
# Co-authorship
This PR is heavily inspired by #84380 by @KeyboardDanni, so I added them to the commit as co-author.
# Why?
There's some issues with pixel perfect both due to:
- the numerous places where flooring occurs;
- the flooring itself;
# Superseding
- Supersedes #84380
- Supersedes #87058
# Tests
- Passes #84380 [PixelPerfectTest.zip](https://github.com/godotengine/godot/files/13244300/PixelPerfectTest.zip)
## #84380 test
### master
[master.webm](https://github.com/godotengine/godot/assets/270928/d95512f2-af68-4cb8-8737-82bb01147f6b)
### This PR
[87297.webm](https://github.com/godotengine/godot/assets/270928/f626b3d2-2a7f-4388-9b84-4a918f40b40f)
## [Merlin: Scale of the Magic](https://github.com/nicolasbize/Scalazard)
(author note: the project was edited to add debug info)
### master
[master.webm](https://github.com/godotengine/godot/assets/270928/9d970751-83e9-458c-9639-b7e9a8586aca)
### This PR
[87297.webm](https://github.com/godotengine/godot/assets/270928/0d8b030c-e266-4258-9b7a-4ae61c20641f)
_Production edit: closes godotengine/godot-roadmap#79_
*Bugsquad edit:*
- Fixes https://github.com/godotengine/godot/issues/56793
- Fixes https://github.com/godotengine/godot/issues/84632
1 Like
TBH I honestly can’t remember if I clocked that or not, but thanks for the link.
I remember hoping the 2D transform snapping would fix all my jitter issues, but if I understand it correctly, I’d still have suffered from moving platform jitter due to the rounding differential between platorm and player.