Skip to content

Let cells where something moves take one-sub-pixel steps sooner - #16

Merged
vaprdev merged 6 commits into
mainfrom
motion-cells
Oct 10, 2026
Merged

vaprdev merged 6 commits into
mainfrom
motion-cells

Conversation

@vaprdev

@vaprdev vaprdev commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Summary

Slowly moving creatures jumped several sub-pixels at a time, because every cell held its old split until the new one fit clearly better. Cells under what moved this frame now take a one-sub-pixel step as soon as it fits a little better, so motion glides; bigger changes, steps back, and every still cell keep the full hysteresis.

 tolerance(best, previous, older, moving)
-  bestErr * 1.35 + margin
+  moving cell, one-sub-pixel step, not back to the split before → bestErr * 1.05 + margin * 0.3
+  otherwise                                                    → bestErr * 1.35 + margin

moving comes from dirty-cells' touched boxes (this branch's own copy of the interface is dropped), ignoring tiny boxes and boxes over 10% of the screen. A fit made while something moved is not reused next frame, so dirty refits still match a full refit. --verify-dirty now also fails on any pixel a scene draws outside its touched boxes.

Evidence

Glyph changes on a moving creature through the engine (60 s, octants), origin/main → this branch:

one-sub-pixel steps sub-pixels per change
tundra penguins 64% → 75% 1.55 → 1.39
farm cow 52% → 72% 1.66 → 1.41

Worst flicker in dev/check.ts 78 → 83 cells (ocean teeming night; limit 150).

motion cells

Verified: typecheck, build, dev/check.ts --max-ms=60 in octant and quadrant mode (0 failed), --verify-dirty 90/90 identical with no pixel outside the touched boxes, screenshots up to date.

Merge Danger

Door: two-way

Blast Radius: glyph choice in cells where something moves; slightly more glyph changes there.

# Conflicts:
#	CONTRIBUTING.md
#	src/canvas.ts
#	src/engine.tsx
#	src/sky.ts
#	src/wallpaper.ts
#	src/weather.ts
#	wallpapers/beach.ts
#	wallpapers/city.ts
#	wallpapers/desert.ts
#	wallpapers/farm.ts
#	wallpapers/jungle.ts
#	wallpapers/prehistoric.ts
#	wallpapers/space.ts
#	wallpapers/template.ts
#	wallpapers/tundra.ts
#	wallpapers/zen.ts
@vaprdev
vaprdev merged commit bce76a0 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant