
Reddit launches MSPaint MMO - sillysaurus3
https://www.reddit.com/r/place?resubmit=1
======
WheelsAtLarge
HN, what are the mechanics behind this. How does one even start to program
something like this?

~~~
sillysaurus3
When a user clicks on the canvas to place a tile, that click is transmitted to
the server along with an x,y location. The server decides whether the user is
authorized to place the tile.

The canvas exists on the server as an N-by-M array of values. If the user is
authorized to place the tile, this array is modified at the specified x,y
location to the value the user selected.

When the page is first loaded, the server transmits that NxM array of values
to your browser. The browser then builds a canvas element which is essentially
a "viewer" of that NxM array of values.

Presumably the page leverages caching, so that when you reload the page, the
server only re-transmits the parts of the NxM array that have actually changed
since the last time you visited.

Throw in some DoS protection and some realtime updates and you're done.

It's a neat technical achievement with interesting results. Unfortunately HN
doesn't seem to be picking up the story.

~~~
WheelsAtLarge
Good info, thanks.

