p5.party is a library for easily creating multiuser sketches with p5.js. With p5.party you can quickly prototype ideas for multiplayer games, realtime multiuser apps, and multi-computer art projects.
Prototyping + Sketching
p5.party provides a simple, imperative interface for working with shared data inspired by the programming conventions used by the p5.js api. p5.party let's you try ideas quickly without writing server code or setting up a front-end/back-end stack.
Workshops + Classes
p5.party uses a deepstream.io server which is easy to set up and cheap—or free—to run. Multiple sketches and projects can connect to the same p5.party server, so students can focus on sketching instead of setting up servers.
Turn Based Games and Apps
Quickly get people connected and playing together. Try out ideas using many of your existing skills in p5.js.
Production
p5.party is designed for prototypes. As your project grows, you'll need to look into other libraries and backends that suit your project's needs.
Security
Sketches built with p5.party are insecure. p5.party has no method to authenticate or authorize users. Multiple apps share a server and can read, write, and delete each other's data.
Fast-Action
Fast-action multiplayer games are inherently complex. Compensating for network latency requires prediction and reconciliation strategies which are somewhat application specific and outside the scope of p5.party.
Shared Data Objects
With p5.party you can easily create a shared data object that is automatically synchronized between instances of your sketch. You can write to and read from these objects just like local variables.
Multiple Apps and Rooms
A single p5.party server can support many apps and each app can group users into rooms. p5.party keeps track of which clients are in each room and shares the data to the right clients.
Client-side Hosting
p5.party automatically designates one (and only one) guest in each room as the host. Your code can easily check if it is the host and take care of running the party. This lets you avoid writing server-side code and makes prototyping faster.
p5.party builds on deepstream.io and sindresorhus/on-change. Deepstream is a realtime data-sync server that can be easily self hosted on services like heroku or aws. p5.party uses Deepstream to communicate between connected clients. on-change uses javascript proxies to make a fully observable object. p5.party uses on-change to watch for changes to shared data objects and then communicates these changes to deepstream.
Download the latest build of p5.party and the example apps from the releases page on Github. For details getting started see the Hello, p5.party! tutorial.
You can set up a server in a few minutes using Heroku and a clone of the p5.party repo.
Distributed under the MIT License. See license for more information.
p5.party was created by Justin Bakse, Munro Hoberman, and Isabel Anguera.