|
1 | | -## AOTAI_Hike Demo(Phaser 像素场景 + DOM 像素聊天 UI + Python 内核) |
| 1 | +# 鳌太线徒步模拟器(AoTai Hike)Demo |
2 | 2 |
|
3 | | -### 目录 |
4 | | -- **frontend/**: 纯静态前端(Phaser 走 CDN,不需要打包) |
5 | | -- **backend/**: FastAPI 后端(session/角色/act/map 等接口),并预留记忆/生成接口扩展点 |
| 3 | +> A pixel-art interactive narrative game demo based on the MemOS multi-view memory system |
6 | 4 |
|
7 | | -### 一键启动(开发) |
8 | | -在本目录下执行: |
| 5 | +<div align="center"> |
| 6 | + <img src="./banner.png" alt="AoTai Hike × MemOS - Poly-View Memory" width="100%"> |
| 7 | +</div> |
9 | 8 |
|
| 9 | +## 📖 Overview |
| 10 | + |
| 11 | +**鳌太线徒步模拟器(AoTai Hike)** is a Web game demo showcasing MemOS's multi-view memory capabilities. Players can create multiple roles, lead a team across the dangerous AoTai route, and experience memory-based intelligent NPC dialogues and dynamic storytelling. |
| 12 | + |
| 13 | +### Key Highlights |
| 14 | + |
| 15 | +- 🎮 **Multi-role roleplay**: Create and switch between multiple roles, each with an independent memory space |
| 16 | +- 🧠 **Multi-view memory**: Fully integrated MemOS multi-view memory system |
| 17 | +- 💬 **Intelligent NPC dialogue**: Generate personality-consistent dialogue based on role memory |
| 18 | +- 🗺️ **Fixed route exploration**: Follow the real AoTai route and experience the full journey |
| 19 | +- 🎨 **Pixel-art UI**: Use Phaser 3 to render pixel-art maps and role animations |
| 20 | + |
| 21 | +**📚 For detailed documentation, see: [INTRODUCTION_ZH.md](./INTRODUCTION_ZH.md) | [INTRODUCTION_EN.md](./INTRODUCTION_EN.md)** |
| 22 | + |
| 23 | +## 🚀 Quick Start |
| 24 | + |
| 25 | +### Requirements |
| 26 | + |
| 27 | +- Python 3.8+ |
| 28 | +- MemOS service (local or remote) |
| 29 | + |
| 30 | +### Installation Steps |
| 31 | + |
| 32 | +1. **Install backend dependencies** |
10 | 33 | ```bash |
11 | 34 | cd backend |
12 | 35 | python -m venv .venv && source .venv/bin/activate |
13 | 36 | pip install -r requirements.txt |
| 37 | +``` |
| 38 | + |
| 39 | +2. **Configure MemOS service address (optional)** |
| 40 | +```bash |
| 41 | +export MEMOS_API_BASE_URL=http://localhost:8002 |
| 42 | +``` |
| 43 | + |
| 44 | +3. **Start the service** |
| 45 | +```bash |
14 | 46 | uvicorn app:app --host 0.0.0.0 --port 8010 --reload |
15 | 47 | ``` |
16 | 48 |
|
17 | | -打开:`http://localhost:8010/demo/ao-tai/` |
| 49 | +4. **Access the game** |
| 50 | +Open your browser and visit: `http://localhost:8010/demo/ao-tai/` |
| 51 | + |
| 52 | +## 📡 Core API |
| 53 | + |
| 54 | +- `GET /api/demo/ao-tai/map` - Get map information |
| 55 | +- `POST /api/demo/ao-tai/session/new` - Create a new session |
| 56 | +- `POST /api/demo/ao-tai/roles/upsert` - Create/Update a role |
| 57 | +- `POST /api/demo/ao-tai/roles/quickstart` - Quick-create default roles |
| 58 | +- `PUT /api/demo/ao-tai/session/active_role` - Switch active role |
| 59 | +- `POST /api/demo/ao-tai/act` - Perform an action (core endpoint) |
| 60 | + |
| 61 | +For detailed API documentation, see [INTRODUCTION_EN.md](./INTRODUCTION_EN.md#-api-documentation) |
| 62 | + |
| 63 | +## 🏗️ Project Structure |
| 64 | + |
| 65 | +``` |
| 66 | +demos/AOTAI_Hike/ |
| 67 | +├── backend/ # FastAPI backend |
| 68 | +│ ├── aotai_hike/ # Game core code |
| 69 | +│ │ ├── router.py # API routes |
| 70 | +│ │ ├── services/ # Game services |
| 71 | +│ │ ├── adapters/ # Adapters (memory/dialogue/background) |
| 72 | +│ │ └── world/ # Map data |
| 73 | +│ └── app.py # Application entry |
| 74 | +├── frontend/ # Frontend (Phaser 3 + DOM UI) |
| 75 | +│ ├── src/ # Source code |
| 76 | +│ └── assets/ # Asset files |
| 77 | +└── README.md # This file |
| 78 | +``` |
| 79 | + |
| 80 | +## 🔧 Extensible Interfaces |
| 81 | + |
| 82 | +The game is designed to be "lightweight but extensible"; all intelligence-related features are isolated via adapters: |
| 83 | + |
| 84 | +- `adapters/memory.py` - **MemoryAdapter**: Interface with MemOS memory system |
| 85 | +- `adapters/companion.py` - **CompanionBrain**: NPC dialogue generation (based on MemOS chat_complete) |
| 86 | +- `adapters/background.py` - **BackgroundProvider**: Background asset provider |
| 87 | + |
| 88 | +## 📚 Related Documents |
| 89 | + |
| 90 | +- [INTRODUCTION_ZH.md](./INTRODUCTION_ZH.md) - **Complete project introduction (中文)** |
| 91 | +- [INTRODUCTION_EN.md](./INTRODUCTION_EN.md) - **Complete project introduction (English)** |
| 92 | +- [backend/MEMORY_INTEGRATION.md](./backend/MEMORY_INTEGRATION.md) - Memory system interaction guide |
| 93 | +- [PRD.md](./PRD.md) - Product requirements document |
18 | 94 |
|
19 | | -### API |
20 | | -- `GET /api/demo/ao-tai/map` |
21 | | -- `POST /api/demo/ao-tai/session/new` |
22 | | -- `POST /api/demo/ao-tai/roles/upsert` |
23 | | -- `PUT /api/demo/ao-tai/session/active_role` |
24 | | -- `POST /api/demo/ao-tai/act` |
| 95 | +--- |
25 | 96 |
|
26 | | -### 扩展点(先占位,方便后续接 MemOS/LLM/背景生成) |
27 | | -- `aotai_hike/adapters/memory.py`:MemoryAdapter(当前为 InMemory) |
28 | | -- `aotai_hike/adapters/companion.py`:CompanionBrain(当前为 mock) |
29 | | -- `aotai_hike/adapters/background.py`:BackgroundProvider(当前为静态 SVG) |
| 97 | +**Enjoy your AoTai hike!** 🏔️ |
0 commit comments