stash icon indicating copy to clipboard operation
stash copied to clipboard

[Feature] Achievements

Open echo6ix opened this issue 3 years ago • 0 comments

To implement a framework to display community shared user-created achievements for individual performer pages, individual studio pages, individual tag pages, individual scene pages, and the statistics page ala AnalVids.com achievements as seen here https://www.analvids.com/model/103208/emily_bellexx

Concept

To allow the user/community to create custom achievements -- through SQL queries or whatever is appropriate, but for the sake of this concept I'll use SQL -- that display an achievement icon, achievement title, and corresponding rank on a specified section of Stash. Performers, studios, tags, and scenes could have the ability to trigger an achievement if they meet the SQL criteria. Also, the statistics page would display user achievements triggered by meeting user-defined SQL criteria, such as https://discord.com/channels/559159668438728723/559159668912553989/845113238173909004

Community shared

Allowing for user-created and community shared achievements -- possibly on a community repo ala CommunityScrapers -- removes the burden from devs of creating this-and-that achievement request, and offloads it to the community analogous to Scrapers and Scripts.

Screenshot 2022-07-12 014740

More over, with the eventual inclusion of StashIDs for tags and studios, custom user-shared achievements could potentially reference the same tags and studios across different Stash instances!

User-created achievement file

User-created achievements could be loaded from a specified folder such as ~/.stash/achievements, where an achievement file would essentially consist of a single yaml file that contains all the parameters pertaining to the custom achievement, and an optional PNG icon, such as

name: "Baby Got Back"
achievements:
  AchievementName:
    type: performer
    title: Baby Got Back
    query:
      sql: insert sql here that fetches the id female performer(s) in the most scenes containing the tag "big butt" per the limit specified below.
      limit: 3

If the id in the above sql matched the id of the current performer page, the achievement would be displayed with their corresponding rank from 1 to 3.

Yaml parameters

Parameter name Parameter option Description
name Name of achievement file
type performer, studio, tag, scene, statistics indicates what section of Stash the achievement is displayed
title (string) String value of achievement displayed adject to achievement icon
sql SQL query that fetches the results for the achievement
limit (integer) the amount of achievements to award rated from 1 to n, where n is the limit

Using SQL may not be the optimal procedure to find and trigger achievements. This is purely for conceptual purposes.

PNG achievement icons

PNG files that would accompany the YAML file using the same file name as the YAML file. All icons would be displayed at the same fixed size, such as 32x32

Missing icon files

YAML files that lack a corresponding PNG icon would display a stock icon similar to the trophy emoji🏆.

Sample achievements

  • Amazonian performer achievement

    • query select height,id from performers order by height desc limit 5
    • If a performer's id is matched in the results this achievement would be displayed on the respective performers' page as the "Amazonian" achievement for the tallest performer and their corresponding rank from 1 to 5
  • Go Outside! user achievement per JuiceBox

    • query select count(*) from scenes
    • If the scene count > 9999 the user unlocks this Achievement on the statistics page. The SQL/YAML concept would require some kind of parameter that acts as a condition to test for comparison scenarios like this

References

References to some discussion of this topic on Discord

  • https://discord.com/channels/559159668438728723/559159668912553989/845113238173909004
  • https://discord.com/channels/559159668438728723/644934273459290145/994665285271429271
  • https://discord.com/channels/559159668438728723/559399634318131210/996280938013139015

echo6ix avatar Jul 12 '22 07:07 echo6ix