Inspiration

OpenLegendRPG is one of the tabletop RPG system I use. Previously I had played online using Discord as the platform, and I encountered several hindrances: the website containing the standard reference document - which includes the rules - was, at the time, very unresponsive, and there are a multitude of Discord bots, each serving only one purpose (even worse: some of them died halfway through the campaign). This is the source of inspiration for a one-stop bot that does most of the things needed in an OpenLegend game: ruling as well as dice rolling.

What it does

It has several ruling lookup functions:

  • Two for actions (boons & banes)
  • Feats
  • Challenge Rating for boons
  • Disadvantages for multi-targeting
  • Attack range for non-physical attack

It also has a dice roller, which given the system, is quite unique; it supports:

  • standard dice notation (e.g. 3d20 => (20+18+2) = 40),
  • keeping n highest rolls (e.g. 3d20k2 => (20+18) = 38),
  • keeping n lowest rolls (e.g. 3d20l2 => (18+2) = 20),
    exploding dice (e.g. 3d20! => (20+18+2+20+4) = 64),
  • mathematical notations (e.g. 3d20+1d6 => (20+18+2)+(6) = 46),
  • any combination of the above!

How I built it

There are 3 main parts for the bot:

  1. Telegram message handling (done by Johnathan, Theodore, Xuanming)
    This is on the telegram side, to build an engine that takes in the input from telegram messages.

  2. Dice roller (done by Theodore) Takes in dice expressions, returns the roll!

  3. Information lookup (done by Kathy, Theodore, Xuanming) Take the files for the rules found in the OpenLegend core rule github, parse, and format them for your viewing pleasure.

Part 2 and 3 are then incorporated into the telegram bot.

Challenges I ran into

Most of us have little to no prior knowledge of Python nor telegram bots, and learning a language (at least the basics of it) in such a short time is challenging! Thinking of the implementation of dice roller was challenging due to the amount of flags that might stack up. We also had no idea what should we do with the YAML files we got! After a lot of googling, debugging, fixing some off-by-one errors, and changing the telegram bot @ once, we managed to build a stable build for our bot.

Accomplishments that I'm proud of

I would say that we have learnt a lot!
For some of us, this would be the first time we used Python, regex, and/or making telegram bots.
On the product itself, it would be the first telegram bot that supplements the OpenLegend RPG system, as well as one of the more advanced dice rolling bot available in telegram.

What I learned

Of course there are technical skills learnt from this (e.g. Python). However, I think that the important learning point here is to plan what we make, and develop something step-by-step with a clear road for future implementation(s); break things into solvable chunks and grow from there.

What's next for OpenLegendBot

With regards to the ruling lookup, I daresay that it is pretty complete as of now! It is meant as a quick reference during gameplay so players and the dungeonmaster do not need to scour through the book.
Extra feature that can be implemented is saving a character attributes for automatic rolling (e.g. having a Might attribute of 2 will make default might rolls as 1d20!+1d6!).
For dice-rolling, what is done would be fine for most, if not all OpenLegend games. Of course, one of the golden standard for standalone dice-rolling bot would be Sidekick bot, and more features for the dice can always be implemented.

Built With

Share this project:

Updates