Glossary term
Subpixel
A fraction of a pixel that a game keeps in a position or speed but never draws.
A subpixel is the undrawn fraction of a pixel in a position or speed. It lets things move by less than a pixel per frame, as in a slow walk. The fraction sits beside the whole-pixel position and carries into it when it adds up to a pixel. Its storage and resolution decide which speeds a game can represent.
#In the games the atlas has read
- Super Mario Bros. stores vertical speed as a pixel byte and a fraction byte, in 1/256 px. Each frame, it adds the fraction into a subpixel byte of the position1. Horizontal speeds are coarser, in 1/16 px/frame2.
- Sonic the Hedgehog keeps 32-bit 16.16 positions and shifts 8.8 speeds into them, so its motion also resolves to 1/256 px3.
- Celeste keeps whole-pixel positions plus a float remainder per axis, and moves by the rounded remainder4.
All three draw only the whole-pixel part, so the atlas reports jump heights in whole drawn pixels.
References
- ^Vertical motion is 8.8 fixed point; each frame,
ImposeGravityadds speed to position, the fraction via theYMF_Dummysubpixel byte, then gravity to speed. T3Xkeeper0/smb1 · src/prg.asm L6666–6687 - ^Horizontal speeds are 4.4 fixed point, whole pixels and sixteenths per frame;
MoveObjectHorizontallyshifts the sixteenths into the subpixel byte. T3Xkeeper0/smb1 · src/prg.asm L6492–6503 - ^
ObjectFalladds the pre-gravity speed, shifted left 8 bits, to the 32-bit position, so positions are 16.16 and speeds 8.8 fixed point. T3sonicretro/s1disasm · _incObj/sub ObjectFall & SpeedToPos.asm L16–20Sonic Retro, “Sonic Physics Guide: Calculations (Pixel and Subpixel)” · Pixel and Subpixel - ^Celeste's actors sit on whole pixels;
MoveVadds the float distance to a remainder, moves by its rounded value, and keeps the fraction. T2Thorson 2020 · Actor BasicsNoelFB/Celeste · Source/Player/Player.cs L935
Sources
Code
- doppelganger and Xkeeper. 2022. “smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1).” Commit 1cc3c92. Xkeeper0/smb1 @ 1cc3c92 · licence, all uses
- Sonic Retro contributors. 2026. “s1disasm: Sonic the Hedgehog (16-bit) disassembly (sonicretro/s1disasm).” Commit 15dfa3a. sonicretro/s1disasm @ 15dfa3a · licence, all uses
- Thorson, Maddy and Noel Berry. 2021. “Celeste: released class files (NoelFB/Celeste).” Commit 1b0ce45. NoelFB/Celeste @ 1b0ce45 · licence, all uses
Primary
- Thorson, Maddy. 2020. “Celeste and TowerFall Physics.” Medium. original · archived · licence, all uses
Secondary
- Sonic Retro contributors. n.d. “Sonic Physics Guide: Calculations (Pixel and Subpixel).” Sonic Retro. original · archived · licence, all uses