~ ~ whoami whoami projects projects blog blog

Rust Pokédex: when your kid asks for a Pokédex, and you hear 'Project Scope Creep'

Three years ago, my 5-year-old made what seemed like a simple request: "Dad, can you make me a real Pokédex?" What he heard was "Can you build me a cool gadget?" What I heard was "Welcome to the most beautifully scoped-creeped project of your life."

But it wasn't just his innocent request that sent me down this rabbit hole. It was the intoxicating combination of tight hardware constraints and infinite possibilities. Sure, I could build a simple Pokemon database browser. Or... I could add a camera dongle for real-time Pokemon recognition. Offload the image processing to a server via WiFi. Maybe add augmented reality overlays. GPS integration for location-based encounters? The excitement of pushing 512MB of RAM to its absolute limits while dreaming up features that would make the anime Pokédex jealous—that's what really hooked me.

Fast-forward to today: he's 8 years old, still waiting, and I'm knee-deep in GTK4 components, memory optimisation strategies, and 3D printer calibration while sketching out server architectures for Pokemon image recognition. By the time I finish this thing, my grandkids might be the target audience. But that's the beauty of passion projects—they evolve from simple goals into technical rabbit holes that teach you more than you bargained for.

Why 5th Generation Won the Hardware Battle

When designing a physical Pokedex, you're not just building software—you're constrained by real-world physics. After examining every generation's design, the 5th gen Black/White Pokedex emerged as the clear winner for several practical reasons:

Form Factor Optimisation: The vertical orientation and compact design translate perfectly to modern touchscreen dimensions while maintaining that iconic Pokedex feel. Port Placement: The design naturally accommodates necessary ports (power, potentially USB) without breaking the aesthetic. Screen Real Estate: The layout maximises usable screen space while leaving room for the distinctive styling elements that make it recognizably "Pokedex." 3D Printing Friendly: Clean lines and geometric shapes that won't torture your printer or your patience.

Oh, and Gen 5 is objectively the best generation The Pokemon Company ever made. Fight me.

The Technical Stack: GTK4 + Rust on Pi Zero

Memory efficiency drove this decision. When you're working with 512MB of RAM, every byte matters. GTK4 provides minimal memory footprint compared to web-based alternatives, native Linux integration perfect for embedded applications, mature ecosystem with proven stability on ARM hardware, and hardware acceleration support for smooth animations.

Starting this project was my excuse to dive into Rust properly. The language's memory safety guarantees and zero-cost abstractions make it ideal for resource-constrained environments where you can't afford memory leaks or unnecessary overhead.

When I started this project, pulling GTK4 from git was the only viable option for proper ARM compatibility. These days there's a standard crate available, but if it ain't broke...

Hardware Constraints: The Pi Zero Reality Check

The Raspberry Pi Zero isn't exactly a powerhouse: 512MB RAM means every data structure matters, single-core ARM CPU means no brute-forcing performance issues, limited GPU requires careful optimisation for smooth animations, and power consumption matters since battery life is precious in a handheld device. These constraints shaped every technical decision, from data loading strategies to UI component choices.

Technical Challenges Ahead

This project breaks down into several interconnected problems: Memory Management (how do you store 800+ Pokemon worth of data without exhausting available RAM? Lazy loading becomes critical), UI Performance (smooth scrolling and transitions on limited hardware require careful widget selection and custom component optimisation), Data Architecture (efficient data structures that balance access speed with memory footprint), and Physical Integration (touchscreen interface design, power management, and 3D printed case considerations).

What's Coming

This series will walk through the technical journey of building a constrained-resource GUI application in Rust. We'll cover design to implementation (translating Figma mockups into GTK4 components), data efficiency (memory-conscious Pokemon data structures and lazy loading patterns), performance optimisation (making GTK4 sing on embedded hardware), and hardware integration (touchscreen interfaces and power management).

Success Metrics

The requirements are refreshingly simple: It runs. It functions. My son (or grandkids) are happy. Sometimes the best projects have the simplest success criteria.