Definition files

Gameplay definitions are hosted under data/<gameplayName>/definition.js. This file must be a node.js module: it means that it must return a javascript object. These two structures are valid:

module.exports = {

  element: "value",
  another: "bar"

module.exports = function() {

  this.element = "value";
  this.another = "bar";


This file is the entry point of your gameplay definition: you can create many javascript files in the gameplay directory if you need it! There is no restriction of size or compute time.


You must provide valid keys in your definition file: it will be parsed at startup and invalid files will be rejected.

You can view a list of checked keys here.

Mandatory keys



The name of the gameplay. It will be displayed in room properties.



The minimum/default number of players per room.




function (room, callback) {}

Called when the start command is emitted by the room creator. The callback must be called with null to confirm the room start. If callback is called with another value, a message would be printed in game chat.

Optional keys



The current version of this gameplay.



The required version of OpenParty. Must be in semver format.




A short description of the gameplay, displayed in room list.



An object containing all available stages for this gameplay. This object can be dynamically updated by your gameplay. A stage is just a period of time and contains only two functions: start and end.

The key used to define a stage is saved in room.currentStage variable, and a room is always in a specific stage.


function (room, cb) {}

Called by the engine when a stage is started. cb must be called with two parameters: the first one is an error indicator, and the second is the duration of the stage (seconds). A duration can be -1 for infinite.


function (room) {}

Called when a stage ends.

Example of stages object

stages: {
  "default": {
    start: function(room, cb) {
        cb(null, 5);
    end: function(room) {}


The first stage to start.



You can include custom css files in the web browser. Just place your css files in a data/<gameplayName>/css folder and specify their names in the css array.

css: ["file1.css", "file2.css"]


Used to define specific parameters for room. Players can interract with these parameters to customize their gameplay experience.


This feature is currently in development.

Example of parameter:

  name: "The name of the parameter",
  type: Number, // the type
  value: 1,     // default value
  help: "An help text for this parameter"

function (room) {}

Called just after room creation.


function (channel, message, player) {}

Called for each message sent by players.

You must return the message to broadcast it, modified or not. Return false to ignore the message.


function (room, player) {}


function (room, player) {}



After a disconnection, a player has this delay (in second) to reconnect. Use -1 to disable reconnection. Defaults to one minute.



An array of Sound objects to be preloaded automatically at start. Please provide only tiny sounds to avoid large bandwidth usage.