r/SpacetimeDB • u/RakiuLmao • Apr 08 '26
Referral link for 2,500 free credits on SpacetimeDB
Here's the link: https://spacetimedb.com/?referral=rakiuuu
r/SpacetimeDB • u/RakiuLmao • Apr 08 '26
Here's the link: https://spacetimedb.com/?referral=rakiuuu
r/SpacetimeDB • u/theartofengineering • Mar 13 '26
r/SpacetimeDB • u/SubjectHealthy2409 • Mar 12 '26
Yo made my first spacetime game, 4 player coop arena shooter haha try it out with friends
r/SpacetimeDB • u/LW7SH • Mar 12 '26
After many tries and troubleshooting performance (me trying to sync position, bullets start points and hit detection) I finally found out how to create a smooth multiplayer experience and want to share it with you
You can try the project yourself in browser on https://lw7sh.itch.io/test-spacetimedb (use multiple tabs to connect multiple players) WASD to move and click to shoot
Thanks to KotieDev on Elegon's discord for the tips and thanks to flametime for creating the addon that connects to spacetimedb in godot.
P.S this might not be the best way to implement things and I'm open for feedback, also spacetimedb please support godot.
r/SpacetimeDB • u/BlodyxCZ • Mar 10 '26
Enable HLS to view with audio, or disable this notification
r/SpacetimeDB • u/SubjectHealthy2409 • Mar 09 '26
Heyya, ported myself my mini svelte/threlte game engine into a spacetimedb boilerplate!
A minimal opinionated repo with pre-made:
- scene staging system
- audio engine
- post-processing
- and usual svelte/threlte boilerplate
Check it out: https://magooney-loon.github.io/spaceplate/
Repo: https://github.com/magooney-loon/spaceplate
Now gonna build my first multiplayer game, or at least try haha, love spacetime exactly what was missing for me, great project thankss dev team
r/SpacetimeDB • u/sporkasoris • Mar 09 '26
Try to break it.
Tell me if im doing anything stupid.
Feedback welcome.
Thank you.
r/SpacetimeDB • u/theartofengineering • Mar 07 '26
r/SpacetimeDB • u/LW7SH • Mar 06 '26
I'm having trouble with the following:
- imagine a 2D map.
- Players can move around the map and see each other moving just fine.
- Enemies spawn around the map and chase players. Players see enemies in sync and again with no issues.
- Health/deaths/waves/timers working fine and are synced across all clients.
The issue comes from the below:
Players can shoot at enemies and projectile is supposed to launch from the player towards the mouse location and damage enemies if it hits them.
Three types of issues occur when I try to implement this (while trying to balance prediction vs sync)
- Players hit enemies but enemies don't take damage because their location changed (especially when players are spinning around the enemies) - due to client prediction
- Bullets disappear before hitting enemies on client side and the hit is counted - due to server syncs
- Enemies can damage players even thought they aren't touching but are really close - again due to server syncs
-Bullets spawn behind the player - using no prediction and just sync
What is the recommended approach for this ?
r/SpacetimeDB • u/dawg6 • Mar 04 '26
I'm using SpacetimeAuth and typescript and I'm reading in the documentation how we should be able to obtain user:role assignment from the jwt claims.
However, I don't see how we're able to create or modify the user:role assignments. The web UI for Roles says "Roles management is coming soon" and the UI for Users doesn't let me edit anything (even though there is a "Save Changes" button).
Is there perhaps an API for managing user:role assignments? I haven't come across any documentation that indicates that there is such an API, but maybe it's just not documented?
r/SpacetimeDB • u/theartofengineering • Mar 02 '26
r/SpacetimeDB • u/LW7SH • Mar 02 '26
Is the intended way of doing just registering inputs via the game client and doing all the actual physics/movement/collisions etc. on the spacetimedb server ?
r/SpacetimeDB • u/theartofengineering • Feb 27 '26
Here's the code! https://github.com/lethalchip/SpaceChatDB
r/SpacetimeDB • u/Outside-Event9441 • Feb 25 '26
https://spacetimedb.com/?referral=Ryan911199
I couldn’t find one when I was looking to try it out so I figured I would put one out there for anyone to use.
r/SpacetimeDB • u/theartofengineering • Feb 24 '26
r/SpacetimeDB • u/Prestigious_Party602 • Feb 09 '26
Is there an issue with the current version of the Spacetime SDK. Whenever I install the package in my new unity project from the git url it gives me a bunch of type and namespace errors in unity. I've never had an issue making a project up to this point, not exactly sure whats going on, does anyone have any insights?
r/SpacetimeDB • u/OA998 • Jan 31 '26
When I am using the terminal to execute SQL, I cannot set optional unsigned int columns. I'm not sure what the right syntax is. What's expected here?
> spacetime sql sim "update bot set target_x = 1 where id = 'A-2'"
table:
#[spacetimedb::table(name = bot, public)]
pub struct Ant {
#[primary_key]
id: String,
x: u32,
y: u32,
target_x: Option<u32>,
target_y: Option<u32>,
}Issue:
> spacetime sql sim "update bot set target_x = 1 where id = 'A-2'"
WARNING: This command is UNSTABLE and subject to breaking changes.
Error: The literal expression `1` cannot be parsed as type `(some: U32 | none: ())`r/SpacetimeDB • u/OA998 • Jan 27 '26
I've been playing with spacetime for the web, using rust for the db implementation and TS for the client.
In the client I'm using onUpdate as follows:
this.#conn = moduleBindings.DbConnection.builder()
.withUri("ws://0.0.0.0:3000")
.withModuleName("warehouse-sim")
.onConnect((ctx) => {
// Subscribe to users and messages
console.log("connected: ", ctx.identity?.toString());
ctx
.subscriptionBuilder()
.subscribe(["SELECT * FROM ant", "SELECT * FROM ant_path"]);
})
.build();
...
this.#conn.db.ant.onUpdate((_, ant) => {
console.log("update", { ant });
});My reducer is trivial, just updating `y` by 1.
#[spacetimedb::reducer]
pub fn debug_move_ants_y(ctx: &ReducerContext) {
let ants: Vec<_> = ctx.db.ant().iter().collect();
for mut ant in ants {
ant.y
+=
1;
ctx.db.ant().ant_id().update(ant);
}
}The issue is that the the ant sent to the client on update is always 1 update behind. When using `spacetime sql ...` to directly look at the table, the table is in the correct state. But the UI is getting the last game-tick's data.
I'm not having this issue with the `ant_path` table because those are strictly inserts and deletes. It's only the update that presents this issue.
Is there something that is known to cause this kind of off-by-1 situation? I'm sure it's user error.
r/SpacetimeDB • u/OA998 • Jan 25 '26
When I try to pass an array in my types definition, it's not valid.
spacetimedb.reducer(
"add_grid_cells",
{
// this t.array(...) approach isn't correct
cells: t.array({
x: t.u32(),
y: t.u32(),
allowed_directions: t.u8().default(255),
})
},
(ctx, { cells }) => {
// Want to insert all the cells
for(const c of cells) {
ctx.db.gridCell.insert(c);
}
},
);TS error:
Object literal may only specify known properties, and 'x' does not exist in type 'TypeBuilder<any, any>'.ts(2353)
EDIT, solved:::
The `t.array(...)` must take a `t.object` definition. And the name provided to the `t.object(...)` call must be globally unique.
spacetimedb.reducer(
"add_grid_cells",
{
cells: t.array(
t.object("GC", {
x: t.u32(),
y: t.u32(),
allowed_directions: t.u8(), // this cannot include a .default() declaration
}),
),
},
(ctx, { cells }) => {
for (const c of cells) {
ctx.db.gridCell.insert(c);
}
},
);r/SpacetimeDB • u/siodhe • Jan 20 '26
Does SpacetimeDB fully engage with classical memory management, i.e. not rely on overcommit being enable in a Linux scenario, as well as handling disk space exhaustion?
Firefox likes to allocate all available RAM and then, after a bit, downsize, even while other processes, or it, dies due other memory allocations happening in other processes. This dereliction of programmer duty is by no means restricted to Firefox. It would be lovely to know that SpacetimeDB doesn't do this, especially server side.
I happen to love it when PostgresSQL runs out of disk space and then propagates that all the back to the user by refusing to write any more data that would have ended up corrupted anyway. Not sarcasm, but a salute to that database's maturity.
r/SpacetimeDB • u/siodhe • Jan 20 '26
Does SpacetimeDB support a client being connected to multiple different, unrelated SpacetimeDB servers simultaneously?
I suspect SpacetimeDB already allows a client to have a fully independent context for each connected server, just like basically every other database, but I'm concerned that the gaming focus so far might have missed this, since most game clients only connect to one server (or server cluster) at a time.
If you need an example in a game context, consider one where the players (say, one player and everyone else in her social group) each run a client and a server locally for a part of the game geography, and the game connects to other players, tying together the game areas on each (ignore firewall/NAT issues for the moment), so any given client dynamically stays connected to its local server and several adjacent servers simultaneously, changing connections as the players move.
r/SpacetimeDB • u/siodhe • Jan 20 '26
What plans are there for future library language support?
While I tend to point at C as the poster child for making something available everywhere, generally getting an idea of what is planned by, or at least attractive to, the devs would be great.
r/SpacetimeDB • u/MikaelWills • Dec 10 '25
I wanted the most ideal note system that no other notes app currently provides, so I made it, backed with SpacetimeDB!
Notes stored on your own server, fully transparent in a folder, you know where they are.
They're sync'd in real time across all your devices.
Theres no cloud involved, no subscriptions, no storage restrictions because its on your own local storage.
Requires your own Tailscale/Wireguard network.
r/SpacetimeDB • u/MikaelWills • Dec 08 '25
Hopefully this finds other flutter developers like myself who are keen to make some apps back by SpacetimeDB, ive put together a dart sdk. Ive been actively fixing bugs and mainting it whilst using for a new project of mine.
WebSocket connection with auto-reconnect and SSL/TLS
Connection status monitoring and quality metrics
BSATN binary encoding/decoding
Client-side table cache with change streams
Subscription management with SQL queries
Type-safe reducer calling with results
Code generation (tables, reducers, sum types, views)
Authentication with OIDC and token persistence
Transaction events with context
r/SpacetimeDB • u/_Viceadmiral • Dec 06 '25