Skip to Content
DocsGame ServerIntroduction

Agent8 Server SDK

We aim not only to create single-player games through Agent8 but also to enable the creation of various multiplayer games. Therefore, Agent8 provides a game server along with an extremely user-friendly SDK, allowing AI to easily utilize the game server during game development. The server usage examples below are elements that AI handles directly; however, if users desire more advanced tasks, they can learn from the content below and directly leverage the Agent8 game server.

Integrating Game Server

Agent8 provides a fully managed game server that can be easily used in client code. It also offers a package(@agent8/gameserver) that can be used immediately on the client side. By utilizing this, you can persistently store user states or implement real-time multiplayer games.

Check out the architecture diagram below to see how these systems interact:

Why Agent8 GSaaS?

  • 🚀 Zero Infrastructure Management
    Fully hosted solution with automatic scaling
  • 💡 Client-First Design
    Call server functions and manage state directly from React components
  • 🌐 Built-in Multiplayer Features
    • Real-time messaging (global/room scope)
    • Persistent state management ($global/$room)
    • Automatic user presence tracking
    • Managed room system with auto-scaling

Key Capabilities

  1. Server Functions as API
    Call remote server functions with remoteFunction() as if they were local methods
  2. Global State Management
    Maintain game-wide state using $global operations with real-time sync
  3. Room System
    Create/join rooms with joinRoom(), track participants via $users array
  4. Real-time Messaging
    Broadcast messages with guaranteed delivery using onGlobalMessage/onRoomMessage

Global vs Room

Agent8 provides two distinct state management systems tailored for different gameplay needs:

Global State

  • Persistently stores data across sessions (character profiles, inventory, achievements)
  • Optimized for long-term persistence with periodic synchronization
  • Accessible from anywhere in the game
  • Recommended for:
    • Player profiles and progression systems
    • Game-wide leaderboards
    • Persistent game economies

Room State

  • Ephemeral session-based containers for real-time gameplay
  • Supports instant synchronization between room participants
  • Limited concurrent players per room
  • Recommended for:
    • Battle royale matches
    • Cooperative dungeon runs
    • Real-time strategy games
Last updated on