I have been building a card game web app with firebase. Because firestore charges by number of reads/writes, I have only been updating the opponents of your plays when you place a card, so other players just see a card you moved pop into its new position -- one write, one read.
I momentarily tested updating the other players whenever you are moving a card, such that they can see you moving cards around in real time, not only the final result when you place it in a new location. This results in hundreds of writes/reads per second as the onMouseMove event fires continuously.
This is too expensive to leave, so I undid it. But I'm disappointed and I feel there must be a better way, but I am too new to this to know what it is.
How can I affordably transmit very large amounts of update events between players?
To give an idea: assume 1000 games per day, each could invoke 500k to 1million move events (each card drag fires off hundreds, and there are up to 6 players!), so I would be transmitting a billion or more small pieces of information per day. The numbers sound large but this is just for a moderately successful small web game and pretty realistic. A lot of webgames handle this kind of traffic daily no problem.
How is it done affordably?
pickup
anddrop
... wherecard
andzone
are arguments. When a card is "picked up", other clients can animate the card lifting off the table. When it's "dropped", just animate an arc from the pickup zone to the drop zone and perform the game logic. If exact coordinate matter in the drop zone, send them with thedrop
event.