SpacetimeDB ThreeJS Support

(discourse.threejs.org)

11 points | by ryker2000 3 days ago ago

4 comments

  • usernamed7 a minute ago

    this is pretty cool! what I do for my project (3d voxel web page platform) is treat the scene as a document and push updates to the server when things change. this works well for distribution and simplicity, but does mean multi-player is "difficult". using spacetime to manage and track that info and have threejs render would be cool and enable a lot of things.

    I may explore spacetimedb as a project sometime, although i am reluctant to be tied into a platform that my project cannot work without, that i cannot host myself, that can change their pricing/limits/terms of at any time and for which there is no alternative.

  • ryker2000 3 days ago

    SpacetimeDB 2.0 makes the database your game server.

    You run game logic “inside” the DB, model world state as tables, and expose moves/damage/spawns as reducers. Clients (like Three.js) subscribe over WebSockets and get fine‑grained diffs instead of polling, so the server stays authoritative and the client just renders and interpolates. Generous free tier, paid starts at $25/month.

    https://discourse.threejs.org/t/spacetimedb-threejs-support-...

  • siriusastrebe 3 days ago

    This looks very promising. There's a need for persisting game state in a central place, but also have that data streaming in.

    I'm wondering about temporary gamestate that doesn't need to persist. Things like terrain or destructible voxels, where the size could be prohibitive to keep in a databases, but would work well in memory or with a cache.

    • ryker2000 2 days ago

      Great question about the non-persistent game state — Implementing a custom setup on your own server is likely the best approach paired with CDN if alot of people are downloading.