Git Product home page Git Product logo

Comments (4)

skizzerz avatar skizzerz commented on June 13, 2024

First let me get something out of the way: I can't look at any of roll20's source code because it's copyrighted and attempting to incorporate it (even by just looking at what it does and coding my own version) would be copyright infringement. That said, a large set of this library's features were inspired by reading over the roll20 dice reference.

There are a handful of things that roll20 supports which this library currently does not support or acts differently on:

  • Target numbers in roll20 such as 1d20cs>19 say "mark this as a critical success if the die is greater than or equal to 19". My library (and some of the linked ones) require using 1d20cs>=19 for this instead. I assume roll20 chose their method because it was a bit less typing, but it isn't something I can easily do in my library without breaking backwards compatibility. Transforming into the syntax recognized by this library would be a simple string replace on > or < to >= and <= respectively.
  • Inline labels are not supported (1d6[Slashing Damage]). I use the [] syntax for macros instead. Because of this I don't believe I can use the same syntax for labels, if I were to add such a feature.
  • Roll queries are not supported (?{Prompt} and ?{Prompt|default}). I see a way to make this supported in a more general fashion, but nobody has asked for it yet.
  • Penetrating dice rolls in my library follow the HackMaster 5e rules correctly, unlike roll20's implementation. (I've been a HackMaster GM for a number of years so that's been a particular pain point for me when running those games on roll20...). The roll20 implementation is also supported for other systems which may not use HackMaster's special rules regarding die size reduction on penetrating rolls via the explicit comparison syntax.
  • Roll options are not supported (&{tracker} and &{template:...}). I have no plans to add such a feature. This is the job of the application consuming the library, not the library itself. It can grab a programmatic representation of the roll result to display as it needs to for whatever situation.
  • Exponentiation and modulus are not supported, mostly because nobody ever asked for them yet.
  • Roll20's version of abilities and macros is incompatible with my version of macros (their abilities/macros wrap around entire text blocks, including rolls and whatever, whereas my macros are meant to provide values for small bits of rolls)
  • Attributes are not supported (@{attribute}). My macro syntax is the intended replacement, and is more powerful/flexible in that it can take parameters specified in the roll as well.

If there are any particular features that roll20 or another library supports that this one does not, please feel free to open an issue with a feature request for that specific feature.

I don't see much value in trying to create a FOSS "standard" for dice rolls because all of us support a widely disparate set of features. Such a standard would by necessity cater to the lowest common denominator (basic rolls and math), and new FOSS developers making their own rolling scripts would be largely unaware of its existence. If other devs want to work with me so that we can make our libraries (mostly) compatible with each other syntax-wise in a way that doesn't break backwards compatibility, I'm definitely open to that idea.

from diceroller.

DonaldTsang avatar DonaldTsang commented on June 13, 2024

That said, a large set of this library's features were inspired by reading over the roll20 dice reference.

That is good to know.

attempting to incorporate it (even by just looking at what it does and coding my own version) would be copyright infringement

Does that not go under reverse-engineering if it were to be clean-room designed? https://en.wikipedia.org/wiki/Clean_room_design

Such a standard would by necessity cater to the lowest common denominator (basic rolls and math), and new FOSS developers making their own rolling scripts would be largely unaware of its existence.

Roll20 has become the de-facto proprietary standard, with Myth-Weaver being the alternative (but with far less people, see https://www.myth-weavers.com/wiki/index.php/Help:Myth-Weavers:DiceRoller for more info) So it could be said that most people who attempt at creating a well-rounded library would use Roll20 as a basis, but not necessarily verbatim.

I don't see much value in trying to create a FOSS "standard" for dice rolls because all of us support a widely disparate set of features.
If other devs want to work with me so that we can make our libraries (mostly) compatible with each other syntax-wise, I'm definitely open to that idea.

I think a standard for common board game titles would be good, just like what Roll20 intended, albeit in a manner that each implementation could have feature parity without requiring the same exact written format (assuming that language conversion can be done easily).

If I am allowed to show my previous discussions dice-roller/rpg-dice-roller#60

from diceroller.

skizzerz avatar skizzerz commented on June 13, 2024

Different projects that support dice rolling have different aims, so there are some things that simply cannot be standardized. Projects which are applications in and of themselves (such as discord bots, websites, etc.) will likely have syntax that deals with how the dice are displayed or syntax that integrates well with other features of the application.

Projects which are libraries (such as this one) cannot make any assumptions in that regard. However, my library is designed to be very extensible by the application which consumes it, so that they can add in such integration syntax themselves and so that the application can work with an object result that can be customized and tweaked rather than the library outputting a string or other fixed representation.

Since these projects have different aims, feature parity simply cannot exist. Some will always support things specific to their use case that the others won't have. If we look to have a common core that implementations can extend, that's nice and all, but it won't make rolls portable between platforms and libraries.

If there are things this library is missing that you or others using it would find beneficial, it's best to open up issues or pull requests for them. I'm not opposed to adding features that other platforms have provided that adding them does not break backwards compatibility. This library is used (among other places) in the play-by-post forums of D&D Beyond and I absolutely cannot break existing games there by pushing out incompatible updates.

from diceroller.

skizzerz avatar skizzerz commented on June 13, 2024

Going to close this for the time being. If there are specific features which are desired by consumers of the library, a new issue can be added for them (ideally one issue per feature)

from diceroller.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.