Files
Jason Larabie f8d6d76ee4 Update Unreal SDK to websocket 2.0 (#4497)
# Description of Changes

- Updated the Unreal SDK and generated Unreal bindings for the websocket
2.0 protocol/model
  - Reworked DbConnectionBase to handle the updated message shapes
- Switched subscription handling over to new message types and
QuerySetId
- Updated reducer to ReducerResult, removal of callbacks, and set
reducer flags
  - Added event table support
- Baked in multi-module support replacing [the old
PR](<https://github.com/clockworklabs/SpacetimeDB/pull/3417>)
- Added functionality to generate module support for multiple folders in
the Unreal project (add <module>.Build.cs, <module>.h, <module>.cpp)
using the --module-name
- Add new configuration option for spacetime generate to handle module
prefix
 - Regenerated Unreal Blackholio/TestClient/QuickstartChat bindings
   - Rebuilt Unreal Blackholio's consume entity to use event tables 
 - Updated migration documentation
 - Updated the version bump tool to impact C++

# API and ABI breaking changes

- Unreal websocket/message handling updated to the new protocol
- Unreal generation now expects a real .uproject target and will stop
immediately if project
    metadata is invalid instead of continuing past setup issues.

# Expected complexity level and risk

3 - A large set of changes to update the websocket/message handling
along with heavy codegen changes to handle multi-module support

# Testing

Test coverage of the Unreal SDK will need expansion in a future ticket
once our issues with flakiness on CI is resolved.

- [x] Updated Unreal Blackholio 
- [x] Ran full Unreal SDK test suite
- [x] Built new test project using the new `--module-prefix` 
- [x] Run through Unreal Blackholio (C++ and Blueprint)
- [x] Rebuilt Unreal Blackholio with multi-module, and duplicate
generated module testing side-by-side modules that would overlap

# Review Question(s)
- [x] Updates to `spacetime init` have made the tutorial a little
confusing with pathing for the Unreal Blackholio tutorial. To fix though
we'd have to update all the commands to be more explicit, or update the
tutorial `spacetime init` to use `--project-path .` to keep pathing
simpler, thoughts?

---------

Signed-off-by: Jason Larabie <jason@clockworklabs.io>
Co-authored-by: Ryan <r.ekhoff@clockworklabs.io>
2026-03-18 21:14:06 +00:00
..
2026-02-20 10:44:29 +00:00
2026-03-03 11:06:52 +00:00
2025-09-22 20:16:33 +00:00
2025-08-12 18:20:58 +00:00

Blackholio

Blackholio is a small-scoped MMORPG built using Unity and SpacetimeDB, designed to showcase scalable multiplayer game development. Inspired by agar.io, Blackholio reimagines the mechanics with a space theme where players become planets, stars, and black holes in a competitive cosmic arena.

Game Overview

  • Gameplay: Absorb smaller entities, grow, evolve, and dominate the leaderboard as a black hole.
  • Scale: Supports hundreds of players seamlessly with SpacetimeDB's real-time synchronization.
  • Objective: Demonstrate SpacetimeDB's features and best practices in a fun, interactive project.

Tutorial Overview

This repository accompanies the Blackholio Unity Tutorial, which guides you through building the game from scratch while learning:

  • Unity integration with SpacetimeDB.
  • Client-server setup for multiplayer games.
  • SpacetimeDB features, including reducers, tables, and scheduled events.

By following the tutorial, you'll develop:

  1. A basic understanding of SpacetimeDB for multiplayer games.
  2. A functional game prototype with scalable multiplayer features.

Need help with the tutorial? Join our Discord server!


Getting Started

If you want to follow a more structured tutorial where it shows you how to set everything up, start with our Blackholio Tutorial.

If you just want to checkout the final project and play around a bit, follow these steps:

  1. Install SpacetimeDB CLI
  2. Start SpacetimeDB in a separate terminal with spacetime start.
  3. Clone this repository:
    git clone https://github.com/ClockworkLabs/SpacetimeDB.git
    cd SpacetimeDB/demo/Blackholio
    
  4. Publish the server logic. You can either publish the csharp server or the rust server.
    cd server-rust/
    # Upload the module to SpacetimeDB
    bash ./publish.sh
    # Update the client bindings in case they are out of date
    bash ./generate.sh
    
  5. Install Unity Hub and Unity version 2021.2 or newer.
  6. Open the scene named Main.unity
  7. Hit play!

You should be prompted for a username and you should be able to move around, eat food and defeat other players!


Features

  • Core Gameplay: Consume, grow, and dominate.
  • Multiplayer: Scales to hundreds of players with SpacetimeDB.
  • Dynamic Gameplay: Spawning, movement, collisions, and evolution mechanics.
  • Learn by Building: Explore the mechanics of Unity and SpacetimeDB through the tutorial.

Repository Structure

Blackholio/
├── client-unity/      # Unity client project
├── client-unreal/     # Unreal Engine client project
├── server-csharp/     # SpacetimeDB server module (C# implementation)
├── server-rust/       # SpacetimeDB server module (Rust implementation)
├── DEVELOP.md         # Development guidelines
└── README.md          # This file

Requirements

  • Unity: Version 2021.2 or newer.
  • Rust: Version 1.65.0 or later (for the SpacetimeDB server module).
  • SpacetimeDB CLI: Installed via SpacetimeDB installation guide.

Resources


License

This project is licensed under the Apache License.

Feel free to fork, modify, and use Blackholio as a starting point for your own projects. Contributions are welcome!


Feedback

We'd love to hear your thoughts on the tutorial or game! Open an issue in the repository or chat with us on Discord.

Happy developing, and enjoy creating the cosmos with Blackholio! 🚀