π¨π³ δΈζ Β· πΊπΈ 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 an intro video on my Bilibili: [`link`](https://space.bilibili.com/527346837).  ## Development Progress ### ποΈ Foundation - β World map basics - β Diverse terrain types (plain, mountain, forest, desert, water, etc.) - β Time system (year-month timestamps) - β Frontend UI (pygame) - β Simulation framework - β Project documentation (README) - β Config system - [ ] Standalone release (packaged exe) - [ ] Web frontend (later) - [ ] ECS parallel toolkit (later) - [ ] Player-configurable prompts (later) ### πΊοΈ Tile System - β Basic tile mechanics - β Normal, cultivate, city, sect regions - β Same-tile NPC interactions - β Qi distribution and yields ### π€ Character System - β Core attributes - β Cultivation realms - β Spiritual roots - β Basic movement actions - β Personality - β Breakthrough system - β Relationships - β Perception radius - β Buff system: buffs/debuffs - β Artifacts - [ ] Special abilities - [ ] Epithets/nicknames - [ ] Combat-related - [ ] Attribute points allocation - [ ] Skill system (techniques) - [ ] Equipment system - [ ] Skill learning - [ ] Learnable skills - [ ] Personal techniques (flexible integration) - [ ] Life professions (alchemy, formations, farming, forging, etc., with tailored prompts and info space) - [ ] Mortals support - [ ] Prodigies (stronger abilities and AI) ### ποΈ Organizations - [ ] Sect system - β Settings, techniques, healing, base, styles - β Special sect action: Hehuan Sect (dual cultivation) - [ ] sect will AI, tasks, recruiting - [ ] Sect tiers: different titles, abilities, actions - [ ] 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 - [ ] Sudden events - [ ] Treasure/cave emergence - [ ] Novelized/CG/film-style presentations - [ ] Natural events: - [ ] Natural disasters - [ ] Beast tides ### βοΈ Combat - [ ] Combat design (roots influence skills and styles) - [ ] Advantages and counters - β Win-rate estimation (simple) ### π 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 - [ ] NPC observation space design - [ ] One-off choices (e.g., switch techniques or not) - [ ] Long-term memories / unforgettable memories ### ποΈ World Lore - [ ] Lore framework - [ ] Worldbuilding - [ ] Ancient history generation ### Specials - β Fortuitous encounters - [ ] Paths/Daos - [ ] Possession & Rebirth - [ ] Formations - [ ] Opportunities - [ ] Tribulations & Heart devils - [ ] Flexible world rules - [ ] Divination & Omens - [ ] Male-female traits inversion ## 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: model_name: "gpt-3.5-turbo" # or another model supported by LiteLLM key: "your-api-key-here" # your API key ``` See the LiteLLM docs: [`link`](https://docs.litellm.ai/docs/providers) 4. Run the simulator: ```bash python -m src.run.run ``` ### Basic Operations - A random map is generated at startup - Observe characters moving and acting in the world - Press ESC to quit ## Contributing Contributions are welcome! ## License This project is licensed as specified in [`LICENSE`](LICENSE). ## Contact Open an issue or pull request if you have questions or suggestions.