πŸ‡¨πŸ‡³ δΈ­ζ–‡ Β· πŸ‡ΊπŸ‡Έ English

β€” ✦ β€”

# Cultivation World Simulator An AI-driven cultivation world simulator that aims to create a truly living, immersive xianxia world. ## Overview Cultivation World Simulator combines traditional game-rule systems with large language models. By first establishing a complete ruleset for the cultivation world, it creates an autonomous, vibrant, immersive virtual world with emergent stories. Core idea: **Build a credible rule-based world model first, then plug in AI to bring it to life.** ### Tech Stack - **Frontend Rendering**: pygame (Web support in the future) - **Simulation Engine**: custom event-driven simulator - **World Model**: rule-based deterministic systems - **AI Integration**: LLM-generated actions, decisions, micro-stories ## Background I have been a long-time reader of xianxia novels, from classics to modern works. As a game AI practitioner, I believe today’s LLM capabilities are sufficient to support a xianxia-style world simulation. However, LLM-only NPC decision/dialogue is not enough. A credible rule system must ground the world as the β€œworld model”, and then AI makes it vivid. I aim to create a pure, joyful, direct, living sense of immersion. Not a mere marketing demo, nor purely academic like β€œStanford Town”, but a world that players can actually feel and inhabit. If you like this project, consider starring it~ You can also watch intro videos for this project on my [Bilibili account](https://space.bilibili.com/527346837). ![Screenshot](assets/screenshot.gif) ## Contact If you have any questions or suggestions, feel free to open an Issue or Pull Request. You're also welcome to leave a message on my [Bilibili account](https://space.bilibili.com/527346837)! You can also join the QQ group for discussion: 1071821688. Verification answer is my Bilibili nickname. ## Development Progress ### πŸ—οΈ Foundation - βœ… World map basics, time, event system - βœ… Diverse terrain types (plain, mountain, forest, desert, water, etc.) - βœ… Web-based frontend interface - βœ… Simulation framework - βœ… Configuration files - βœ… Standalone release (packaged exe) - βœ… Menu bar & Save & Load ### πŸ—ΊοΈ World System - βœ… Basic tile mechanics - βœ… Normal, cultivate, city, sect regions - βœ… Same-tile NPC interactions - βœ… Qi distribution and yields - βœ… World event - [ ] Dynamic worldview, map, history, sect, and notable figure generation ### πŸ‘€ Character System - βœ… Core attributes - βœ… Cultivation realms - βœ… Spiritual roots - βœ… Basic movement actions - βœ… Trait & Personality - βœ… Breakthrough system - βœ… Relationships - βœ… Interaction range - βœ… Effect system: buffs/debuffs - βœ… Techniques - βœ… Combat equipment & auxiliary equipment - βœ… Short/Long term memory - βœ… Character's short and long term objectives, supporting player active setting - βœ… Avatar nicknames - [ ] Character compatibility - [ ] Skill learning system: - [ ] Learnable skills - [ ] Life professions (alchemy, formations, planting, forging, etc.) - [ ] Mortals - [ ] Prodigies (stronger abilities and AI) ### πŸ›οΈ Organizations - [ ] Sect system - βœ… Settings, techniques, healing, base, styles - βœ… Special sect actions: Hehuan Sect (dual cultivation), Hundred Beasts Sect (beast taming) - [ ] Sect will AI - [ ] Sect tasks - βœ… Sect tiers - [ ] Clans - [ ] Court/Empire (TBD) - [ ] Inter-organization relations ### ⚑ Action System - βœ… Basic movement - βœ… Action execution framework - βœ… Defined actions (rule-complete) - βœ… Long-duration actions and settlement - βœ… Multi-month actions (cultivate, breakthrough, play, etc.) - βœ… Auto-settlement upon completion - βœ… Multiplayer actions: initiator + responder flow - βœ… LLM actions that affect relationships - βœ… Systematic action registration and runtime logic - [ ] Richer actions ### 🎭 Event System - [ ] World-scale events: - [ ] Auctions - [ ] Secret realm exploration - [ ] Martial tournaments - [ ] Heaven-earth Qi fluctuations - [ ] Sudden events - [ ] Treasure/cave emergence - [ ] Natural events: - [ ] Natural disasters - [ ] Beast tides ### βš”οΈ Combat - βœ… Advantages and counters - βœ… Win-rate estimation system ### πŸŽ’ Items - βœ… Basic items and spirit stones - [ ] Trading mechanics - [ ] Economy system ### 🌿 Ecology - βœ… Animals and plants - βœ… Hunting, gathering, materials - [ ] Beasts/monsters ### πŸ€– AI Enhancements - βœ… LLM interface integration - βœ… Character AI (rules AI + LLM AI) - βœ… Coroutine decision making, async, multithreaded speedups - βœ… Long-term planning and goal-driven behavior - βœ… Reactive responses to external stimuli - βœ… LLM-driven NPC dialogue, thinking, interaction - βœ… LLM-generated micro-stories - βœ… Use different models (max/flash) per task needs - βœ… Micro-theaters - βœ… Battle micro-theaters - βœ… Dialogue micro-theaters - βœ… Multiple writing styles - βœ… One-off choices (e.g., switch techniques or not) ### πŸ›οΈ World Lore - [ ] Lore framework - [ ] Worldbuilding - [ ] Ancient history generation ### Specials - βœ… Fortuitous encounters - βœ… Tribulations & Heart devils - [ ] Ascension to Upper Realm - [ ] Paths/Daos - [ ] Possession & Rebirth - [ ] Formations - [ ] Opportunities - [ ] Flexible world rules - [ ] Divination & Omens - [ ] Male-female traits inversion - [ ] Hidden Identity / Dual Persona - [ ] World Secret ### πŸ”­ Long-term - [ ] ECS parallel toolkit - [ ] Novelization/imagery/video for history and events - [ ] Avatar calling MCP tools on their own ## Usage ### Run Steps 1. Clone the repo: ```bash git clone https://github.com/your-username/cultivation-world-simulator.git cd cultivation-world-simulator ``` 2. Install dependencies: ```bash pip install -r requirements.txt ``` 3. Configure LLM: Edit `static/config.yml`: ```yaml llm: key: "your-api-key-here" # your API key ``` For supported models, refer to [litellm documentation](https://docs.litellm.ai/docs/providers) 4. Run: Need to start both backend and frontend. ```bash # In project root python src/server/main.py ``` The browser will automatically open the web frontend. ## Contributors - Aku, for world design & discussion ## License This project is licensed as specified in the [LICENSE](LICENSE) file.