Open Cultivation Simulator is a local-first, open-source AI cultivation narrative game built with Next.js, SQLite, and configurable LLM providers.
This repository is the single-player open-source edition of MOB.AI. It keeps the original xianxia tone, card-based mobile UI, dice checks, and story loop, while replacing the old online service dependencies with a self-hosted local stack.
- Local-first runtime: SQLite, local assets, local prompt/model configuration, and a default local user flow
- AI-driven gameplay: character generation, branching story pushes, custom player actions, and structured story output
- Playable progression loop: create a character, enter story, roll checks, advance the plot, break through, die, revive, and continue
- Faction/world layer: world map nodes, faction relations, world-turn simulation, faction missions, and faction-aware story context
- Agent integration: built-in MCP endpoint and
skills/support for agent tooling
The project is actively being refactored into a cleaner open-source shape.
Current open-source scope:
- Single-machine, single-user play
- Local configuration from
data/local-config.json - SQLite persistence in
prisma/dev.db - Optional image generation and avatar generation
- Desktop shell that embeds the mobile story UI
Out of scope in this edition:
- Hosted backend services
- Redis / PostgreSQL dependencies
- Payment flow
- SMS login and other SaaS-only branches
- AI-generated character setup with xianxia-themed backgrounds, missions, and relationships
- Structured story loop with
2d6 + modifierschecks - Pre-rolled options plus custom free-form player actions
- Character archive, history review, breakthrough, death, and revive flow
- Faction agent planning with prompt fallback to the shared model configuration
- World simulation with alliances, expansion, resource conflicts, and faction rumors
- Dedicated world map page and faction brief UI inside the main character flow
- Local settings UI for model provider, base URL, API key, and prompt management
| Layer | Implementation |
|---|---|
| Web | Next.js 15 + App Router |
| UI | React 18 + Tailwind CSS v4 + Radix UI |
| State | Recoil |
| Database | Prisma + SQLite |
| AI | Vercel AI SDK + local prompt/model config |
| Assets | public/assets/ + public/generated/ |
| Tooling | pnpm + TypeScript + ESLint |
| Agent Integration | MCP (/mcp) + skills/ |
- Node.js 20+
- pnpm 9+
pnpm install
cp .env.example .env.local
pnpm bootstrap
pnpm devThen open http://localhost:3009.
- Open the in-app
设置page. - Fill in your model provider, model name, base URL, and API key.
- Test the connection.
- If needed, adjust prompts from the prompt settings page.
- Return to the home page and create a character.
The repository also includes local launch helpers:
run-local.commanddeploy-local.commandrun-local.batdeploy-local.bat
These scripts can:
- Check for
pnpm - Create
.env.localwhen missing - Install dependencies
- Run
pnpm bootstrap - Start the app in development or production mode
You can also use the explicit launcher:
node scripts/launch.mjs dev
node scripts/launch.mjs prodpnpm dev
pnpm build
pnpm start
pnpm lint
pnpm bootstrap
pnpm db:init
pnpm db:generate
pnpm assets:sync.
├── src/
│ ├── app/ # pages, components, server actions, game loop
│ ├── interfaces/ # schemas, DTOs, shared types
│ ├── lib/ # prisma, local config, MCP, utilities
│ └── utils/ # model adapters and AI helpers
├── prisma/ # SQLite schema and local database
├── public/ # static assets and generated images
├── scripts/ # bootstrap, launch, db init, asset sync
├── docs/ # architecture, rules, roadmap, faction docs
├── skills/ # SKILL.md assets for agents
└── openclaw/ # OpenClaw example config
data/local-config.json- Active model configuration, prompts, feature flags, and local user profile
prisma/dev.db- SQLite database used by the local edition
public/assets/- Bundled UI assets
public/generated/- Generated local image outputs
- This edition is designed for local play, not multi-user deployment.
- Model keys are not bundled. You must configure your own provider credentials.
- Image generation is optional and disabled by default.
pnpm buildcurrently succeeds in the open-source local stack; day-to-day development is still more convenient withpnpm dev.
Contributions are welcome. Please read CONTRIBUTING.md before opening a pull request.
Useful contribution areas:
- gameplay balance
- faction/world simulation
- prompt quality
- UI/UX refinement
- documentation
- bug fixing and cleanup
This project is released under the MIT License.