Table of Contents

0. Introduction
1. Overview
1.1. Card Overview
1.2. Lorebook Overview
1.3. Regexes
2. Starting Out
2.1. Modularity
2.2. Output Structure
3. Advanced Information
3.1. General Notes
3.2. Styles
3.3. Troubleshooting

BYOTTRPG Documentation

Introduction

Hello and welcome to the documentation page for BYOTTRPG (Build Your Own Text-Top RPG)!

If there is a specific section you're looking for, check out the red navigation bar to the left.

BYOTTRPG (download here) is an AI card and lorebook that has the goal of being a generic, modular RPG framework where it should be as easy as possible to slot in new campaigns, settings and mechanics. The default version boasts RPG staples such as inventories, character sheets and dice rolls!

The card comes with a small set of greetings and settings, with the goal of them standing as examples on how to format your own entries.

SillyTavern is heavily recommended, as it is what I've been using and formatting all the CSS for.

Due to the fact that I have been using custom CSS (and that there tends to be a lot of text in RPG cards generally), I also don't recommend you using this on mobile. However, if you manage to read through this entire thing on mobile, you might just be scrappy enough to bend it into working on a phone UI.

Lightweight and non-intrusive presets that don't use {{char}} work best for this card.

Sometimes, you're going to see small boxes like this. These are reserved for small bits of information that aren't really necessary, but can be interesting to read!

Overview

To begin with, I should tell you what the card and lorebook contain, and the general format of the prompt and output.

Card Contents

The card's main function is to contain the linked lorebook, but also has a few greetings and some description text you can delete.

Lorebook Contents

The lorebook is divided up into several sections. Below is a small display of how it's formatted:

Database module
Character sheets
Main module
CoT prompts
Setting module
Level system
Displays module
Misc. Modules and prompts

Database module: Where additional information about your campaign/setting can be stored.
Character sheets: Information about and stats of your characters.
Main module: The main prompt for the RPG mechanics.
CoT prompts: Optional toggles for the CoT part of the prompt.
Setting module: Information about your campaign/setting
Level system: Leveling mechanics for your setting
Displays module: Prompt instructions for what displays the AI should write out.
Misc. modules and prompts: A space for additional modules and prompts.
By default, the lorebook inserts the Database module at depth 4, and the Main module at depth 3. For the sake of readability, they're all ordered from first to last (even though technically you could start at Order 0 when moving Depth up a notch). Using the "Order Ascending" sorting method is recommended.

Regexes

There are also a set of scoped regexes that come with the card. These contain nothing special, doing things such as hiding CoT output, transforming tags into HTML divs and a token saver that hides displays further up in context.

Starting Out

