Achievements/Trophies #44

Open
opened 2024-07-01 04:51:17 +00:00 by noah · 0 comments
Owner

To better encourage user participation (and to serve as filterable/searchable material) we could have an achievements or "trophies" feature.

Trophies could be rewarded for example:

  • They've 100% filled out their profile text
  • They've shared 25, 50, 75 and 100 photos on their public gallery
  • They've been on webcam in the chat room for a streak of 7, 14, 30 consecutive days (or achievements for number of hours in a day, etc.)
  • Other achievements could acknowledge a number of posts written to the forum, likes given or received, etc.

Properties of a Trophy

The data points that a given trophy should need are:

  • A title ("Nothing to hide!")
  • A summary ("All (100) of their photos are on public!")
  • A description (for the help page, where all possible trophies and their criteria are listed)
  • A category to group these trophies as being about a particular feature (e.g. "photos")
  • A score value: harder to obtain achievements have a higher score
  • Time stamps: the first date/time the trophy was achieved, and the most recent date/time that it is still awarded.
  • A "Staleness" flag: when the user no longer qualifies for the trophy today.
  • An "Unread" value: for the owner of the trophy to see which ones are new to them.
  • An icon image for each would be nice

For logic they may also need functions to evaluate when the trophy should be awarded, or when/if it should be taken away.

Appearance

A style should be decided on if the trophies will have icon images. Examples to consider are:

  • Trophies of similar score should look visually similar (e.g.: bronze, silver, gold medallions; or use different shapes like squares, stars, etc.)

At the very least, color palettes should be chosen per score level if the v1 only has text labels.

On profile pages, there should be a trophy box displayed somewhere that shows all the user's badges, sorted by highest score on top.

A page on the site (auto generated from the list of trophies) should let users see what all the achievements are and how to qualify for them.

Ideas for Trophies

Some ideas of things we could aware trophies for, by category:

  • Photos
    • Uploaded {5, 15, 25, 50, 75, 100} photos to their gallery (when public only?)
    • Platinum level: all 100 of their photos are public.
  • Profile
    • They've 100% filled out all fields on their profile.
    • They've customized the color scheme of their profile page.
  • Social
    • Posted {10, 25, 50, 100, 200, 500, 1000} messages on the forums.
    • Started {1, 10, 25, 50, 100} topic threads on the forums.
    • Liked N number of photos.
    • Commented on N number of photos.
  • Chat
    • Streak of {3, 5, 7, 14, 30} days of appearing on webcam at least once
    • Avid red cammer (high proportion of their cam color is in red)
    • Writing a lot of messages in the public channels of the chat room
    • Adding emoji reactions to a lot of messages on chat
  • Popularity
    • Their profile is liked by a lot of people
    • Their photos attract a lot of likes or comments

Use for filters and searching

A secondary role these trophies MAY serve is to allow members to better curate their experience of the website.

For example: somebody who shares a lot of nudes on public but they really only want equally bold people as themselves to see those pictures.

There could be user preferences added to the site like:

  • People must have "high scoring Photo Trophies" before they can "send me a Friend Request"
  • Things that people could set their own gating for:
    • Who can send them the first DM on the main website
    • Who can send them a friend request

Things that we should not allow gating for would be:

  • Gatekeeping who qualifies to look at your 'public' photos: if we allow people to close themselves off and say, "you can't see my 50 public nude pics unless you got the trophy for sharing 50 of your own" the site can become a weird experience for new members when large swaths of the gallery are hidden.

Technical Notes

How often should Trophies be evaluated?

There should probably be at least a "once a day" full check of the current user to see if they are missing any trophies. It could be triggered as a background thread on the user's visit to the site.

The full check would visit every Trophy and ask it whether the user qualifies, or should lose the trophy (if applicable).

On-demand checks could also be done in direct response to user actions. Example:

  • A function per trophy category that can be called from various places around the codebase easily.
  • For the Photos category, the on-demand check could run on every Upload, Edit, or Deletion of the user's photo.
  • So when the user uploads their 50th photo, they get awarded the trophy immediately.

Some trophies such as chat room statistics may only calculate on the daily full check interval.

Time Stamps (First and Last Rewarded) and Staleness

Say a user uploads 50 photos and they get a trophy for it. As long as they keep at least 50 photos up, they qualify for the trophy every single day when their trophies are evaluated. Their Trophy in the database would have the date/time it was first rewarded, and the most recent time they still presently qualified for it.

If they delete pictures and fall below 50, they would no longer qualify for the 50 photo trophy. However, we can still let them keep it.

  • The "Last Rewarded" time stamp would stop being updated.
  • The "Stale" flag would be set, meaning: at the last trophy evaluation, they were not granted this trophy.

