Giter Site home page Giter Site logo

playsketch's Introduction

PlaySketch: a collaborative sketching tool

PlaySketch is an informal web-based sketching tool that targets video game designers. Featureing real-time collaboration, it allows teams of users to collaborate on the same sketch, or a single user to work across multiple devices.

This web-based app is the result of an individual research project I undertook in the Singapore Management University, and supervised by Dr. Richard C. Davis. This page summarises my findings and functionalities of the PlaySketch prototype implemented to demonstrate the application of Operational Transformation as the underlying real-time technology in collaborative sketching on HTML5 Canvas.

The full research paper on this project is available here.

Operational Transformation

Pioneered by Ellis and Gibbs in 1989, Operational Transformation (OT) is currently the most extensively used concurrency control technology used in modern web-based collaborative tools (e.g. Google Docs, Trello). Early implementations of OT algorithms focused on solving concurrency and consistency issues in text editing groupware systems, with an example of one such issue diagrammed below:

text concurrency issue

The concurrency issue here occurs when the operation “Del 6” is propagated from Person 1 to Person 2's text editor. Because Person 2 has already removed the third character from the string in operation “Del 3”, “Del 6” cannot be achieved as there are now only five characters left. OT algorithms introduce the concept of transforming any concurrent incoming operation from other sites against the operation that has been executed locally.

resolved text concurrency

OT can be implemented in client-server protocols that support collaboration between any number of clients. The state space diagram below shows all possible traversals of client and server operations. The document state is represented by a tuple of numbered client (left integer) and server (right integer) operations.

resolved text concurrency

Prototyping with Node.js, ShareJS and Fabric.js

My research highlighted the ShareJS OT library implemented in Node.js as a promising toolkit to test OT in HTML5 web apps due to the library's support operations on arbitrary JSON documents. Combined with Fabric.js, a HTML5 Canvas JavaScript library using JSON documents to represent sketches and shapes, following client-server architecture was used to develop the PlaySketch prototype:

PlaySketch architecture

Try the PlaySketch prototype here. The app is compatible on Chrome or Firefox browsers, as well as mobile browsers. The default mode in PlaySketch is "drawing mode", with strokes captured on the sketchpad by mouse or touch (on mobile devices). Sketch and shape manipulations (e.g. object/group selections, move, scale, skey) are enabled by cancelling "drawing mode". Operations resulting from manipulations are captured by comparing previous and current object states, before being propagated and transformed. Users can collaborate on sketches by sharing the URL including the hash ID from address bar.

PlaySketch prototype

Clone and run PlaySketch

  1. git clone https://github.com/andrewbeng89/playsketch.git
  2. npm install
  3. Run with node app
  4. Open Chrome or Firefox to http://localhost:3000

playsketch's People

Contributors

andrewbeng89 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.