{
  "achievement_name": "super_active_user",
  "conditions_dnf": [
    [
      {"event_name": "custom_event", "threshold": 0.5, "operator": ">"},
      {"event_name": "discord_role_assignment", "threshold": 0, "operator": "="}
    ],
    [
      {"event_name": "custom_event", "threshold": 0.4, "operator": ">="}
    ]
  ],
  "points_bonus": 150,
  "global_multiplier": 1.1,
  "local_multipliers": [
    {"event_name": "custom_event", "multiplier": 1.1},
    {"event_name": "discord_role_assignment", "multiplier": 1.5}
  ]
}

Achievements are a powerful way to incentivize user engagement and reward specific milestones or behaviors within your system. They offer three types of rewards:

  1. Static point bonuses
  2. Local multipliers for specific events
  3. Global multipliers that affect all points.

How Achievements Work

  1. Condition Evaluation: The system continuously evaluates user activity against predefined achievement conditions.
  2. Disjunctive Normal Form (DNF): Conditions are structured in DNF, allowing for complex logical combinations of criteria.
  3. Reward Allocation: When a user meets the conditions for an achievement, they immediately receive the associated rewards.
  4. Multiple Rewards: An achievement can grant a combination of point bonuses and multipliers.

Configuring an Achievement

To set up an achievement, you need to define the following components:

Example Achievement Configuration

{
  "achievement_name": "super_active_user",
  "conditions_dnf": [
    [
      {"event_name": "custom_event", "threshold": 0.5, "operator": ">"},
      {"event_name": "discord_role_assignment", "threshold": 0, "operator": "="}
    ],
    [
      {"event_name": "custom_event", "threshold": 0.4, "operator": ">="}
    ]
  ],
  "points_bonus": 150,
  "global_multiplier": 1.1,
  "local_multipliers": [
    {"event_name": "custom_event", "multiplier": 1.1},
    {"event_name": "discord_role_assignment", "multiplier": 1.5}
  ]
}