The profile page could visually distinguish the fresh & current trophies, sorted by highest value, and have a "view more" page where all the historically granted stale trophies could also be seen.

Notifications

A notification could be added to the user's queue the first time a new trophy is awarded.

If the user suddenly qualifies for many awards at once (e.g., the full check is run) the notification should consolidate it all into one message, e.g. "You got {this trophy} and 4 others."

The notifications should link to the user's trophy list (full view) page, where the "Unread" trophies have a "New!" tag near them.

Chat room integration

The chat room is a separate app to the website, kept at an arm's length as it is designed to be a stand-alone open source product.

Some ideas to do this could be:

  • Customize @shybot to keep track of user activity; she's always in the chat room and can gather statistics like when cameras turn on/off or public messages sent in chat, emoji reactions, etc.
  • Update the BareRTC server to have it gather statistics internally
    • Expose an admin API that the main website can call to download the statistics from BareRTC
    • May be a useful feature for other third-party users of BareRTC

Code Changes Needed

The "MVP" (minimum viable product) of this could start with just a small set of trophies:

  • Photo gallery: counts of public pictures
  • Anything "easy" to implement quickly (100% profile filled out trophy, etc.)

Some rough ideas of where changes actually should be made in the codebase:

  • Create a pkg/trophies module which will house the majority of the new code.
    • A definitions.go will be where the available trophies are defined: a lists of the trophies with their names, descriptions, etc.
    • A photos.go module to evaluate whether a user qualifies for photo gallery trophies.
      • A function like EvalPhotoTrophies(*User) which would CountPublicPhotos() in one place, and then use that count vs. the various trophy thresholds.
      • An easy to call, on-demand EvalPhotoTrophiesNow() function which will immediately check the user for trophies. Calls to this function can be sprinkled around the codebase, like in the Upload, Edit or Delete Photo pages.
  • The database model for trophies
    • Columns would be: User ID, Trophy ID, Created At (first awarded), Renewed At (recently awarded), Stale (boolean)
    • Functions to upsert a trophy (returning a different value if it was created or an existing row was updated) - the "created" indicator can go into whether the user gets a Notification for a new trophy.
  • Website pages
    • A "/help/trophies" page that lists all available trophies for users to learn about.
    • A member trophy shelf page ("/u/username/trophies") to list all current and stale trophies a user earned.
    • On the profile pages, show a handful of recent/highest value trophies.
