API Update: Sheet Worker, Speed, and NodeJS v7.x

March 22, 2017
roll20

Put on your coding caps...

On Monday we rolled out several exciting new changes to the API Server. These changes include new features requested by sheet and script authors, speed upgrades, and general upgrades to the underlying NodeJS engine enabling new code features for script authors to use.

Sheet Worker Support for the API

The largest ‘new’ feature is the addition of Sheet Worker support for the API server. Several script authors requested that we add this feature to save time on their end so that they can re-use the same sheet worker code that already exists for character sheets on the API. That means that, for example, if your character sheet automatically calculates the Dex Modifier of your character based on the Dexterity, when the API sets the Dexterity the modifier will get calculated as well. Previously the API author would need to write API-specific code to make that happen which lead to many API scripts not interacting well with complicated character sheets.

We also worked with specific API script authors to make sure that this new piece of functionality works well in large games and those using very complicated sheets. (For some specific documentation, check out this forum post.)

Speed Improvements

We made several adjustments to the underlying API code so that findObjs() calls (among others) are as fast as possible. This should provide an overall speedup for all existing API scripts without any extra effort necessary on the part of the script authors. At this point the API is as fast as the average web client in performing most actions such as updating sheets, creating tokens, and more.

Upgrade to NodeJS v7.x

Finally, we upgraded the version of NodeJS that the API sandbox uses to the latest version. This is the core engine that powers API scripts, and by upgrading it we can provide the latest in Javascript coding techniques for script authors to use. There are no backward-incompatible changes produced by this upgrade for functionality that API scripts had access to, so existing scripts will continue to work fine. For more information on these specific features, you can check out http://node.green (we’re now on the 7.7x series).

Thanks to everyone who beta-tested these new features on the Dev server over the past couple months!

The Roll20 Team

The Roll20 Team

ROLL20 Roll20 is the all-in-one solution for organizing and playing tabletop games online, allowing you to play your games anywhere and share them with anyone virtually. With the ability to choose from a number of popular titles built ready for your virtual tabletop, your adventures are limitless and you can get started playing with little to no prep. Dive into advanced features like Dynamic Lighting or explore macros and APIs to add some extra depth to your game. Roll20 lets you play your tabletop games, your way. YouTube Instagram