dungeon-revealer icon indicating copy to clipboard operation
dungeon-revealer copied to clipboard

improve performance of map updates

Open n1ru4l opened this issue 4 years ago • 1 comments

currently, we are sending the whole fog of war image as a png. The HTTP request payload could become pretty big for larger files. It makes sense to try out strategies for reducing the body size that must be uploaded from the dm and sent to the players.

n1ru4l avatar May 26 '20 15:05 n1ru4l

One idea I have floating around in my head is sending draw instructions along side a version directly to the backend and the players. Of course we cannot store every single draw operation, as we would have to apply all of those in order to get the current fog state when loading the image for the first time. In order to make The initial load faster we could run a server-side canvas implementation (node-cairo) that also processes the draw instructions sent by the DM. Then when a map is first requested we can sent the image state from the server-side canvas. In case the client and Server-side state become out of sync the client can also request the computed state (canvas image) for being back in sync.

n1ru4l avatar Jul 23 '20 05:07 n1ru4l