mcpField
S
spacetimedb-client-unreal

spacetimedb-client-unreal

github.com/danmossaDevelopment2146 installsUpdated 19w ago
Repository

About spacetimedb-client-unreal

A skill for implementing SpacetimeDB clients in Unreal Engine. It covers code generation, connection setup, subscription handling, and runtime patterns using the Unreal SDK.

Key features

  1. 01Generate Unreal bindings
  2. 02Configure database connections
  3. 03Read subscribed table caches
  4. 04Call reducers and bind delegates
  5. 05Manage subscriptions and callbacks

Use cases

  1. 01Adding a SpacetimeDB client to an Unreal project
  2. 02Generating bindings for a game module
  3. 03Handling subscription events in gameplay code

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/danmossa/spacetimedb-skills --skill spacetimedb-client-unreal

After installing, type/spacetimedb-client-unrealin Claude Code to confirm it loaded.

Bundled filesreferences/clients-unreal.md

Details

From the project README

Use this skill for Unreal Engine client implementation.

Core Unreal patterns

Generate Unreal bindings with the project module details:

spacetime generate --lang unrealcpp --uproject-dir path/to/Game.uproject --module-path spacetimedb --unreal-module-name Game

Connection shape:

UDbConnection* Conn = UDbConnection::Builder()
    ->WithUri(TEXT("ws://localhost:3000"))
    ->WithDatabaseName(TEXT("my-database"))
    ->OnConnect(OnConnectDelegate)
    ->OnConnectError(OnConnectErrorDelegate)
    ->OnDisconnect(OnDisconnectDelegate)
    ->Build();

Runtime rules

  • The Unreal SDK processes messages automatically through WebSocket callbacks and UDbConnection ticking; do not add a manual polling loop unless the project already has one.
  • Use generated Conn->Db table objects for subscribed cache reads and Conn->Reducers for reducer calls.
  • Bind OnInsert, OnDelete, OnUpdate, and reducer delegates before subscribing when startup events matter.
  • SubscribeToAllTables() is useful for examples; production code should subscribe to specific SQL/query sets.
  • Use generated Unreal class and delegate names from the project. Do not copy sample UUserTable or FUserType identifiers unless they exist locally.
  • Keep plugin setup, generated code, and gameplay classes separate unless the existing project layout combines them.

Reference map

NeedOpen
Unreal SDK APIreferences/clients-unreal.md

Guidance

  • Keep Unreal connection ticking and callback binding patterns consistent with the reference.
  • Use generated Unreal class names from the local project rather than copying sample identifiers blindly.
  • Route complete Unreal tutorial work to spacetimedb-tutorials.

Comments

Markdown supported