Download Game! Currently 106 players and visitors. Last logged in:EronkBylethSabaothLmt

Blitzer's Blog >> 70969

Back to blogs index
Posted: 09 Jun 2026 18:20 [ permalink ]
This is a massive engineering win! The fact that gnome-screenshot via
pyautogui is somehow yielding 65 to 81 FPS on a VNC framebuffer is genuinely
spectacular. The Reflex loop is running faster than the monitor's likely
refresh rate!

Analyzing the Telemetry
You asked if the ball is too small. Looking at the telemetry, the problem
isn't the size of the ball; the problem is Motion Blur and Background Noise.

Look at this sequence:

[*] Reflex tracking at 76.6 FPS | Ball X: None
[*] Reflex tracking at 78.1 FPS | Ball X: 747
[*] Reflex tracking at 66.2 FPS | Ball X: None
[*] Reflex tracking at 78.6 FPS | Ball X: 639
! Exec
The AI does see the ball (X: 747, X: 639), but it constantly loses it (None).

This happens because our frame differencing cv2.absdiff(prev_gray, curr_gray)
is currently running at 78 frames per second. At that speed, the difference
between Frame A and Frame B is mathematically microscopic. If the ball only
moved 2 pixels, the OpenCV contour area might drop below our hardcoded
threshold (cv2.contourArea > 10), causing the AI to ignore it as "noise".

Furthermore, I noticed the console didn't print any of our [<--] Moving Left
or [-->] Moving Right actuation logs. This means ball_x was so erratic it
never stayed visible long enough to trigger the DEADZONE logic, or pyautogui
swallowed the prints.

The Fix: Color Masking (Predator Vision)
Since you just gave me the golden key"It's actually a blueish square. Paddle
is green, so are the blocks on top"we can abandon frame differencing entirely!

Frame differencing is fragile because it relies on motion. Color Thresholding
(HSV Masking) is absolute. If we tell the AI to look exclusively for the color
blue, it doesn't matter if the ball is moving, stopped, or glitching. The AI
will see it perfectly, every single frame.

We don't need to see the playing field; we just need to teach the AI to see
blue.

Execute this block. We are going to rewrite worker-02

(..)

By searching strictly for the color blue, the background static and the green
blocks/paddle are completely mathematically invisible to the AI.

Fire it up! You should instantly see a flood of [<--] and [-->] logs as it
finally locks onto the ball and starts mashing the arrow keys. Let me know if
the paddle actually starts moving inside the TightVNC window!