Discourse Gamification

:discourse2: Summary Discourse Gamification adds customizable scoring (karma, kudos, points) and leaderboards to your instance.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-gamification
:open_book: Install Guide How to install plugins in Discourse

Features

While Discourse ships, out of the box, with gamification features (badges, trust levels) some communities want to take it to another level. That’s where GitHub - discourse/discourse-gamification comes in.

This plugin allows admins to easily create and tweak community scoring contests, where points are awarded by participating in the community.

Points are automatically updated every 5 minutes for events of the day, and we re-calculate scores from the last 10 days once a day.

Cheers

Users are awarded “cheers” by performing certain actions on the community. Each user cheer score appear on their user card, user profile and can be enabled on the user directory.

user card example with cheers

Like the plugin but the name cheers isn’t the best for your community? You can rename it to anything using Customize all text in Discourse.

Leaderboards

Admins can create multiple leaderboards, and each one can have a custom:

  • start date
  • end date
  • Competing users
  • Leaderboard privacy

By default, we ship with a default leaderboard at /leaderboard that will list all users from the first day where scores started to be awarded.

You can see a demo of it at Discourse Meta

Scorables

Currently, the following events award cheers:

See roadmap for upcoming scorables.

Score backfill

If you want to retroactively award scores you can run the following task:

rake gamification_scores:backfill_scores_from[2021-04-01]

This took under 10s to run on Meta for a 2 years backfill, so it should be quite safe to run on large instances.

If you are using our hosted service for your community contact our support to run a backfill task for you.

Configuration

Global customizations are:

  • each action score multiplier
  • Restrict categories where points can be earned
  • enable and disable the plugin

Those plugin-level settings live at /admin/site_settings/category/plugins?filter=plugin%3Adiscourse-gamification.

To create, delete and update leaderboards, admins can visit /admin/plugins/gamification.

Changelog

  • 2022-05-02T03:00:00Z - Public Release
  • 2022-05-10T05:00:00Z - Update roadmap with recent changes

Roadmap

(roughly ordered)

  • Fix i18n table title in custom score column on user directory

  • Ignore staged users

  • Ignore anonymized users (email match @anonymized.invalid)

  • Style leaderboard edit form

  • Leaderboard “you” link needs a larger offset to accommodate floating header…

  • Fix highlight of own user on the leaderboard not working if own user position is > 100

  • Add i18n thousands separator to user card / profile cheer score

  • Make leaderboard respect prioritize usernames in ux being disabled

  • Add time period filters to leaderboards

  • Add default time period filter to leaderboard settings

  • Add excluded_groups_ids to leaderboard settings

  • Use higher resolutions avatars in leaderboard podium

  • Add custom per-badge scoring

  • Allow admins to award/remove arbitrary points to users to allow integration with out-of-Discourse scorable events

  • Add per-reaction score awarding (requires Discourse Reactions - Beyond Likes)

  • Add chat-events scoring (requires Introducing Discourse Chat (BETA))

  • Add poll events scoring (created poll, voted in poll)

  • Add media events scoring (posted image, posted video, posted onebox)

54 Likes

Hi Falco, thank you for this great plugin.
I wanted to update the score multiplier for likes and change its value, I was wondering if this change will be reflected in the leaderboard or will it only take effect for future posts, after the change?
If the latter, do I have to rebake posts or run the score backfill task?

Thank you.

4 Likes

After updating the multiplier you only need to run the backfill task.

5 Likes

4 posts were merged into an existing topic: I have qustion about solver plugin and about Leaderboard plugin

This is awesome indeed. Just a thought with Discourse Reactions plugin would be cool to have options to adjust Cheers based on reaction chosen/received.

5 Likes

That’s already in the roadmap in the OP. All the way in the bottom tho :sweat_smile:

5 Likes

Thank you. My bad missed that detail. :beers::sunglasses::vulcan_salute::sparkles:

3 Likes

Thanks, this looks awesome! I have two questions:

  1. Is it possible to add the leaderboard table in a compressed manner (just a small and sweet list) to the homepage of a community? Right now it’s away at its own /leaderboard path and new users may not notice it.
  2. And echoing @Kartoon earlier question:
2 Likes

@chapoi is currently working on a homepage widget for it.

Per category weights are planned but they require a brand new settings UI that is quite far away in the roadmap.

7 Likes

Not sure if this was of interest to add to the main branch but I forked the code and added a function that displays the leaderboard by group instead of individuals:

It just adds up the score for each group and displays a slightly different UI. The group rankings are shown in the top section and it includes a breakdown of the users who contribute to each group. The groups are based on the ones selected on the admin page and I added a checkbox to toggle between group and individual display modes

image

Here’s the fork for anyone interested

9 Likes

That looks amazing! Great work!

6 Likes

This is a great suggestion. Then I could make custom Reactions that fit my community and the behavior I want to reward, and then adjust the score of each. #dowant

Another idea could be showing users how they have earned each point. At the moment it is a bit opaque for the end user (perhaps by design).

4 Likes

I’m a little curious about the philosophy behind the Cheers scoring.

I get that it’s a way to encourage desired behaviors.

It looks like the mechanism is aggregating & making visible the (largely invisible) steps users take toward trust levels. Sort of a system of incremental rewards? Is that it? Too simplistic? Have I missed something?

And I guess this differs from SO reputation because many of these are steps you can take yourself (rather than simply waiting to be ‘blessed’ with upvotes from the crowd).

3 Likes

And sorry, but one more, mostly unrelated question (=> new post rather than edit^) is there a way to segregate staff from non-staff to keep staff from dominating? If we added a leaderboard to our site this minute, I know who would be in the top two spots and would bet that the #3-8 spots were also staff.

1 Like

not at the moment, but it’s in the roadmap

but I’d very much agree with you that this may be the most important setting to be added at the moment :slight_smile: I’m not a dev; I just wanted to highlight the importance of excluding groups from leaderboard settings

4 Likes

That’s actually a good way to describe it. A continuous gamification system, while the prior gamification features (trust levels, badges) were all discreet.

While the trust levels are also a gamification feature, they also tie heavily in the self-sustainable moderation feature of Discourse, and also not flexible enough for most gamification needs. Badges are pure gamification, where they act like game achievements and fill that role pretty well.

However, some communities are looking into leaderboards, where they can completely customize scoring and easily see at a glance where all their users sit on said leaderboard, and this is what this plugins aims to do: Be a continuous, always fresh, customizable gamification feature.

4 Likes

Thanks @Falco!

And FWIW…

I’d rather separate staff & non-staff into two different leaderboards. (With maybe the staff one only visible to staff.) I need gamification almost more internally.

1 Like

Would it then possible to consider having different scoring systems for different leaderboards?

4 Likes

That’s on my long term vision, but it means building a whole new admin UI for scores and disconnecting those from the global site settings, so it’s quite a bit of work.

5 Likes

I think it would be cool if we have a multiplier for a set amount of time. For example, if you want to encourage participation over the weekends to can enable a 2x multiplier.

3 Likes