This is a documentation for Board Game Arena: play board games online !

Studio file reference

From Board Game Arena
Revision as of 19:18, 25 October 2020 by Victoria La (talk | contribs)
Jump to navigation Jump to search

Game File Reference

Useful Components


  • Deck: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).
  • Draggable: a JS component to manage drag'n'drop actions.
  • Counter: a JS component to manage a counter that can increase/decrease (ex: player's score).
  • ExpandableSection: a JS component to manage a rectangular block of HTML than can be displayed/hidden.
  • Scrollmap: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples: Saboteur or Takenoko games).
  • Stock: a JS component to manage and display a set of game elements displayed at a position.
  • Zone: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token's places at Can't Stop).

Undocumented component (if somebody knows please help with docs)

  • Wrapper: a JS component to wrap a <div> element around its child, even if these elements are absolute positioned.


Game Development Process

Guides for Common Topics

Miscellaneous Resources

This is a quick reference for the files used to implement a game. For more information, follow the wiki links.

software versions

Versions currently used by BGA framework (as of May 2020):

  • Dojo Toolkit 1.15
  • PHP version: 7.2.12
  • SDL: unknown? /fix me/
  • JS/CSS/HTML: limited by what minimization tools support, see.../add link here/


This directory contains the images for your game (the game art).

See Game art: img directory

In this file you describe the meta-information for your game: game name, publisher name, number of player, game categories, etc...



File for creating specific database tables that you will need to persist data during the game (for example a table for cards).

See Game database model: dbmodel.sql

File for describing your game options (or game variants).

See Game options and preferences:


File used to describe methods that can be called from the client interface through javascript, get parameters and call the appropriate game functions.

See Players actions: yourgamename.action.php.


CSS styles specific to your game.

See Game interface stylesheet: yourgamename.css.


This is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify changes to the client interface.

See Main game logic:


This is the main file for your game interface. Here you will define:

  • which actions on the page will generate calls to the server
  • what happens when you get a notification for change from the server and how it will show in the browser.

See Game interface logic: yourgamename.js.

<gamename>.view.php and <gamename>_<gamename>.tpl

Files used to set up the page layout ('view') for the game.

See Game layout: view and template: yourgamename.view.php and yourgamename yourgamename.tpl.

File used to describe all the game material (cards with their description, dices, tokens...). You can also use it to define game constants.

See Game material description:

This file describes the game states machine of your game (all the game states properties, and the transitions to get from one state to another).

See Your game state machine:

File used to list statistics that you want to update during the game to be presented to players at the end of the game.

See Game statistics:


Don't edit this file. It is used internally by the build system.


Modules directory can contain additional php files which can be included in main game.php via include or require. It also can contain addition js files. This directory is checked in version control.


Directory containing files you would like to keep with project but not needed on production server. This directory is checked in version control. Total limit is 1 Mb for this directory.

<other files>

You can use other files but they won't be checked in source control and published in production. That includes any additional .js or .php files. If you need them use modules/ directory.