GS2-Ranking Master Data Reference
Master Data Format
{
"version": "2019-09-17",
"categories": [
{
"name": "[string]Category Model name",
"metadata": "[string?]Metadata",
"minimumValue": "[long?]Minimum Value",
"maximumValue": "[long?]Maximum Value",
"sum": "[bool]Sum Mode",
"orderDirection": "[string enum]Order Direction",
"scope": "[string enum]Scope",
"globalRankingSetting": {
"uniqueByUserId": "[bool]Unique By User ID",
"calculateIntervalMinutes": "[int]Calculate Interval Minutes",
"calculateFixedTiming": {
"hour": "[int?]Hour",
"minute": "[int?]Minute"
},
"additionalScopes": [
{
"name": "[string]Scope Name",
"targetDays": "[long]Target Days"
}
],
"ignoreUserIds": [
"[string]User ID that are not reflected in the ranking"
],
"generation": "[string?]Generation"
},
"entryPeriodEventId": "[string?]Entry Period Event ID",
"accessPeriodEventId": "[string?]Access Period Event ID"
}
]
}| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| version | string | ✓ | 2019-09-17 | Format version of master data | ||
| categories | List<CategoryModel> | ~ 1000 items | Category Model Different rankings can be created for different categories. Categories can have a minimum and maximum score that can be registered, and scores outside of that range are discarded. When calculating rankings, it is possible to set whether the scores are to be ranked in ascending or descending order, with the smallest scores being ranked higher (ascending order) or the largest scores being ranked lower (descending order). You can select global or scope as the type of ranking.Global is a ranking where all players see the same results, and Scope is a ranking where each game player has a different result, such as a ranking among friends or a ranking in a guild. For global ranking, you can set the ranking interval from 15 minutes to 24 hours for each category. Scope rankings reflect the calculate results in real time. The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation. |
Model
CategoryModel
Category Model
Different rankings can be created for different categories.
Categories can have a minimum and maximum score that can be registered, and scores outside of that range are discarded. When calculating rankings, it is possible to set whether the scores are to be ranked in ascending or descending order, with the smallest scores being ranked higher (ascending order) or the largest scores being ranked lower (descending order).
You can select global or scope as the type of ranking.
Global is a ranking where all players see the same results, and Scope is a ranking where each game player has a different result, such as a ranking among friends or a ranking in a guild.
For global ranking, you can set the ranking interval from 15 minutes to 24 hours for each category. Scope rankings reflect the calculate results in real time.
The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| categoryModelId | string | * | ~ 1024 chars | Category Model GRN * Set automatically by the server | ||||||||
| name | string | ✓ | ~ 128 chars | Category Model name Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 1024 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||
| minimumValue | long | 0 ~ 9223372036854775805 | Minimum Value The minimum score value that can be registered in this category. Scores below this threshold are rejected at registration time. If not set, there is no lower bound. | |||||||||
| maximumValue | long | 0 ~ 9223372036854775805 | Maximum Value The maximum score value that can be registered in this category. Scores above this threshold are rejected at registration time. If not set, there is no upper bound. | |||||||||
| sum | bool | false | Sum Mode When enabled, newly registered scores are added to the user’s existing score total rather than replacing it. The ranking is then based on the accumulated total. When disabled, each score registration is treated as an independent entry. | |||||||||
| orderDirection | String Enum enum { “asc”, “desc” } | ✓ | Order Direction Determines the sort order for ranking calculation. “asc” (ascending) ranks lower scores higher, suitable for time-based or golf-style rankings. “desc” (descending) ranks higher scores higher, suitable for point-based or high-score rankings.
| |||||||||
| scope | String Enum enum { “global”, “scoped” } | ✓ | Scope The type of ranking for this category. “global” creates a single leaderboard shared by all players, recalculated at configured intervals (batch processing). “scoped” creates per-user leaderboards based on subscribed players (e.g., friends or guild members), with real-time score reflection.
| |||||||||
| globalRankingSetting | GlobalRankingSetting | {scope} == “global” | ✓* | Global Ranking Setting Configuration specific to global ranking mode, including calculation interval, fixed timing, score uniqueness, generation management, and additional time-windowed scopes. Only applicable when scope is set to “global”. * Required if scope is “global” | ||||||||
| entryPeriodEventId | string | ~ 1024 chars | Entry Period Event ID GRN of a GS2-Schedule event that defines the time window during which score registration is accepted. Outside this period, score submission requests are rejected. If not set, scores can be registered at any time. | |||||||||
| accessPeriodEventId | string | ~ 1024 chars | Access Period Event ID GRN of a GS2-Schedule event that defines the time window during which ranking data can be viewed. Outside this period, ranking retrieval requests are rejected. If not set, rankings can be accessed at any time. |
Scope
Aggregation Scope
Defines an additional time-windowed aggregation scope for Global Ranking mode. Normally, global ranking is calculated for all registered scores regardless of when they were submitted. By adding scopes, you can create separate rankings that only consider scores registered within a specified number of days, enabling daily, weekly, or monthly leaderboards alongside the all-time ranking.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Scope Name A unique name identifying this aggregation scope within the category. Used to distinguish between multiple time-windowed ranking boards (e.g., “daily”, “weekly”). Maximum 128 characters. | ||
| targetDays | long | ✓ | 1 ~ 365 | Target Days The number of days to include in the aggregation window. Only scores registered within this number of days from the current time are considered for the scoped ranking. Range: 1-365 days. |
GlobalRankingSetting
Global Ranking Setting
Global is a ranking where all players see the same results. The ranking interval can be set from 15 minutes to 24 hours.
The ranking data has a setting called “generation,” and the registered scores can be reset by changing the generation.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| uniqueByUserId | bool | true | Unique By User ID When enabled, only one score per user ID is kept in the ranking. If a user submits a new score, it replaces the previous one (keeping the better score based on the sort direction). When disabled, multiple score entries from the same user are allowed, enabling sum-mode or multi-entry competition. | |||
| calculateIntervalMinutes | int | ✓ | 15 ~ 1440 | Calculate Interval Minutes The interval in minutes between successive ranking recalculations. The system periodically recalculates the global ranking based on all registered scores at this interval. Range: 15 to 1440 minutes (15 minutes to 24 hours). | ||
| calculateFixedTiming | FixedTiming | Calculate Fixed Timing Specifies a fixed time of day (UTC) at which ranking recalculation starts. If not set, recalculation occurs at regular intervals from an unspecified base time. Setting this ensures recalculations happen at a predictable, consistent time each day. | ||||
| additionalScopes | List<Scope> | 0 ~ 10 items | Additional Scopes A list of additional time-windowed aggregation scopes. Each scope defines a separate ranking that only considers scores registered within a specified number of days. This enables creating daily, weekly, or monthly leaderboards alongside the all-time global ranking. Maximum 10 scopes. | |||
| ignoreUserIds | List<string> | 0 ~ 10000 items | Ignore User IDs A list of user IDs whose scores should be excluded from ranking calculation. Useful for filtering out test accounts, administrator accounts, or known cheaters from the leaderboard. Maximum 10,000 entries. | |||
| generation | string | ~ 256 chars | Generation An arbitrary string representing the current ranking generation. Changing this value effectively resets all registered scores, as scores from a previous generation are no longer included in ranking calculations. Useful for implementing seasonal resets or periodic ranking resets. Maximum 256 characters. |
FixedTiming
Fixed Timing
Specifies the fixed time of day at which global ranking calculations start. Without this setting, ranking calculation occurs at regular intervals from an unspecified base time. By specifying a fixed hour and minute, you can ensure that ranking recalculation always begins at a predictable time (in UTC), such as midnight or a specific hour.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| hour | int | 0 ~ 23 | Hour The hour (UTC) at which ranking calculation starts. Specified as an integer from 0 to 23. | |||
| minute | int | 0 ~ 59 | Minute The minute at which ranking calculation starts within the specified hour. Specified as an integer from 0 to 59. |