A deterministic desktop virtual-pet game with care, genetics, breeding, turn-based combat, offline progression, and recoverable SQLite saves. Built in Rust with Bevy.
Status: playable desktop vertical slice. The deterministic game core includes care, breeding, genetics, combat, offline progression and recoverable SQLite saves. The first Bevy desktop slice now boots a new or existing world, applies offline and live progression, creates and feeds founder pets, displays care status and inventory, breeds and hatches eggs, uses explicit pet and pair selection for care, breeding, and battle, resolves deterministic battles with rewards, and saves through the application command boundary. Existing save slots can be inspected/switched, and critical offline or live pet events produce best-effort native notifications. The UI supports responsive layouts, accessible keyboard controls, global command feedback, event-driven visual/audio cues, mute, and reduced-motion controls. See docs/implementation-plan.md for what lands when.
The real presentation command path also has headless SQLite-backed smoke tests covering onboarding, care, breeding, incubation, hatching, battle, save/reload, catch-up, and the eight-pet headless CPU frame budget.
A deterministic native render verifier also opens the real 1100×720 desktop window, captures the eight-pet Home screen, validates all three species sprites, and saves a PNG artifact. CI runs it on Windows and Linux.
For a complete setup and gameplay walkthrough, see guide.md.
| Home | Pet Status |
|---|---|
![]() |
![]() |
Prerequisites:
- Git and rustup.
- Windows: Visual Studio Build Tools with the Desktop development with C++ workload.
- Linux: a C compiler plus the development libraries required by Bevy/winit.
- macOS: Xcode Command Line Tools.
Clone and enter the repository:
git clone https://github.com/rustagotchi/rustagotchi.git
cd rustagotchiInstall the pinned Rust 1.97.1 toolchain and optional project quality tools:
# Linux/macOS
./scripts/setup.sh
# Windows PowerShell
.\scripts\setup.ps1For playing only, the setup script is optional: cargo run automatically asks
rustup for the pinned compiler.
rust-toolchain.toml pins the exact compiler, so rustup installs it for you on
first build. SQLite and zstd are built from source via bundled features; a C
toolchain is required (MSVC Build Tools on Windows, cc elsewhere).
Run the deterministic headless driver:
cargo run -p simulation-cli -- --helpRun the Phase 6 desktop client from the repository root:
cargo run -p rustagotchi-desktopThe first optimized build takes longer but starts faster afterward:
cargo run --release -p rustagotchi-desktopKeep the repository root as the working directory so development builds find
assets/manifest.ron. Saves are stored in the operating system's application
data directory, not in the repository.
- Select Continue, enter a name, and adopt an Emberling, Stormling, or Aquafin.
- Use Status to inspect needs, feed a hungry pet, cycle pets, or safely release one.
- Adopt a second founder, then use Breed after both pets become healthy adults.
- Open Battle, select two fighters, and choose Power, Precision, or Efficiency. Victories award 50 coins and 100 XP; the result card shows wallet and level progress.
- Spend coins on the adoption screen to grow from 2 founder slots to a maximum of 8.
- Use Menu → Reset game for a confirmation-protected clean restart.
Mouse and keyboard are supported. Use Tab/Shift+Tab to move focus and
Enter or Space to activate a focused control.
Run the fast development gate:
# Linux/macOS
./scripts/check.sh --fast
# Windows PowerShell
.\scripts\check.ps1 -FastRun the complete production gate before publishing:
./scripts/check.sh
# or: .\scripts\check.ps1Run the self-closing rendered-window verifier locally with:
cargo run -p rustagotchi-desktop --bin render-verifySet RUSTAGOTCHI_RENDER_SCREEN to pet-status, pet-creation, battle,
battle-result, breeding, or breeding-egg to validate those layouts instead
of the Home gallery.
All menus support pointer input and keyboard navigation. Use Tab and
Shift+Tab to move focus, then Enter or Space to activate the focused
button. Focused controls have a visible gold outline and expose button labels
to platform accessibility services.
The main menu also exposes compact Sound: On/Off and Motion: Full/Reduced controls. Meaningful care, breeding, hatching, and battle events produce short feedback cues; routine simulation ticks deliberately remain quiet.
The Home screen renders a responsive named gallery of up to eight Emberling, Stormling, and Aquafin portraits. Pet names are validated and persisted in save schema 5. Each animation state is driven by that pet's activity exposed through the application DTO, with transient celebration, warning, and impact reactions layered on domain-event cues.
Adoption offers all three authored species and starts with two founder slots. Battle-earned coins permanently unlock six more slots at escalating prices, up to eight. The adoption screen shows the next price, current balance, and affordability. Pet Status displays battle level and XP progress and provides a confirmed release flow; active combatants and parents of unhatched eggs are protected.
Packaged builds can set RUSTAGOTCHI_ASSETS to the directory containing
manifest.ron; development builds discover ./assets automatically.
Dependencies point inward. domain depends on nothing that touches the outside
world — no Bevy, no SQLite, no filesystem, no OS APIs, no UI.
presentation ───────┐
▼
desktop ─────► application ─────► domain
│ ▲
├──► simulation ┘
├──► content
└──► persistence
persistence ─────► application ports
platform ────────► application ports
minigames ───────► domain
That rule is enforced in CI, not by convention: scripts/check-deps.sh diffs the
dependency closure of the core crates against committed snapshots, and
crates/domain/clippy.toml bans the types that would let I/O or nondeterminism
in. See ADR 0002.
| Crate | Responsibility |
|---|---|
| crates/domain | Pure rules: pets, genetics, breeding, combat, inventory, events |
| crates/application | Use cases: commands, handlers, queries, DTOs, ports |
| crates/simulation | Fixed-step time: decay, health, aging, AI, combat, breeding |
| crates/content | Loading and validating data-driven content packs |
| crates/persistence | SQLite saves: snapshots, migrations, checksums, backups |
| crates/platform | OS capabilities: paths, clock, locking, notifications |
| crates/presentation | Bevy scenes, UI, animation, audio |
| crates/minigames | Headless minigame rules |
| crates/telemetry | Logging, metrics, crash reports |
| crates/test-support | Builders, fixtures, fakes, assertions |
- Integer math in the core.
f32/f64are banned indomainandsimulation; simulated values areMilliandFixed. This is what makes save/load and offline/live equivalence testable as exact equality. (ADR 0006) - No ambient randomness. RNG is derived as a pure function of
(seed, stream, tick, entity). Nothing holds a generator; nothing saves one. (ADR 0007) - Events are the only way out. Operations return
Vec<DomainEvent>. UI, audio, quests, achievements and telemetry are all consumers. (ADR 0009)
- docs/init-plan.md — target structure and responsibilities
- docs/implementation-plan.md — phases, decisions, exit criteria, risks
- docs/adr/ — architecture decision records
- CONTRIBUTING.md — workflow and the checks that gate a PR
MIT. See LICENSE.



