Dear developers,
A number of changes have been introduced on the Studio and the BGA Framework since the last newsletter (sent in october). If you missed it, you can find them here : Studio & Framework.
This thread list all changes that have been make on the Studio and the BGA Framework side. We highly recommend you to read it, to know all the added or updated tools that are available. It should make coding of BGA games easier and faster
In green: information about migration, if you want to migrate an old game to the most recent ways
Studio
Dry-run build
To see (and fix) warning without creating a build.
Fix the warnings
Menu
Remove Bounty hunting, replaced by Manage games.
If you want to help fix unmaintained games, please contact Studio support !
Game Metadata Manager
Add a minimum age field, and a button to autofill designer, artist, publication year and minimum age automatically from BGG if they are unset.
Click the new button to fill the new minimum age field.
Manage Game
You can now remove yourself a read-only access from a game from the game’s manage game page, no need to find the game in the Studio Projects list.
Framework
Stats
New typed objects to handle stats, compatible with the State classes : https://en.doc.boardgamearena.com/Main_ ... statistics
Replace initStat / incStat / setStat / getStat by the equivalent in the new objects
DB functions
All DB functions are now public static.
Remove mentions of extends APP_DbObject if you used it to get access to DB functions, and use static call instead
Last turn banner & Win condition banner
As those 2 banners are often shared between games, they have now integrated the framework to make it easy for you to reuse. https://en.doc.boardgamearena.com/Game_ ... js#Banners
Replace custom made banners with the new ones
Namespaced game exceptions
New game exceptions now accept NotificationMessage object in addition to string, to pass args that can be formatted in the error message.
https://en.doc.boardgamearena.com/Main_ ... exceptions
Debug functions can now auto-reload / playUntil
If the debug_ function does not notify the front of the change, you can add the flag #[Debug(reload: true)] above the function so the page auto-reload when you trigger the debug function.
You can also call $this->debug->playUntil to use zombie mode to play automatically until a defined point
https://en.doc.boardgamearena.com/Pract ... _functions
_private args in a public notification
Similarly to the onEnteringState _private flag, you can now use _private in the public notifications. With this new flag, you should not need setIgnoreNotificationCheck on the front side most of the time.
https://en.doc.boardgamearena.com/Main_ ... me_players
Replace private + public notif and ignore by the new system
Player name formatting
player_name/ player_nameX are now automatically formatted even in the title bar (previously, only in the notification logs)
JS Refactor into sub-objects
The Game class now contains multiples sub-objects in this.bga, namely statusBar, sounds, gameArea, playerPanels, images, userPreferences, players, actions, notifications, dialogs
Some functions have been changed a bit, but we kept the old functions (directly on the this) available with the same signature to not break things, so when migrating, check the differences listed in the wiki or the bga-framework.d.ts.
Use the new sub-objects functions
Main JS class as a real class
BGA is now able to load ES classes as main Game class. If a modules/js/Game.js file exists, it will load the exported Game class in it. Note that the class does not extends gameui, so you need to access it through this.bga.gameui (or this.bga.<sub-object name>).
Check https://en.doc.boardgamearena.com/Game_ ... c:_Game.js for more details.
Migrate to modules/js/Game.js and delete the <gamename>.js file.
Reverse scoring
For games that have reverse scoring (lowest value wins), the only solution was to use negative scoring.
You can now tell BGA that the scoring is reverse and use positive scoring : https://en.doc.boardgamearena.com/Main_ ... ie-breaker
Follow the documentation for migration
A number of changes have been introduced on the Studio and the BGA Framework since the last newsletter (sent in october). If you missed it, you can find them here : Studio & Framework.
This thread list all changes that have been make on the Studio and the BGA Framework side. We highly recommend you to read it, to know all the added or updated tools that are available. It should make coding of BGA games easier and faster
Studio
Dry-run build
To see (and fix) warning without creating a build.
Menu
Remove Bounty hunting, replaced by Manage games.
Game Metadata Manager
Add a minimum age field, and a button to autofill designer, artist, publication year and minimum age automatically from BGG if they are unset.
Manage Game
You can now remove yourself a read-only access from a game from the game’s manage game page, no need to find the game in the Studio Projects list.
Framework
Stats
New typed objects to handle stats, compatible with the State classes : https://en.doc.boardgamearena.com/Main_ ... statistics
DB functions
All DB functions are now public static.
Last turn banner & Win condition banner
As those 2 banners are often shared between games, they have now integrated the framework to make it easy for you to reuse. https://en.doc.boardgamearena.com/Game_ ... js#Banners
Namespaced game exceptions
New game exceptions now accept NotificationMessage object in addition to string, to pass args that can be formatted in the error message.
https://en.doc.boardgamearena.com/Main_ ... exceptions
Debug functions can now auto-reload / playUntil
If the debug_ function does not notify the front of the change, you can add the flag #[Debug(reload: true)] above the function so the page auto-reload when you trigger the debug function.
You can also call $this->debug->playUntil to use zombie mode to play automatically until a defined point
https://en.doc.boardgamearena.com/Pract ... _functions
_private args in a public notification
Similarly to the onEnteringState _private flag, you can now use _private in the public notifications. With this new flag, you should not need setIgnoreNotificationCheck on the front side most of the time.
https://en.doc.boardgamearena.com/Main_ ... me_players
Player name formatting
player_name/ player_nameX are now automatically formatted even in the title bar (previously, only in the notification logs)
JS Refactor into sub-objects
The Game class now contains multiples sub-objects in this.bga, namely statusBar, sounds, gameArea, playerPanels, images, userPreferences, players, actions, notifications, dialogs
Some functions have been changed a bit, but we kept the old functions (directly on the this) available with the same signature to not break things, so when migrating, check the differences listed in the wiki or the bga-framework.d.ts.
Main JS class as a real class
BGA is now able to load ES classes as main Game class. If a modules/js/Game.js file exists, it will load the exported Game class in it. Note that the class does not extends gameui, so you need to access it through this.bga.gameui (or this.bga.<sub-object name>).
Check https://en.doc.boardgamearena.com/Game_ ... c:_Game.js for more details.
Reverse scoring
For games that have reverse scoring (lowest value wins), the only solution was to use negative scoring.
You can now tell BGA that the scoring is reverse and use positive scoring : https://en.doc.boardgamearena.com/Main_ ... ie-breaker