Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Redesigning the API Layer

Hi all I don't know if anybody else has come forward with this idea, but I would like to propose a new, and semantically rich set of APIs for roll20. I believe that it would be a great boon to the community to design APIs tailored to specific game systems. It has already started, with being able to choose a certain character sheet for a game in question and I think it should be taken much further. Let me outline my reasoning. If you take, for example, the Pathfinder character sheet you will notice, that it is subject to frequent, fundamental changes, that break compatibility with other scripts, trying to import data into it. The reason is, that the sheet data is not encapsulated, but instead each script that depends on the sheet is tightly coupled to it. If the sheet changes, the script breaks. If the underlying Pathfinder game mechanics were decoupled from the user interface and from any scripts manipulating game data, a much higher level of maintainability could be achieved. And depending on the depth of the rule engine implementation, it would be pretty simple to boot. Changes to the core Pathfinder game system are very rare as well, so a solid core design would likely carry over many years. A simple example could be, that a character object would be outfitted with a semantically rich API. The object would have abilities, skills, feats, weapons, armor and so on. Of course each of these would be typed objects according to the particular game rules.  An import or any other script could easily access these values as they would be standardized. For example, a Hero Lab bridge would be able to set these, and a separate in-play UI script would show the values and let the player roll dice, or apply conditions or whatever. You would not need a script that does both and the two scripts would be decoupled through the system API intermediary. There would be a great many possibilities to enhance the tactical view on the game through game specific scripts, that would be robust and long lived. And since these scripts would have to do a whole lot less, they would be more easy to develop and be more maintainable. Roll20 functionality is primarily used as a tactical view on the game. In a first step, it would not need to understand the rules, just display stat block values and let the players decide. If the core design is solid, certain game mechanics could be added incrementally.  And yes, I would not recommend to make the Hero Lab mistake and create a meta game system that fits all game systems that ever will be, and is so totally generic that it's performance must suffer. After all, this is JS on the browser, so certain restrictions apply. Looking forward to your comments. Would this be possible? Has it been discussed before? 
1439153797

Edited 1439171882
Gen Kitty
Forum Champion
For your suggestions, we offer the Suggestions & Ideas forum, which is based on voting from the whole community.  Please review our Forum Voting wiki page for more information on how voting works, and our Suggestions & Ideas Posting Guidelines for the added expectations above and beyond our standard Code of Conduct . Discussions of how to make the existing code base sit up and do tricks for you, however, is quite on-topic.
1439171691
The Aaron
Pro
API Scripter
As a general purpose programming language, JavaScript already allows everything you have outlined. You can very easily construct a Pathfinder master object that allows you to wrap Roll20 Character objects in a Pathfinder Object. You can use that master object to construct a domain specific language describing the rules of Pathfinder which can then be used to build other Pathfinder scripts succinctly. That master object can encapsulate reading and writing the character sheet so that changes to the sheet only require updates in a single location. Roll20 has stated before that they will chose to support generalized game mechanics, so creating a game specific API for you is unlikely to happen, but you could make a suggestion for that if you like.   However, a community of Pathfinder API scripters could do the above and you'd have all the benefits you want, as well as control over the functionality. If you want to pursue it, I'd be happy to talk about specifics and help you come up with a design. 
Aaron, thanks for the support. I have reposted my idea to the Suggestion & Ideas forum and am looking forward to your vote and further discussion there: <a href="https://app.roll20.net/forum/post/2283417/standard" rel="nofollow">https://app.roll20.net/forum/post/2283417/standard</a>... I agree with all of your points, except that a community effort would be mute without standardization within the product.
1439217993
The Aaron
Pro
API Scripter
Someone would need to provide that standardization by organizing the design and getting buy-in from the community developers.