This is a documentation for Board Game Arena: play board games online !
Game art: img directory
- Main game logic: yourgamename.game.php
- Your game state machine: states.inc.php
- Game database model: dbmodel.sql
- Players actions: yourgamename.action.php
- Game material description: material.inc.php
- Game statistics: stats.inc.php
- Game interface logic: yourgamename.js
- Game art: img directory
- Game interface stylesheet: yourgamename.css
- Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl
- Your game mobile version
- Translations (how to make your game translatable)
- Game options and preferences: gameoptions.inc.php
- Game meta-information: gameinfos.inc.php
- Game replay
- 3D
- Some usual board game elements image ressources
- Deck: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).
- Counter: a JS component to manage a counter that can increase/decrease (ex: player's score).
- 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)
- Draggable: a JS component to manage drag'n'drop actions.
- ExpandableSection: a JS component to manage a rectangular block of HTML than can be displayed/hidden.
- Wrapper: a JS component to wrap a <div> element around its child, even if these elements are absolute positioned.
- BGA game Lifecycle
- First steps with BGA Studio
- Tutorial reversi
- Tutorial gomoku
- Tutorial hearts
- Create a game in BGA Studio: Complete Walkthrough
- Tools and tips of BGA Studio - Tips and instructions on setting up development environment
- Practical debugging - Tips focused on debugging
- Studio logs - Instructions for log access
- BGA Studio Cookbook - Tips and instructions on using API's, libraries and frameworks
- BGA Studio Guidelines
- Troubleshooting - Most common "I am really stuck" situations
- Studio FAQ
- Pre-release checklist - Go throught this list if you think you done development
- Post-release phase
- BGA Code Sharing - Shared resources, projects on git hub, common code, other links
Requested images
The following images are requested by BGA:
- game_box.png
- It is displayed on the main site on the game description page and when creating a table (280x280 px).
- It should be a 3D image of a physical copy of the game box as it appears in an online shop.
- It is better to take the version of the game that is coherent with the game art used in the adaptation, and from the original publisher of the game.
- The background of the image must be transparent.
- If you don't have a 3D version of the game box, you can use the following website to create one: http://www.3d-pack.com/
- game_box180.png
- game_box75.png
- Don't modify these images, they are auto generated by "Reload game box image" action. If you have another copy of your source make sure you update you copy of these files after they have been generated and not override with old copied.
- game_icon.png
- It is the icon displayed in the lists of games and tables (50x50 px).
- The objective of this icon is to make the game recognizable among the other games. A good idea is to take a part of the game cover that is distinctive (ex: the game title).
- This one does not have to be transparent. This image should not have a border
- publisher.png
- It is the logo of the publisher of the game, displayed on the game description page.
- The width must be 150 px. The height can be anything (reasonable). The image could be transparent.
- publisher2.png (optional)
- If the game has been co-published by 2 publishers, you should upload a second image named "publisher2.png" (same characteristics as the first one).
- game_banner.jpg
- size 1386x400px
- should not contain any text; representative of the atmosphere of the game such as a cover element or communication image; the box image covering the banner on the left should stand out
- game_displayX.jpg (X an integer between 0 and 9)
- height between 400px and 760px, width maximum 1.5 x height;
- the idea is to make players want to play the game, so it could be a zoomed card, some detail of the board, an overview of an ongoing physical game... but NOT a screenshot of the BGA adaptation since there is already the "see game in action" replay for that
Important: when you modify these images, you MUST click on "Reload game box image" from the Control Panel in order your update can be taken into account.
Game art
You must upload in img directory all images of your game interface.
Images naming constraints
To be correctly deployed your images file names should not contain spaces or parenthesis.
Images loading
Be careful: by default, ALL images of your img directory are loaded on a player's browser when he loads the game. For this reason, don't let in your img directory images that are not useful, otherwise it's going to slowdown the game load.
Note that you can tune the way images are loaded with Javascript method "dontPreloadImage" (see Game Interface Logic).
General recommendation it to have no more than dozen of image files, 2Mb max each. However if there is heavy game resources specific to a player (i.e. player board of specific color or set of cards) it is better to separate them and "don't pre-load" since in any given game only some of them will be used.
Images format
You can use these image formats while building your game interface:
- jpg images
should be used for non-transparent images. Jpg are usually lighter than Pngs, so please choose Jpg for big pictures (ex: game board, cards) when you don't need transparency to accelerate game load. You don't need transparency for rounded card corners, it can be done using css.
- png images
should be used for images with transparency, such as non-square tokens, meeples, etc (combined into sprite).
- gif images
can be used for animated images. This is not recommended to use gif animated images as they can upset players, but for some specific interface element this could be useful.
- svg images
svg images can be really efficient for icons or abstract images
Use background-size
In order to allow for players to use the browser zoom without your images becoming pixelated, it's recommended to use higher resolution images than needed for the normal display of your interface, and to use the css property background-size to fit the image to the size you need for your interface.
Use CSS Sprites
To limit the number of images load and make the game load faster, you must use CSS sprites, i.e. you must gather several images in a single one. However, there are limitations. Do not make any CSS image sprite with dimensions that exceed 4096x4096 pixels or it will not work on mobile devices (Android max texture size is 4096 pixels, test your own browser at WebGL Report).
To learn more on CSS Sprites:
Important: the maximum image size should be 4096x4096 (otherwise, some devices may not display parts of the image, see https://stackoverflow.com/questions/34682482/what-is-the-maximum-sprite-sheet-size-i-can-use-for-android-devices)
Shrink images
If you get high resolution images from publisher you need to shrink them since web display requires much lower resolution than printing.
- Shrink images without loss of quality https://tinypng.com/ or http://www.iloveimg.com/
Image Manipulation Tools
You have no choice but to use one of the image manipulating tools to create a successful game adaptation, you would have to deal with
- Converting to supported formats
- Adding transparency
- Stitching
- Shrinking with no quality loss
- Resizing
For that you need a good tools, recommended tools (if you know more add them here)
- Gimp (linux) - general GUI image editor
- Paint.net (Windows) - general GUI image editor
- ImageMagic (All platforms) - https://www.imagemagick.org/script/download.php - command line image editor, great for mass manipulations and scripting