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

Studio: Difference between revisions

From Board Game Arena
Jump to navigation Jump to search
m (Add TOC)
(Manually reverting the page)
Tag: Manual revert
 
(25 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Studio_Framework_Navigation}}
{{Studio_Framework_Navigation}}


[[File:Bga_studio_small.jpg]]
[[File:Bga_studio_small.jpg|frameless|300px]]


Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the latest information available.
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the latest information available.
Line 38: Line 38:


After that, we strongly advise you to take one of these game creation tutorials:
After that, we strongly advise you to take one of these game creation tutorials:
* [[Tutorial reversi]] - an abstract strategy game played on an 8×8 uncheckered board for 2 players
* [[Tutorial reversi]] ('''recommended''', closest to the actual BGA implementation and maintained by the BGA team) - an abstract strategy game played on an 8×8 uncheckered board for 2 players
* [[Tutorial gomoku]] - an abstract strategy game tic-tac-toe style for 2 players
* [[Tutorial gomoku]] - an abstract strategy game tic-tac-toe style for 2 players
* [[Tutorial hearts]] - a card game for 4 players
* [[Tutorial hearts]] - a card game for 4 players
Line 47: Line 47:
* [[Create a game in BGA Studio: Complete Walkthrough]]  
* [[Create a game in BGA Studio: Complete Walkthrough]]  


