GS2-Ranking Master Data Reference

Reference for the master data format and the models to be imported

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"
    }
  ]
}
TypeConditionRequiredDefaultValue LimitsDescription
versionstring
2019-09-17Format version of master data
categoriesList<CategoryModel>~ 1000 itemsCategory 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.

TypeConditionRequiredDefaultValue LimitsDescription
categoryModelIdstring
*
~ 1024 charsCategory Model GRN
* Set automatically by the server
namestring
~ 128 charsCategory Model name
Category Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 1024 charsMetadata
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.
minimumValuelong0 ~ 9223372036854775805Minimum 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.
maximumValuelong0 ~ 9223372036854775805Maximum 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.
sumboolfalseSum 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.
orderDirectionString 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.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
scopeString 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.
DefinitionDescription
“global”Global
“scoped”Scoped
globalRankingSettingGlobalRankingSetting{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”
entryPeriodEventIdstring~ 1024 charsEntry 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.
accessPeriodEventIdstring~ 1024 charsAccess 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.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsScope 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.
targetDayslong
1 ~ 365Target 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.

TypeConditionRequiredDefaultValue LimitsDescription
uniqueByUserIdbooltrueUnique 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.
calculateIntervalMinutesint
15 ~ 1440Calculate 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).
calculateFixedTimingFixedTimingCalculate 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.
additionalScopesList<Scope>0 ~ 10 itemsAdditional 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.
ignoreUserIdsList<string>0 ~ 10000 itemsIgnore 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.
generationstring~ 256 charsGeneration
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.

TypeConditionRequiredDefaultValue LimitsDescription
hourint0 ~ 23Hour
The hour (UTC) at which ranking calculation starts.
Specified as an integer from 0 to 23.
minuteint0 ~ 59Minute
The minute at which ranking calculation starts within the specified hour.
Specified as an integer from 0 to 59.