1j01 / jspaint

🎨 Classic MS Paint, REVIVED + ✨Extras
https://jspaint.app/about
MIT License
7.29k stars 575 forks source link

Better Collaborative Editing #117

Open Immortalin opened 6 years ago

Immortalin commented 6 years ago

Operational transforms or Conflict-free Replicated Data Structures (CRDTs) would be good methods.

1j01 commented 6 years ago

Hi, so, jspaint already has a collaborative editing mode, but it's pretty garbage. It just syncs the image as a whole and so everyone gets interrupted all the time. (I did try to implement something a little smarter where if you received an update while you were drawing something it would try to replay the current operation on top of the updated image, but I couldn't get that working for some reason.)

From the README:

  • Rudimentary multi-user support. Start up a session at jspaint.ml/#session:multi-user-test and send the link to your friends! It isn't seamless; actions by other users interrupt what you're doing, and visa versa. Sessions are not private, and you may lose your work at any time. If you want better collaboration support, follow the development of Mopaint.

So yes, those methods (OT or CRDT) would be much better. I plan on implementing good multi-user support in Mopaint. (It could then be backported to jspaint.)

If anyone's interested in pair programming on this with me, let me know, I think it could be fun :)

Immortalin commented 6 years ago

I think your editing method is a rudimentary form of OT

1j01 commented 6 years ago

Heh, I suppose it is supposed to transform operations (in one particular way) (except it doesn't work) :) I'm not sure it could be classified as that, but I don't know of any formal definitions of it... I don't know how rudimentary you're allowed to go, it'd have to be pretty rudimentary :P

Immortalin commented 6 years ago

I will take you up on the peer programming offer :D

1j01 commented 6 years ago

Okay, email me and I'll send you a link to video chat with appear.in, or you can suggest another platform in your message (Skype, Discord, etc.). The project's not yet at the point where it makes sense to start adding collaboration support, but we could do a preliminary chat and talk about where the project's going and how stuff is going to work. isaiahodhner@gmail.com