If you have any questions, please check out the '''[[Studio FAQ]]''' first, then if you didn't find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 '''development forum'''].
If you have any questions, please check out the [[Studio FAQ]] or [[Contact BGA Studio]].
 
 
To search wiki pages on studio enter this text in search bar:
  "Category:Studio" white rabbit
That is if you want to search for white rabbit


== BGA Studio documentation ==
== BGA Studio documentation ==
Line 77: Line 82:


* [[Translations]] (how to make your game translatable)
* [[Translations]] (how to make your game translatable)
* [[Game options and preferences: gameoptions.inc.php]]
* [[Options_and_preferences:_gameoptions.json,_gamepreferences.json|Game Options and Preferences]]
* [[Game meta-information: gameinfos.inc.php]]
* [[Game meta-information: gameinfos.inc.php]]
* [[Game replay]]
* [[Game replay]]
* [[3D]]
* [[3D]]


=== BGA Studio game components reference ===
=== BGA Studio game components reference ===
Line 95: Line 99:
* [[Draggable]]: a JS component to manage drag'n'drop actions.
* [[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.
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.
* [[Anti-Stock]]:Code snippets in ValinaJS/HTML5 to do what stock does (that is if you cannot beat Stock into submission)
* [[Anti-Stock]]: Code snippets in vanilla JS/HTML5 to do what stock does (that is if you cannot beat Stock into submission)


PHP:
PHP:
Line 118: Line 122:
Tools and Advice
Tools and Advice
* [[BGA Studio Guidelines]]
* [[BGA Studio Guidelines]]
* [[Tutorials checklist]]
* [[I wish I knew this when I started]] - one liners on most common missed features, mistakes, etc with further doc references
* [[I wish I knew this when I started]] - one liners on most common missed features, mistakes, etc with further doc references
* [[Tools and tips of BGA Studio]] - Tips and instructions on setting up development environment
* [[Tools and tips of BGA Studio]] - Tips and instructions on setting up development environment
** [[Setting up BGA Development environment using VSCode]]
** [[Practical debugging]] - Tips focused on debugging
** [[Practical debugging]] - Tips focused on debugging
** [[Testing by developer]]
** [[Studio logs]] - Instructions for log access
** [[Studio logs]] - Instructions for log access
** [[Troubleshooting]] - Most common "I am really stuck" situations
** [[Troubleshooting]] - Most common "I am really stuck" situations
Line 126: Line 133:
** [[Using Vue]] - work-in-progress guide on using the modern framework Vue.js to create a game
** [[Using Vue]] - work-in-progress guide on using the modern framework Vue.js to create a game
** [[Using Typescript and Scss]] - How to auto-build Typescript and SCSS files to make your code cleaner
** [[Using Typescript and Scss]] - How to auto-build Typescript and SCSS files to make your code cleaner
** [[BGA Type Safe Template]] - Setting up a fully typed project using typescript and more!
** [[Bots and Artificial Intelligence]] - How to add AI/Bots to the game
** [[Bots and Artificial Intelligence]] - How to add AI/Bots to the game
* [[Studio FAQ]]
* [[Studio FAQ]]
Line 132: Line 140:
* [[Common board game elements image resources]] - Dice, meeples, cubes, etc
* [[Common board game elements image resources]] - Dice, meeples, cubes, etc
* [[BGA Code Sharing]] - Shared resources, projects on git hub, common code, other links
* [[BGA Code Sharing]] - Shared resources, projects on git hub, common code, other links
== Software Versions ==
Versions currently used by BGA framework:
* Dojo Toolkit 1.15
* PHP: 8.2
* SQL: MySQL 5.7
* JS/CSS/HTML: limited by what minimization tools support: [[Game_interface_logic:_yourgamename.js#Javascript_minimization_.28after_July_2020.29|JS minimization]]
* Font Awesome: 4.7 https://fontawesome.com/v4.7/icons/ (available as <code><nowiki><i class="fa fa-clock" /></nowiki></code>)
* Font Awesome: 6.4.0 https://fontawesome.com/v6/search?o=r&m=free (available as <code><nowiki><i class="fa6 fa6-clock" /></nowiki></code>)
=== PHP Extensions Used ===
The following PHP extensions are - as of May 8th, 2022 - in use in BGA Studio and available:
date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, json, exif, msgpack, mysqli, pdo_mysql, apc, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, v8js, xmlreader, xmlwriter, xsl, zip, Phar, memcached, Zend OPcache


== Other resources ==
== Other resources ==
Line 145: Line 170:
[[Contact BGA Studio]]
[[Contact BGA Studio]]


== Software Versions ==


Versions currently used by BGA framework:


* Dojo Toolkit 1.15
[[Category:Studio]]
* PHP: 7.4
* SQL: MySQL 5.7
* JS/CSS/HTML: limited by what minimization tools support [[Game_interface_logic:_yourgamename.js#Javascript_minimization_.28after_July_2020.29]]
* Font Awesome: 4.7 https://fontawesome.com/v4.7/icons/

Latest revision as of 06:24, 17 October 2024


Game File Reference



Useful Components

Official

  • 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.

Unofficial



Game Development Process



Guides for Common Topics



Miscellaneous Resources

Bga studio small.jpg

Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the latest information available.

What is Board Game Arena Studio?

Board Game Arena Studio is a platform to build online board game adaptations using the Board Game Arena platform.

It is open to any gamer with software development skills :)

BGA Studio website: https://studio.boardgamearena.com

Original announcement on BGA forum: https://forum.boardgamearena.com/viewtopic.php?f=10&t=1973

Discover BGA Studio in 5 presentations

Why, how, what... to start discovering BGA Studio, we prepared 5 "powerpoint" presentations for you:

How to join the BGA developer team?

Please see this page: How to join BGA developer team?

Great, I'm in! ... How should I start?

If you didn't already, check the presentations at the top of this page to get the basics.

Then, you should checkout the First steps with BGA Studio to make sure that runs fine.

After that, we strongly advise you to take one of these game creation tutorials:

  • Tutorial reversi (recommended, closest to the actual BGA implementation and maintained by the BGA team) - an abstract strategy game played on an 8×8 uncheckered board for 2 players
  • Tutorial gomoku - an abstract strategy game tic-tac-toe style for 2 players
  • Tutorial hearts - a card game for 4 players

Then start editing files and see what happens! ;)

Once you're done with tutorials, you can start a real game (or join existing project)

If you have any questions, please check out the Studio FAQ or Contact BGA Studio.


To search wiki pages on studio enter this text in search bar:

 "Category:Studio" white rabbit 

That is if you want to search for white rabbit

BGA Studio documentation

BGA Studio Framework reference

This part of the documentation focuses on the development framework itself: functions and methods available to build your game.

File structure of a BGA game

Game logic (Server side)

Game interface (Client side)

Other components

BGA Studio game components reference

Game components are useful tools you can use in your game adaptations.

JS:

  • 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).
  • 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.
  • Anti-Stock: Code snippets in vanilla JS/HTML5 to do what stock does (that is if you cannot beat Stock into submission)

PHP:

  • Deck: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).

Reference for classes in game class hierarchy

  • Table: a PHP class that you inherit from for the game php

BGA Studio user guide

This part of the documentation is a user guide for the BGA Studio online development environment.

Lifecycle


Tools and Advice

Sharing

Software Versions

Versions currently used by BGA framework:

PHP Extensions Used

The following PHP extensions are - as of May 8th, 2022 - in use in BGA Studio and available:

date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, sodium, apache2handler, mysqlnd, PDO, xml, apcu, bz2, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, json, exif, msgpack, mysqli, pdo_mysql, apc, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, v8js, xmlreader, xmlwriter, xsl, zip, Phar, memcached, Zend OPcache

Other resources

Development forum

Bug tracking system FOR STUDIO issues and APIs

DISCORD chat server/room invite link https://discord.gg/YxEUacY if it does not work check this topic https://forum.boardgamearena.com/viewtopic.php?f=12&t=17403&hilit=discord

Developer BLOGS https://bga-devs.github.io/blog/

Contact BGA Studio