Merge pull request #5 from zhangjinglearning/feat/wechat-expansion-pack
feat: Create and finalize WeChat Mini-Game Expansion Pack
This commit is contained in:
commit
78892328e4
|
|
@ -47,4 +47,7 @@ dependencies:
|
|||
- gdd-wechat-template.yaml
|
||||
checklists:
|
||||
- game-story-dod-checklist.md
|
||||
data:
|
||||
- development-guidelines.md
|
||||
- technical-preferences.md
|
||||
```
|
||||
|
|
|
|||
|
|
@ -52,4 +52,5 @@ dependencies:
|
|||
- game-story-dod-checklist.md
|
||||
data:
|
||||
- development-guidelines.md
|
||||
- technical-preferences.md
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# <!-- Powered by BMAD™ Core -->
|
||||
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
|
||||
|
|
@ -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.
|
||||
Loading…
Reference in New Issue