Once you have the card downloaded and a fitting preset selected, it's time to test this thing out!
There are 4 different greetings, and the configuration that the lorebook is set in makes it work best for greeting 1 or 2. Greeting 2 is the one that I recommend the most, since it shows you an example of how the AI's output is supposed to look like unlike 1.
If you decide to brave the harsh land of Vvardenfell in greeting 3 and 4, there are some things you must toggle in the lorebook before getting going. They are as follows (going from top to bottom, [3]/[4] markings depending on which greeting it's required for):

[4] ON: Example Character Sheet - IMPERIALICUS
[4] ON: Example Character Sheet - Eldrasea
[3][4] ON: Example Character Sheet - Wizardsmacker
[3][4] ON: 🍄Example Database - Morrowind
[3][4] ON: 🍄Example Setting - Morrowind
[3][4] OFF: 🌲Example Setting - Generic Fantasy
[3][4] ON: 🍄Example Leveling System - Morrowind
[3][4] OFF: 🌲Example Leveling System - Generic Fantasy

OPTIONAL: [3] ON: Narration: Second Person
OPTIONAL: [4] ON: Narration: Third Person
Each entry that belongs to a specific setting is marked with an emoji like 🍄 or 🌲 at the beginning. This makes it easy to differentiate at a glance!
Once you're set, pick an option from the CYOA display or write out an action of your own!

Modularity

Now that you've got your first reply, you might just notice something if you didn't earlier. Quite a lot of infromation is being written by the AI! So much so that a large portion of the latest massage was probably just the status display. Even with most of it hidden!

If you are the token-conscious sort, you might feel inclined to do something like disabling the character sheet or the CYOA options. Or you might want to add even more information! Which is exactly the point of this card, a platform for you to tailor your own unique RPG experience.

However, there are some considerations. AI is very good at repeating content it's written out in the past, so changing settings on the fly may not work so well depending on the model you use.

If you are inserting new prompts, be aware of the existing structure that was outlined above in the lorebook section. Putting everything into structured groups will help with readability and with the AIs comprehension of the task.

Output Structure

We can divide the output into three different sections. The thinking section, the narration section and the display section. Each of these sections is divided up in corresponding HTML tags, which means that a normal reply minus all the text will look like this:

<think> (this tag may not appear depending on your preset)
Thinking process from main prompt + toggles goes here
</think>
<narration>
Narration
</narration>
<display>
Displays
</display>

The first two are fairly straightforward. <thinkg> just covers the CoT questions before narration.
One thing I thought about using for this card was a dual CoT system, where the AI would think before narration, and then think again before doing the displays. In the end, it felt like the idea was too complex for something that was supposed to be released as a basic RPG card.

<narration> has nothing particularly fancy, but the narration itself can be modified with toggleable entries such as the Color module or the second/third person narration entries.

<display> is where things get interesting. Depending on what displays you have enabled in the lorebook, the AI will write out various tags and HTML code, which in conjunction with the scoped regex scripts will create an UI.

In order to have these displays appear properly, each greeting of yours requires a <start> tag, which with a regex script transforms into a CSS style tag that tells the page how the various HTML elements should look.

If you open up a message to look at how the display is structured, you will quickly notice it's just a bunch of tags and plaintext. This is also due to regexes, transforming each tag into its corresponding HTML element. Every tag should have its own corresponding end tag, the opening tag being transformed into an HTML element with some possibly custom style rules, and the closing tag being transformed into a corresponding closing tag in HTML.
There is one exception to this open/close-tag rule! The <endtag> tag! If you look under the vitals section of one of the greetings, you will see that it ends (and therefore closes up) two lines. But why? Because the <healthbars> tag actually converts into two different divs! The endtags first close up the first div caused by <healthbars>, and then close up the one caused by <bars>.
If you think something has gone wrong with one of the displays, make sure to compare the output with the relevant lorebook entry.

Advanced Information

Now that we've gone over the basic information and how to get started, it's time to delve into the more... finnicky aspects of BYOTTRPG.

General Notes

To start with, an unfortunate side effect of how I set things up is that the character sheets, the sheet displays and the leveling system are all linked. You are not going to be able to use the leveling features without using the character sheets display, unless you want to risk unforeseen consequences. This isn't necessarily an issue unless you want to use as few tokens as possible.
The issue with the sheets being required also extends to the rolls feature, but is not so bad since you can have a static character sheet in memory instead of the dynamic sheets being written out in response to stat/XP changes.

On the topic of rolls, while having the roll display is not necessary for using the roll CoT option, the opposite is true. The AI will probably make up something random if you do that.
Also: You will have to manually adjust the die you're using. By default the value is 10, if you want to use the Morrowind modules you may want to up it to 100 and so on.

Character sheets VS Setting information VS Database:

My original idea for this system was to have all three in their own separate place. But then I moved the character sheets up into the database, and now everything is complicated again.
The Setting module is simple at least, that's where I hope you'll put generic setting information and mechanics you want the AI to adhere to. Things like the example leveling system. Originally the character sheets were also in the main prompt, but I thought having potentially huge blocks of static information amidst all those instructions for the AI might make things muddy.
This means character sheets are left as additional information in the database module, which in the end works better. Technically you don't even need to have character sheets as long as you write one out in your greeting, as demonstrated in greeting 1!

Character sheets can still be useful though, especially if you want to use the same character over multiple adventures. While my own examples have them as a sheet and description both, I would recommend that you write those two out in separate entries. Why? Because of the sheet display!
The sheet display writes out each character's sheet for each turn, meaning that you don't need to have the lorebook entry enabled once it gets going. Tokens saved! Of course, this doesn't apply to people who don't use the sheet display.

As for the database... well, it's a database. Include more detailed information about your setting and characters here, either as an infodump filling it with setting-related names like in the example Database entry, or as keyword-based entries based on characters or locations. Like with the rest of the card, your own creativity is the limit!

The CoT module uses the <think> tag for the thinking process. If you are using a preset that has a prefilled thinking process that isn't using the same tag, it might cause issues.

Styles

I made three different style presets for the BYOTTRPG UI. The "Onyx" style is the default. To use any of these, press the button and copy the linked code into the "Replace with" field of the scoped regex entry named "<Start> Style Tag".

Troubleshooting

-I opened up a previous chat and the UI is broken! This wasn't how I left it!
Is the starting message still being displayed? It contains a <start> tag that contains all the CSS information for the displays to show properly.

-I picked a CYOA option and the AI thought I chose a different one!
This actually happened to me a few times. Just the AI being stupid. Clarify which one by just copy pasting the option as your reply.

-There's a grey bar in the vitals section!
Depending on what's going on, this might not be a bug. Basically, the grey color is the default color of the healthbars. The AI has given the bar a class that isn't "health", "stamina" or "magic", and therefore it defaults to the grey color. To add custom colors and bars, I recommend you explore the "Display - Vitals" lorebook entry and the <start> Style tag scoped regex. For the CSS, look to the "::-webkit-progress-value" rules.

-Only one bar is showing in the vitals section!
Unless your setting only has one bar, this is most likely an AI issue. Try swiping or comparing the output with the "Display - Vitals" lorebook entry.

-The fonts don't work.
An unfortunate side effect of using catbox to host your fonts.
Grab the fonts from here: Onyx,Vvardenfell,Summer and then install them locally. Then just rewrite the style regex to use your local version of the font (just "font-family:'fontname';") and you're forever set! Be sure to remove the "font-face" rule too.

...And that's all! Thank you for reading, and have fun building your own RPG!