Raise a
digital hero.
A lightweight modular C++ framework for building virtual pets. Breed creatures with unique DNA, manage hunger and happiness stats, animate pixel-art sprites, and deploy to tiny MCU boards or desktop. Every mechanic is an optional module.
A creature engine
for pixel pet devs.
Build pets with a component-driven architecture. Attach
HungerComponent, HappinessComponent,
EvolutionComponent, and SpriteComponent
to any creature. Behaviours drive animations, stats tick in real
time, and the evolution tree branches on stat thresholds.
auto* pet = new GoHeroCreature("Blaze"); pet->SetSpecies(Species::Dragon); auto* hunger = pet->AddComponent<HungerComponent>(); hunger->decay_rate = 1.0f; // 1 point per second hunger->max_value = 100; auto* evo = pet->AddComponent<EvolutionComponent>(); evo->AddBranch("FireDrake", { 70, 50 }); // 70+ happiness, 50+ hunger evo->AddBranch("EmberWorm", { 40, 20 });
Everything your pet needs.
Nothing it doesn't.
Creature DNA & breeding
Each creature carries a DNA struct that governs base stats, colour palette, and evolution eligibility. Breed two creatures to produce offspring with blended traits and a chance of mutations.
Stat-driven behaviours
HungerComponent, HappinessComponent, EnergyComponent, and HealthComponent tick independently. Behaviours react to stat thresholds: low hunger triggers HungryBehaviour which plays a different animation and sound.
Branching evolution trees
Define evolution branches keyed on stat thresholds and held items. A creature can evolve into 3–5 forms depending on how it is raised. Each form has its own sprite sheet and stat caps.
Pixel-art sprite system
Built-in SpriteComponent handles frame-based animation with configurable frame rate, looping, and directional sheets. Sprites are authored as indexed PNGs and packed into .dtex for fast blit on MCUs.
Software renderer
A single QuadBlit pipeline outputs RGB565, RGB565A8, RGB888, and ARGB8888. Dirty rectangle tracking keeps partial display updates cheap on battery-powered pet devices.
Real-time stat decay
Stats decay on a configurable curve, not a fixed tick. Leave your pet alone and hunger drops faster over time. The StatManager emits events on threshold crossings so UIs and behaviours stay reactive.
Egg hatching & rearing
Start from an egg: incubate it for a configurable real-time period, then hatch into a baby form. Rearing stats during the baby phase determine the first evolution branch, rewarding early care.
Item & inventory system
Feed, heal, and entertain your pet with items. ItemComponent applies stat modifiers, evolution triggers, and temporary buffs. Inventory is serialized to MessagePack alongside creature state.
Animation blending
Smoothly crossfade between animation states (idle, walk, eat, sleep, evolve) with configurable blend duration. Interruptible animations let high-priority states (hurt, evolve) cut through low-priority ones (idle).
One codebase.
Tiny boards to big screens.
Platform setup lives in dedicated integration modules. Swap the integration module to retarget; your creature logic does not change. Build a Tamagotchi-style keychain or a full desktop pet simulator from the same source.
ESP32
Primary embedded target. TFT LCD + touch via LovyanGFX, battery-backed RTC for real-time stat decay, and deep sleep for low-power idle. The full pet runs on a single AA for days.
Windows desktop
SDL3-based window with a pixel-perfect software renderer. Use the desktop build for development, debugging, and as a standalone desktop pet that lives in your system tray.
Web (Emscripten)
Compile to WebAssembly via Emscripten. Runs the same creature simulation in a browser tab. Touch and keyboard input work out of the box. Ideal for sharing pets as playable demos.
StatManager
catches up using the elapsed wall-clock delta. No stat drift.
Meet the first generation.
Every creature is a prefab: a set of components with tuned starting stats. Use them as-is or clone and tweak them into your own creations.
Ready to build?
Browse the creature catalog, read the API docs, or jump into the source on GitHub. Open-source under Apache 2.0.