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

I wish I knew this when I started

From Board Game Arena
Revision as of 20:49, 30 March 2021 by Docthib (talk | contribs)
Jump to navigation Jump to search

This page contains most "I wish I knew this before..." momentics (in regards to BGA studio game development). One line per statement please with doc references. Docs can be outside of BGA wiki. Can you add your name at the end of "quote".

  • Browser caches images and css, to force re-cache use Ctrl+F5 or Ctrl+Shift+R, and sometimes it's not enough so go to the web console > Network > check "disable cache"
  • Browser has powerful embeded dev tools for inspection of dom, css and js, you can debug js right in browser (F12)
  • You don't have to login with another dev account to play test the game under development, little colored arrows on studio player panel switch between test accounts
  • You can run PHP functions from chat
  • You change style of elements (css) depending on their parent, sibling or other properties of the element
  • You cannot save php state in global variables between actions, all data has to be stored in db
  • Ajax actions in BGA do not use the traditional request-response model of a normal application. The ajax response does not contain any payload and instead you must send a notification (self::notifyAllPlayers) to communicate the response to appropriate players.
  • Almost every change you make to the game via sending notifications must also be included in getAllDatas (e.g., in case a player loads/refreshes the game during the middle of play).
  • You can easily scale elements by using "em" as unit for wight/height and varying font-size, i.e. .meeple {width: 2em;height: 2.5em;font-size: 20px;}
  • You can access your javascript methods / properties in the browser console using gameui.<yourMethod>