Local Prediction
For better feeling on the local machine, almost every game implements some sort of local prediction about actions sent up to the server. Is there a current approach for doing that with SpacetimeDb? Or are there plans?
It seems to me that the code for most reducers would be fine to include in the client. Then the client sdk could run the reducer against the local view of the db to predict how the db would change in response to that reducer call.
It has some complexity, but solving this well would make this the defacto choice for multiplayer games. It's feasible to build that infrastructure myself, but I think it could be supported natively, probably better than a wrapping framework.
This would likely be done on a case by case basis - the existing SpacetimeDB Unity tutorial has a simple approach for interpolation implemented on the client side. You can find that mentioned in the 3rd part here.
This is super dependent on the game, which is why I think it hasn't been tackled as a core part of the tech. Just my 2 cents.
Yeah, this is a good callout. It's on our radar to implement! And we'd definitely give the developer control over how it works for specific tables/fields.
This HN post mentions some interesting things that should be currently in progress regarding client side prediction.
Is there any issue or place to follow the progress?
https://news.ycombinator.com/item?id=43593913
Considering how many different genres of games this would unlock, its quite exciting
Hey @Nikola-Milovic, unfortunately we don't have any public place to keep track of the progress on these roadmap items. We're worried that it would be more noisy than helpful for users, because our priorities are often shifting around as a small company.