Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 2.33 KB

File metadata and controls

44 lines (33 loc) · 2.33 KB

Unity Multiplayer Agent Skills

This repository is a curated skill collection for AI coding agents. It provides decision-tree guidance, integration references, and production-ready code templates for building real-time multiplayer Unity games targeting mobile (iOS/Android) and WebGL2 browsers.

How this repo is structured

  • SKILL.md — Entry point. Contains the decision trees, quick-start patterns, and index. Always start here.
  • references/ — Deep-dive guides. Load only the file relevant to the current question, never all at once.
  • assets/ — Production-ready code templates (TypeScript server + C# Unity client).
  • scripts/ — Project scaffolding helpers.
  • skill.json — Machine-readable registry metadata for programmatic discovery.

When helping users with this skill

  1. Start from the decision trees in SKILL.md to guide framework/architecture choices.
  2. Load the specific reference file only when the user needs deeper detail.
  3. Suggest asset templates when the user is ready to scaffold or implement.
  4. Always respect WebGL2 hard constraints (no raw sockets, no threads, WSS-only in production).

Key files by topic

Question Load this
Colyseus vs Nakama? SKILL.md decision tree, then references/colyseus-integration.md or references/nakama-integration.md
WebSocket library? SKILL.md comparison table, then references/websocket-networking.md
Architecture pattern? SKILL.md genre table, then references/architecture-patterns.md
WebGL limitations? references/webgl2-constraints.md
Performance? references/performance-optimization.md
Deployment? references/deployment-guides.md

Code conventions in templates

  • Unity managers use singleton pattern with DontDestroyOnLoad
  • All templates include exponential backoff reconnection with jitter
  • Cross-platform code uses #if UNITY_WEBGL && !UNITY_EDITOR conditional compilation
  • Server templates are TypeScript; client templates are C#
  • Event-driven architecture (C# events/callbacks) for extensibility

Do not

  • Load all reference files at once — they total 18,000+ lines
  • Recommend WebSocketSharp — it uses System.Net.Sockets and fails on WebGL
  • Suggest raw TCP/UDP for WebGL builds — only WebSocket works
  • Skip SSL/TLS considerations — WebGL requires wss:// in production