DoodlesEpic / MultiplayerPicross

Picross-style nonogram puzzles, but multiplayer.
https://picross.doodlesdev.com/
GNU Affero General Public License v3.0
3 stars 0 forks source link

chore: presence-based game synchronization #2

Open DoodlesEpic opened 1 year ago

DoodlesEpic commented 1 year ago

Current game synchronization is done purely through Supabase Realtime Postgres, this has the issue of introducing latency and creating race conditions in situations where more than one player checks a square at the same time. https://supabase.com/docs/guides/realtime/extensions/postgres-changes

Supabase Presence API could be a good alternative to sync state between clients. With Postgres still being the final source of truth for the game state. Possibly the server would be responsible to persist state to the database and the clients would only be allowed to write data to the presence channel. https://supabase.com/docs/guides/realtime/extensions/presence