How sam152/aoe2-micromania works
Key Components to Include:
Core Architecture Layers
a) Client Layer:
• React Frontend (src/client)
• Canvas Renderer System
• Input Management
• Client State Management
• Asset Management
• Sound System
b) Server Layer:
• Game Server (src/server)
• Room Management
• Recording System
• State Synchronization
c) Common Layer:
• Game State Management
• Unit Management
• AI Systems
• Terrain System
• Formation System
┌─────────────────────────────────────────────┐
• Client Tier │
• ┤
• React Components │
• Canvas Renderer │
• Input Manager │
• Client State │
• Asset Manager │
• ┬───────────────────────────────┘
┌─────────────▼───────────────────────────────┐
• Common Game Logic │
• ┤
• Game State │
• Unit System │
• Formation System │
• AI System │
• Terrain System │
• ┬───────────────────────────────┘
┌─────────────▼───────────────────────────────┐
• Server Tier │
• ┤
• Room Management │
• State Synchronization │
• Game Recording │
• ┘
Key Interactions to Highlight
a) State Management Flow:
• How actions flow from client input to server validation
• State synchronization between clients
• Demonstrate the tick-based simulation system
b) Asset Pipeline:
• How graphics and sound assets are loaded and managed
• Asset cache system
c) Networking:
• Client-server communication
• Spectator connections
• Multiplayer synchronization
Implementation Details
• Annotations for critical systems like the tick rate (20 fps)
The networking architecture
Remember to maintain a balance between detail and clarity, focusing on the architectural decisions that make this implementation unique, such as the deterministic simulation and state synchronization system.