diff --git a/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-designer.md b/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-designer.md index 9e8b73a6..baa857b4 100644 --- a/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-designer.md +++ b/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-designer.md @@ -47,4 +47,7 @@ dependencies: - gdd-wechat-template.yaml checklists: - game-story-dod-checklist.md + data: + - development-guidelines.md + - technical-preferences.md ``` diff --git a/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-dev.md b/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-dev.md index 8968508e..ec0ee063 100644 --- a/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-dev.md +++ b/expansion-packs/bmad-wechat-mini-game-dev/agents/wechat-game-dev.md @@ -52,4 +52,5 @@ dependencies: - game-story-dod-checklist.md data: - development-guidelines.md + - technical-preferences.md ``` diff --git a/expansion-packs/bmad-wechat-mini-game-dev/config.yaml b/expansion-packs/bmad-wechat-mini-game-dev/config.yaml new file mode 100644 index 00000000..30262a7c --- /dev/null +++ b/expansion-packs/bmad-wechat-mini-game-dev/config.yaml @@ -0,0 +1,8 @@ +# +name: bmad-wechat-mini-game-dev +version: 1.0.0 +short-title: WeChat Mini Game Dev Pack +description: >- + Game Development expansion pack for BMad Method - WeChat Mini Game focused +author: Jules (AI Assistant) +slashPrefix: mad-game diff --git a/expansion-packs/bmad-wechat-mini-game-dev/data/technical-preferences.md b/expansion-packs/bmad-wechat-mini-game-dev/data/technical-preferences.md new file mode 100644 index 00000000..e5c4f98f --- /dev/null +++ b/expansion-packs/bmad-wechat-mini-game-dev/data/technical-preferences.md @@ -0,0 +1,29 @@ +# WeChat Mini Game - Technical Preferences & Best Practices + +This document contains user-defined preferences and critical best practices for Mini Game development, based on official documentation and performance guidelines. + +--- + +## 1. Performance & Runtime + +- **Target Framerate:** Casual games must maintain a minimum of **30 FPS** on low-end test devices. More intensive games should target **60 FPS** on mid-to-high-end devices. +- **WASM is Core:** All game logic should be compiled to WebAssembly (WASM) for maximum performance. +- **iOS JIT Mode:** For games requiring high performance, enabling the **iOS High Performance Mode** to allow JIT compilation is mandatory. Be aware this requires extra optimization for memory and startup time. For hyper-casual games, the default non-JIT mode is acceptable. + +## 2. Rendering & Graphics (WebGL) + +- **WebGL 2.0:** Where device support allows, **WebGL 2.0** should be enabled to leverage features like GPU Instancing and SRP Batching. +- **Texture Compression:** Use platform-specific compressed texture formats. **ASTC** is the required format for all textures on iOS to optimize memory usage. +- **Object Pooling:** Do not instantiate and destroy objects frequently in the game loop (e.g., bullets, effects). Implement an **object pooling** system to recycle and reuse game objects. + +## 3. Asset & Memory Management + +- **Sub-packaging (`分包`):** Large assets, levels, or non-critical resources **must** be placed in sub-packages to keep the initial download size small. +- **Memory Limits:** Be mindful of strict memory limits on mobile devices. Profile memory usage frequently using the WeChat DevTools. +- **Asset Loading:** Load assets asynchronously. Do not block the main thread during initial game load. + +## 4. Anti-Patterns to Avoid + +- **Ignoring iOS Non-JIT Mode:** Do not assume JIT compilation is available. Test performance on iOS devices in default mode. +- **Using Uncompressed Textures:** Avoid using large PNGs where a compressed format like ASTC (for iOS) or ETC2 (for Android) would be more memory-efficient. +- **Blocking the Main Thread:** Any long-running operation (e.g., complex calculations, large data processing) should be moved to a Worker thread if possible.