packages/examples/elizagotchi/README.md
A Tamagotchi-style virtual pet game running on elizaOS with NO LLM required!
# From the monorepo root
cd examples/elizagotchi
# Install dependencies
bun install
# Start the dev server
bun run dev
Open http://localhost:5174 in your browser!
| Action | Description |
|---|---|
| ๐ Feed | Keep your pet fed. Don't overfeed! |
| ๐ฎ Play | Make your pet happy (uses energy) |
| ๐งน Clean | Clean up messes and bathe your pet |
| ๐ด Sleep | Rest when tired (turn off lights first) |
| ๐ Medicine | Cure sickness |
| ๐ก Light | Toggle lights on/off for bedtime |
This example demonstrates elizaOS's ability to run agents without an LLM:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ React UI โ
โ (Elizagotchi App) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Game Engine โ
โ โโโ State Management (PetState) โ
โ โโโ Stat Decay & Time-based Updates โ
โ โโโ Action Handling (feed, play, clean, etc.) โ
โ โโโ Evolution System โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ elizagotchiPlugin (Custom Model Handlers) โ
โ โโโ models[TEXT_LARGE] โ game logic โ
โ โโโ models[TEXT_SMALL] โ game logic โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ AgentRuntime (elizaOS Core) โ
โ โโโ useModel() โ routed to game engine, NOT an LLM! โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
elizagotchi/
โโโ src/
โ โโโ App.tsx # Main React component
โ โโโ App.css # Styling (kawaii aesthetic)
โ โโโ main.tsx # Entry point
โ โโโ components/
โ โ โโโ PetSprite.tsx # SVG pet graphics for all stages
โ โ โโโ GameElements.tsx # Poop, hearts, icons, backgrounds
โ โโโ game/
โ โโโ types.ts # TypeScript types
โ โโโ engine.ts # Core game logic
โ โโโ plugin.ts # elizaOS plugin with model handlers
โโโ index.html
โโโ package.json
โโโ vite.config.ts
โโโ README.md
| Stage | Description | Duration |
|---|---|---|
| ๐ฅ Egg | Your pet is incubating | 1 minute |
| ๐ถ Baby | Newly hatched, needs lots of care | 3 minutes |
| ๐ง Child | Growing up, developing personality | 5 minutes |
| ๐ง Teen | Rebellious phase, needs discipline | 10 minutes |
| ๐จ Adult | Fully grown, stable personality | 30 minutes |
| ๐ด Elder | Wise and experienced | Until natural end |
Your pet's mood is determined by their stats:
Like the tic-tac-toe example, Elizagotchi uses custom model handlers:
const elizagotchiPlugin: Plugin = {
name: "elizagotchi",
priority: 100,
models: {
[ModelType.TEXT_LARGE]: elizagotchiModelHandler,
[ModelType.TEXT_SMALL]: elizagotchiModelHandler,
},
};
When runtime.useModel() is called, instead of hitting an LLM API, our game engine processes the command and returns game state updates.
Uses in-memory state for the browser demo. Can be extended to use PGlite for persistence.
Contributions are welcome! Some ideas:
MIT License - Part of the elizaOS project.
Made with ๐ using elizaOS