Skip to content

codeista/aw-mmo

Repository files navigation

SpacetimeDB MMO Game Development

A collection of multiplayer game experiments built with SpacetimeDB, featuring different genres and gameplay styles. Each game is developed on its own branch with shared infrastructure.

🚀 Quick Start

# Make the agent executable
chmod +x game-planning-agent.js

# Run the planning agent
./game-planning-agent.js

🎮 Game Projects

Current Games:

  1. Fight or Die (human-war-tactics branch)

    • Turn-based tactical combat
    • 5x5 grid with terrain effects
    • Status: Playable Phase 1
  2. Insect Colony Wars (Planned)

    • Real-time strategy MMO
    • Resource gathering & warfare
    • Status: Design phase

See GAME-DESIGNS.md for all game concepts.

🛠️ Development Tools

Game Planning Agent (game-planning-agent.js)

  • Interactive CLI for new games
  • Generates SpacetimeDB + TypeScript boilerplate
  • Supports multiple game types

AI Agent Framework (.agents/)

  • Architecture enforcement
  • Design validation
  • Code quality checks

🎮 Supported Game Types

  • Real-time Multiplayer: .io games, battle arenas, real-time strategy
  • Turn-based Multiplayer: Chess, card games, board games
  • Single Player with Online Features: Leaderboards, achievements, cloud saves

🛠️ Prerequisites

  • Node.js 18+
  • SpacetimeDB CLI
  • Basic knowledge of Rust or C# (for backend)
  • TypeScript/JavaScript knowledge (for frontend)

📚 Example Workflow

  1. Plan Your Game

    ./game-planning-agent.js
    # Choose option 1: Create game concept
  2. Generate Project Structure

    ./game-planning-agent.js
    # Choose option 2: Generate project structure
  3. Start Development

    cd your-game-name
    # Terminal 1: Run SpacetimeDB
    cd backend && spacetime dev
    
    # Terminal 2: Run frontend
    cd frontend && npm install && npm run dev

🏗️ Project Structure

Generated projects follow this structure:

your-game/
├── backend/           # SpacetimeDB module (Rust/C#)
│   ├── Cargo.toml
│   └── src/
│       └── lib.rs
├── frontend/          # TypeScript client
│   ├── package.json
│   ├── src/
│   │   ├── main.ts
│   │   ├── services/
│   │   │   └── spacetime.ts
│   │   ├── components/
│   │   └── types/
│   └── index.html
├── package.json
└── README.md

🔥 Key Features Support

The agent can generate boilerplate for:

  • Player authentication
  • Real-time movement/position tracking
  • Chat systems
  • Leaderboards
  • Matchmaking
  • Inventory systems
  • Turn-based game logic

💡 Best Practices

  1. Start Small: Begin with core mechanics before adding features
  2. Server Authority: Validate all game logic server-side
  3. Optimize Early: Use proper indexes and efficient queries
  4. Test Multiplayer: Test with multiple clients from the start
  5. Handle Disconnects: Implement reconnection logic

🤝 Contributing

Feel free to extend the agents with:

  • Additional game templates
  • More sophisticated code generation
  • Integration with game engines (Phaser, PixiJS)
  • Testing utilities
  • Deployment scripts

📖 Resources

🎯 Example Games You Can Build

  • Multiplayer Snake: Real-time movement, collision detection, leaderboards
  • Chess/Checkers: Turn-based logic, game state validation, matchmaking
  • Battle Royale: Spatial queries, real-time combat, shrinking zones
  • Trading Card Game: Deck building, turn management, card effects
  • Collaborative Drawing: Real-time canvas updates, room management

Happy game building! 🎮✨

About

SpacetimeDB Game Development Toolkit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors