dndplayer / dnd-player

An online virtual DND playground to support online groups.
https://dnd-player.com
Other
1 stars 0 forks source link

Implement a very basic shared whiteboard using the realtime database (firestore) bits #3

Closed chrisella closed 5 years ago

chrisella commented 5 years ago

Initially concentrate on displaying images on the whiteboard I.E. Maps etc.

The whiteboard should be an infinite canvas (if possible, it should be).

Storing the data for the whiteboard images should be fairly easy as it will just be details of images and their locations, scales, rotations etc.

While it would be easy to roll our own "map format" in JSON and store a whole map like that e.g. { "images": [], "drawing": [] } This would mean that updates would presumably push the whole map to the clients.

A better approach is probably to have separate collections per object type e.g. drawings, images and then these have a field that links them to the current "map" then it should be easy to sync and subscribe to those collections with a Query filter on the map reference to only get updates that pertain to this map.

Drawing can come later once the basics and images are working. How we store this draw data is something I'm not sure on. Traditionally with collab whiteboards, I think you store all the raw inputs, but over time that is going to amount to huge amounts of iterative data (potentially).