[Suggestion] Dice roller for the RP forums

Hunty's iconHunty

Veteran
Joined
Feb 23, 2013
Messages
4,626
Reaction score
1,155
Status
Dice Roller for the RP Forums:

A simple way to keep rolls and RP posts together.
​



Hey Lord of Kaos, Skorm brought up adding a dice roller, so I looked into how it could work on AnimeBase. Is that something staff would consider for the RP forums?

Members could click a dice button beside the post editor, choose their dice and any allowed modifier, and have the result attached to the post. For example, a D20 roll of 14 with a +3 bonus would display a total of 17. Just an example, obviously—the RP rules would determine what that result means.

There’s a XenForo add-on called [DD] Dice Roller that supports custom dice, rules and forum permissions:

It requires [DD] Core, and whoever handles installation would need to check compatibility first. I’d also want to check how it handles rerolls and edited posts so the results stay trustworthy.

I made a separate working demo to show the idea. Could something like this be worth trying in one RP forum?



How I’d fit this into AnimeBase:​

I put together a coded example using the forum’s layout so it’s easier to picture. The image below shows where the dice controls and result could go. It’s a preview of the idea; the feature hasn’t been installed on AnimeBase.

What members would see:

  1. Choose a roll. Click a Dice roll button beside the reply controls, then choose the dice, purpose, and any bonus the RP rules allow. Staff would set the available options.
  2. Submit the post. The roll request goes with the message. The server generates the result only when the post successfully submits.
  3. See the result in the thread. The post shows the roll, bonus, total, and a saved reference. For example: D20: 14 + 3 = 17. The RP rules still decide what that means.
The controls should match the site and stack neatly on phones, so it’s easy to use on either desktop or mobile.



Layout preview:

Example D20 roll · 14 + 3 = 17



You must be registered to see images
​



Keeping the rolls fair:

This is the part I’d want checked properly. Members should be able to fix a typo without changing their roll, and clicking submit twice shouldn’t give them another chance at a better result.


  • Post edits: Keep the original dice result even if the wording changes.
  • Repeated submissions: Return the same saved result if someone clicks twice or their connection retries.
  • Allowed rerolls: Use a separate action with the right permissions. Keep the original result and record who authorised the reroll and why.
  • Moderation: Keep the roll history staff need to review, even if a post is deleted or moderated.

A small code example:

For anyone handling the technical side, this PHP example shows how the number itself could be generated on the server. It isn’t the complete XenForo add-on. The dice and bonus limits are just examples; staff would set those around the RP rules.

PHP:
function generateRoll(int $sides, int $modifier): array
{
    if (!in_array($sides, [6, 20, 100], true)
        || $modifier < -5 || $modifier > 5) {
        throw new InvalidArgumentException('Invalid dice request.');
    }

    $result = random_int(1, $sides);

    return [
        'sides'    => $sides,
        'result'   => $result,
        'modifier' => $modifier,
        'total'    => $result + $modifier,
    ];
}

The server would also check the member’s permissions and the allowed options, then save the post and its roll together. The displayed result needs to come from that saved record, so members can’t change it by typing a different number into the editor.

What the record would include:
The post and member IDs, the dice preset and its version, each roll, the bonus, total, time, and a unique submission reference. That last reference is what stops a connection retry from creating another roll.



How staff could try it:

I’d start small and see how it works in practice:


  1. Check compatibility. Confirm AnimeBase’s XenForo version and the add-on requirements. The [DD] listing I linked is for XF 2.3 and requires [DD] Core.
  2. Test it on a staging copy. Set the allowed dice, RP rules, forums, and user-group permissions before trying it live.
  3. Check edits and rerolls. Verify the behavior above, including repeated submissions and moderator actions. If anything is missing, extend it through an add-on rather than changing XenForo’s core files.
  4. Try one RP forum first. Start with one simple preset, check desktop and mobile in both site themes, and expand it if it works well.

The add-on lists dice and rule configuration, forum permissions, and styling. The saved-roll and history requirements above are what I’d want checked against it before relying on it for RP.

Where else it could help:

I agree this could help more than just NRP. Other play-by-post games could use their own dice options and permissions too. It would keep more of the experience on AnimeBase and make it more convenient for everyone using it.

Could we try it in one RP forum and see how people get on with it?


[UPDATED: 10/07/2026]
 
Last edited:

Troi 🥉

Deez
Supreme
Joined
Jun 12, 2013
Messages
21,086
Reaction score
1,648
I would love this. I don't even really want to be on Discord... So if this could become a thing, I'm all for it. Especially as someone who needs rolls for my core abilities.
 

Hunty's iconHunty

Veteran
Joined
Feb 23, 2013
Messages
4,626
Reaction score
1,155
Status
I would love this. I don't even really want to be on Discord... So if this could become a thing, I'm all for it. Especially as someone who needs rolls for my core abilities.
I agree. This could help improve the RPing on the site significantly. The site needs to be more convenient for all users.
 

Lucidus 👑

Legendary
Joined
Oct 26, 2011
Messages
11,987
Reaction score
1,369
This would be a nice thing in general. It may also encourage more RP in general outside of the NRP such as DnD like text based games
 

Hunty's iconHunty

Veteran
Joined
Feb 23, 2013
Messages
4,626
Reaction score
1,155
Status
This would be a nice thing in general. It may also encourage more RP in general outside of the NRP such as DnD like text based games
My thoughts exactly. It will expand the forum to be more inclusive.
 
Top