-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
303 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,11 @@ | ||
# Leaderboards | ||
|
||
* Leaderboards are only defined from points. | ||
* Leaderboard definitions can be created by Curators and Admin only. | ||
* Curators' leaderboards are defined only to their team-scope. | ||
* Admin's leaderboards are global and visible to all. | ||
* Leaderboards can be defined while the game is playing. | ||
* Leaderboards are calculated on-the-fly, will not be cached. (?) | ||
* Leaderboards are defined within three dimensions. | ||
* Leaderboards are **_only_** defined from points. | ||
* Leaderboards are defined against two dimensions. | ||
* Time range = daily / weekly / monthly / all time / custom ranges | ||
* Point Rules = set of point rule(s) to get sum of points | ||
* Scope = team-wise, team-scope-wise, global | ||
* Scope = team-wise, game-wise | ||
|
||
## Leaderboard Definition | ||
## Tie-breakers | ||
|
||
* Can include a set of point rule ids to calculate sum for. | ||
* Can include a set of point rule ids to exclude from sum calculation. | ||
* Once exclude set has been defined, any rules other than specified will be taken into sum. | ||
* **Cannot** define include set and exclude set in a single leaderboard definition. | ||
* Order can be defined. | ||
* Either it must be ascending (asc) or descending (desc). | ||
* Default is _descending_. | ||
|
||
## Tie Breakers | ||
* When two users have same number of points, there is no guarantee that which player will come first. | ||
|
||
* When two users have same number of points, we will be using total event count contributed | ||
to the total points as tie breaker. | ||
* The lower the count, will be the higher in rank. | ||
* If it is to have same event count, then they will have the **same rank**. | ||
* For eg: Adam and Lily will get two ranks because their count is different although they have exactly same total points. | ||
|
||
| User | Points | #Events | Rank | | ||
|--- |--- |--- | --- | | ||
| Jon | 7739 | 121 | 1 | | ||
| **Adam** | 3864 | 78 | **2** | | ||
| **Lily** | 3864 | 91 | **3** | | ||
| Shanon | 2705 | 74 | 4 | | ||
| Gabriel | 921 | 32 | 5 | | ||
|
||
* In case, assume that Adam and Lily has the same count, then both of their ranks will be same. | ||
* Here Lily and Adam both will be ranked #2. | ||
* And Shanon will still be 4th, not 3rd. | ||
|
||
| User | Points | #Events | Rank | | ||
|--- |--- |--- | --- | | ||
| Jon | 7739 | 121 | 1 | | ||
| **Adam** | 3864 | 78 | **2** | | ||
| **Lily** | 3864 | 78 | **2** | | ||
| Shanon | 2705 | 74 | 4 | | ||
| Gabriel | 921 | 32 | 5 | | ||
|
||
* When you want to get top 3 from above leaderboard, it will return only based on rank. | ||
* Therefore, only Jon, Adam and Lily will be returned. | ||
* Shanon will be ignored as her rank is 4th. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,81 @@ | ||
# Milestones | ||
|
||
* All milestones are pre-defined before gameplay. | ||
* Can be defined only by admin. | ||
* Can be defined only by Admin. | ||
* Milestones never ends. They are played by players forever. | ||
* Milestone should be defined in a way which can play forever. | ||
* At least two levels must be there for a milestone. | ||
* A milestone can have only **finite** amount of levels. | ||
* When a user has reached maximum level of a milestone, Oasis consider he/she has completed the milestone. | ||
* Milestone aggregating values must be monotonically increasing. | ||
* Penalty values (negative values) will be accumulated separately along with positive values. | ||
* Once user achieved a level, it cannot be undone. | ||
* Due to the penalty values, it might go below the current level. But it does not | ||
* A milestone can have only **finite** number of levels. | ||
* When a player has reached maximum level of a milestone, Oasis considers that player has completed the milestone. | ||
* ~~Milestone aggregating values must be monotonically increasing.~~ | ||
* ~~Penalty values (negative values) will be accumulated separately along with positive values.~~ | ||
* Once a player achieved/surpassed a level, it cannot be undone. | ||
* Due to the penalty values, it might go below the current level. But, it does not | ||
affect to the player's achieved level. | ||
|
||
## Milestone Creation | ||
|
||
* Milestones should be defined only using aggregation functions | ||
* Sum of points | ||
* Sum of KPIs | ||
* Count of events | ||
* Sum of point ids | ||
* Sum of events | ||
* Count of events | ||
|
||
## Specification | ||
TBW | ||
|
||
## Examples | ||
|
||
More comprehensive set of examples can be found in this [file](elements/milestones/src/test/resources/milestones.yml) | ||
|
||
* Accumulate a single point id | ||
```yaml | ||
- id: MILE-0001 | ||
name: Total-Reputations | ||
description: Provides ranking through accumulated reputations | ||
pointIds: | ||
- stackoverflow.reputation | ||
levels: | ||
- level: 1 | ||
milestone: 1000 | ||
- level: 2 | ||
milestone: 5000 | ||
- level: 3 | ||
milestone: 10000 | ||
- level: 4 | ||
milestone: 50000 | ||
- level: 5 | ||
milestone: 100000 | ||
``` | ||
* Accumulates based on multiple point ids | ||
```yaml | ||
- name: Star-Points | ||
description: Allow tiers for customers based on star points accumulated | ||
pointIds: | ||
- star.points | ||
- coupan.points | ||
levels: | ||
- level: 1 | ||
milestone: 100 | ||
- level: 2 | ||
milestone: 1000 | ||
- level: 3 | ||
milestone: 10000 | ||
``` | ||
* Accumulate directly from events based on a condition | ||
```yaml | ||
- name: Milestone-with-Event-Count | ||
description: This is a milestone counting events based on a criteria. | ||
event: stackoverflow.question.answered | ||
eventFilter: | | ||
return e.answeredAt - e.askedAt <= 60 * 60 * 5 | ||
valueExtractor: 1 | ||
levels: | ||
- level: 1 | ||
milestone: 5 | ||
- level: 2 | ||
milestone: 10 | ||
- level: 3 | ||
milestone: 15 | ||
``` |
Oops, something went wrong.