Questions About Using SpaceTimeDB for Game Development
I understand that SpaceTimeDB is an ECS-like database, but I'm still trying to grasp the concept fully. I have a few questions:
- How scalable is SpaceTimeDB for game development? For example, can it handle a game with 50,000+ entities?
- Do I need to write my game logic twice if I'm using Bevy alongside SpaceTimeDB? I may have misunderstood the documentation, but I'm looking for clarification on this.
- Could someone break down the key concepts of SpaceTimeDB for me or suggest a logical order in which to read the documentation or other materials? While I understand the origins of SpaceTimeDB, I'm still unclear on how to architect and build my game around it. Does using SpaceTimeDB mean I no longer need Bevy?
- Regarding data synchronization: Do I need to sync everything across the game, or just the modules/entities that affect all players? For example, in a space game where users can customize their ships, if a player opens the customization menu mid-game and changes things in a preview mode (without syncing the results until they click the apply button), how would this be handled?
Finally, is SpaceTimeDB similar to a server architecture but built on top of databases?
Hi, I'm also facing these questions. I don't believe I'm qualified to answer these questions but here is what I gathered so far with just reading a bit of their documentation the past two days.
SpaceTimeDB is more like a database with a state reducer and real-time subscriptions to the state changes.
If you are familiar with redux in react it basically has reducer functions that take actions that transform the state of the db to the next state.
This reducer functions are the server part of the Spacetimedb.
My current naive strategy to use bevy in this reducer function would be:
- Initialize bevy from db state
- Run the systems that need to be run (reusing systems that are run in the bevy client)
- Read the bevy state changes to then write on the database.
I'm assuming reducer functions are like serverless lambda functions that are short lived. This means that each reducer will probably be running different systems.
This seems like a tall order atm.
Any help from the community to explore bevy usage with spacetime db would be greatly appreciated.