To better encourage user participation (and to serve as filterable/searchable material) we could have an achievements or "trophies" feature. Trophies could be rewarded for example: * They've 100% filled out their profile text * They've shared 25, 50, 75 and 100 photos on their public gallery * They've been on webcam in the chat room for a streak of 7, 14, 30 consecutive days (or achievements for number of hours in a day, etc.) * Other achievements could acknowledge a number of posts written to the forum, likes given or received, etc. ### Properties of a Trophy The data points that a given trophy should need are: * A title ("Nothing to hide!") * A summary ("All (100) of their photos are on public!") * A description (for the help page, where all possible trophies and their criteria are listed) * A category to group these trophies as being about a particular feature (e.g. "photos") * A score value: harder to obtain achievements have a higher score * Time stamps: the first date/time the trophy was achieved, and the most recent date/time that it is still awarded. * A "Staleness" flag: when the user no longer qualifies for the trophy today. * An "Unread" value: for the owner of the trophy to see which ones are new to them. * An icon image for each would be nice For logic they may also need functions to evaluate when the trophy should be awarded, or when/if it should be taken away. ### Appearance A style should be decided on if the trophies will have icon images. Examples to consider are: * Trophies of similar score should look visually similar (e.g.: bronze, silver, gold medallions; or use different shapes like squares, stars, etc.) At the very least, color palettes should be chosen per score level if the v1 only has text labels. On profile pages, there should be a trophy box displayed somewhere that shows all the user's badges, sorted by highest score on top. A page on the site (auto generated from the list of trophies) should let users see what all the achievements are and how to qualify for them. ### Ideas for Trophies Some ideas of things we could aware trophies for, by category: * Photos * Uploaded {5, 15, 25, 50, 75, 100} photos to their gallery (when public only?) * Platinum level: all 100 of their photos are public. * Profile * They've 100% filled out all fields on their profile. * They've customized the color scheme of their profile page. * Social * Posted {10, 25, 50, 100, 200, 500, 1000} messages on the forums. * Started {1, 10, 25, 50, 100} topic threads on the forums. * Liked N number of photos. * Commented on N number of photos. * Chat * Streak of {3, 5, 7, 14, 30} days of appearing on webcam at least once * Avid red cammer (high proportion of their cam color is in red) * Writing a lot of messages in the public channels of the chat room * Adding emoji reactions to a lot of messages on chat * Popularity * Their profile is liked by a lot of people * Their photos attract a lot of likes or comments ### Use for filters and searching A secondary role these trophies **MAY** serve is to allow members to better curate their experience of the website. For example: somebody who shares a lot of nudes on public but they really only want equally bold people as themselves to see those pictures. There could be user preferences added to the site like: * People must have "high scoring Photo Trophies" before they can "send me a Friend Request" * Things that people could set their own gating for: * Who can send them the first DM on the main website * Who can send them a friend request Things that we **should not** allow gating for would be: * Gatekeeping who qualifies to look at your 'public' photos: if we allow people to close themselves off and say, "you can't see my 50 public nude pics unless you got the trophy for sharing 50 of your own" the site can become a weird experience for new members when large swaths of the gallery are hidden. ## Technical Notes ### How often should Trophies be evaluated? There should probably be at least a "once a day" full check of the current user to see if they are missing any trophies. It could be triggered as a background thread on the user's visit to the site. The full check would visit every Trophy and ask it whether the user qualifies, or should lose the trophy (if applicable). On-demand checks could also be done in direct response to user actions. Example: * A function per trophy category that can be called from various places around the codebase easily. * For the Photos category, the on-demand check could run on every Upload, Edit, or Deletion of the user's photo. * So when the user uploads their 50th photo, they get awarded the trophy immediately. Some trophies such as chat room statistics may only calculate on the daily full check interval. ### Time Stamps (First and Last Rewarded) and Staleness Say a user uploads 50 photos and they get a trophy for it. As long as they keep at least 50 photos up, they qualify for the trophy every single day when their trophies are evaluated. Their Trophy in the database would have the date/time it was first rewarded, and the most recent time they still presently qualified for it. If they delete pictures and fall below 50, they would no longer qualify for the 50 photo trophy. However, we can still let them keep it. * The "Last Rewarded" time stamp would stop being updated. * The "Stale" flag would be set, meaning: at the last trophy evaluation, they were not granted this trophy. The profile page could visually distinguish the fresh & current trophies, sorted by highest value, and have a "view more" page where all the historically granted stale trophies could also be seen. ### Notifications A notification could be added to the user's queue the **first time** a new trophy is awarded. If the user suddenly qualifies for many awards at once (e.g., the full check is run) the notification should consolidate it all into one message, e.g. "You got {this trophy} and 4 others." The notifications should link to the user's trophy list (full view) page, where the "Unread" trophies have a "New!" tag near them. ### Chat room integration The chat room is a separate app to the website, kept at an arm's length as it is designed to be a stand-alone open source product. Some ideas to do this could be: * Customize @shybot to keep track of user activity; she's always in the chat room and can gather statistics like when cameras turn on/off or public messages sent in chat, emoji reactions, etc. * Update the BareRTC server to have it gather statistics internally * Expose an admin API that the main website can call to download the statistics from BareRTC * May be a useful feature for other third-party users of BareRTC ## Code Changes Needed The "MVP" (minimum viable product) of this could start with just a small set of trophies: * Photo gallery: counts of public pictures * Anything "easy" to implement quickly (100% profile filled out trophy, etc.) Some rough ideas of where changes actually should be made in the codebase: * Create a `pkg/trophies` module which will house the majority of the new code. * A `definitions.go` will be where the available trophies are defined: a lists of the trophies with their names, descriptions, etc. * A `photos.go` module to evaluate whether a user qualifies for photo gallery trophies. * A function like `EvalPhotoTrophies(*User)` which would CountPublicPhotos() in one place, and then use that count vs. the various trophy thresholds. * An easy to call, on-demand `EvalPhotoTrophiesNow()` function which will immediately check the user for trophies. Calls to this function can be sprinkled around the codebase, like in the Upload, Edit or Delete Photo pages. * The database model for trophies * Columns would be: User ID, Trophy ID, Created At (first awarded), Renewed At (recently awarded), Stale (boolean) * Functions to upsert a trophy (returning a different value if it was created or an existing row was updated) - the "created" indicator can go into whether the user gets a Notification for a new trophy. * Website pages * A "/help/trophies" page that lists all available trophies for users to learn about. * A member trophy shelf page ("/u/username/trophies") to list all current and stale trophies a user earned. * On the profile pages, show a handful of recent/highest value trophies.
noah added the
enhancement
label 2024-07-01 04:51:17 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nonshy/website#44
No description provided.