01overview C++ · EMBEDDED · DESKTOP

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.

lang
C++17
creatures
12
display
RGB565+
license
Apache 2.0
image · hero
560 × 380
drop hero creature screenshot
02gameplay api

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.

Tour the creatures →
image · gameplay
720 × 440
drop gameplay screenshot
creature.cpp // build a pet with the go hero api
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 });
03core engine

Everything your pet needs.
Nothing it doesn't.

F.01

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.

F.02

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.

F.03

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.

F.04

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.

F.05

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.

F.06

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.

F.07

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.

F.08

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.

F.09

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).

04platforms

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.

• shipping

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.

• shipping

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.

• open

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.

! NOTE On embedded targets, stat decay continues during deep sleep via the RTC module. When the device wakes, StatManager catches up using the elapsed wall-clock delta. No stat drift.
05starter creatures

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.

C.01
Dragon
Fire type · 48×48
High hunger rate, slow happiness decay. Evolves into FireDrake at 70 happiness or EmberWorm at 40.
C.02
Aquatic
Water type · 32×32
Low maintenance starter. Happiness decays slowly when near water items. Evolves into TideRider or DeepFin.
C.03
Electric
Thunder type · 48×48
Erratic energy stat. Charges up when fed and discharges during play. Evolves into VoltHawk or StormPup.
C.04
Plant
Grass type · 40×40
Happiness increases in daylight (uses RTC). Hunger regenerates slowly. Evolves into BloomGuard or ThornShield.
06next

Ready to build?

Browse the creature catalog, read the API docs, or jump into the source on GitHub. Open-source under Apache 2.0.