GS2-Lottery Master Data Reference
Master Data Format
{
"version": "2019-02-21",
"lotteryModels": [
{
"name": "[string]Lottery Model name",
"metadata": "[string?]Metadata",
"mode": "[string enum]Drawing Mode",
"method": "[string enum]Lottery Method",
"prizeTableName": "[string]Prize Table Name",
"choicePrizeTableScriptId": "[string]GS2-Script script GRN to determine the Prize Table"
}
],
"prizeTables": [
{
"name": "[string]Prize Table name",
"metadata": "[string?]Metadata",
"prizes": [
{
"prizeId": "[string]Prize ID",
"type": "[string]Prize Type",
"acquireActions": [
{
"action": "[string]Type of action to be executed in the Acquire Action",
"request": "[string]JSON string of the request used when executing the action"
}
],
"drawnLimit": "[int?]Maximum Number of Draws",
"limitFailOverPrizeId": "[string]Limit Failover Prize ID",
"prizeTableName": "[string]Prize Table Name",
"weight": "[int]Draw Weight"
}
]
}
]
}| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| version | string | ✓ | 2019-02-21 | Format version of master data | ||
| lotteryModels | List<LotteryModel> | ~ 100 items | Lottery Model Lottery Model is an entity that defines the draw method and how to reference the draw table. Two draw methods are available: Standard Draw, which performs draws with a fixed probability each time, and Box Draw, where a predetermined number of prizes are placed in a box, and prizes are drawn from the box one by one with each draw. The lottery process uses a Prize Table. GS2-Script can be used to replace a part of the Prize Table with a different table when multiple drawings are performed. By using this mechanism, it is possible to apply a different Prize Table only once in a 10-round gacha. | |||
| prizeTables | List<PrizeTable> | ~ 100 items | Prize Table A prize can either specify an acquire action directly or reference another Prize Table. By nesting Prize Tables, you can configure a two-step drawing process—for example, the first step determines the rarity such as SSR, SR, or R, and the second step selects a specific item corresponding to that rarity. This structure makes it easier to manage and adjust the overall distribution rates for each rarity in the game. |
Model
PrizeTable
Prize Table
A prize can either specify an acquire action directly or reference another Prize Table. By nesting Prize Tables, you can configure a two-step drawing process—for example, the first step determines the rarity such as SSR, SR, or R, and the second step selects a specific item corresponding to that rarity. This structure makes it easier to manage and adjust the overall distribution rates for each rarity in the game.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| prizeTableId | string | * | ~ 1024 chars | Prize Table GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Prize Table name Prize Table-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 128 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. | |||
| prizes | List<Prize> | ✓ | 1 ~ 100 items | Prizes The list of prizes in this Prize Table. Each prize defines its draw weight (probability), the actions to execute when drawn, and optionally a draw limit. The actual draw probability of each prize is calculated as its weight divided by the total weight of all prizes in the table. |
Prize
Prize
A single prize entry within a Prize Table. A prize can either directly specify acquire actions (granting items, currency, etc.) or reference another Prize Table for nested drawing. Each prize has a draw weight that determines its relative probability of being drawn.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| prizeId | string | ✓ | UUID | ~ 36 chars | Prize ID A unique identifier for this prize within the Prize Table. Used to track draw limits and as a reference when specifying failover prizes. | |||||||
| type | String Enum enum { “action”, “prize_table” } | ✓ | Prize Type Determines whether this prize directly grants rewards or delegates to another Prize Table. “action” specifies acquire actions to execute when drawn. “prize_table” references another Prize Table for a nested drawing (e.g., first draw determines rarity, second draw determines specific item).
| |||||||||
| acquireActions | List<AcquireAction> | {type} == “action” | [] | 1 ~ 100 items | Acquire Actions The list of acquire actions to execute when this prize is drawn. Multiple actions can be specified to grant several rewards at once (e.g., an item and currency together). * Applicable only if type is “action” | |||||||
| drawnLimit | int | {type} == “action” | 1 ~ 1000000 | Maximum Number of Draws The maximum number of times this prize can be drawn across all users. When the limit is reached, the failover prize (limitFailOverPrizeId) is drawn instead. Used to implement limited-quantity prizes such as jackpot items. * Applicable only if type is “action” | ||||||||
| limitFailOverPrizeId | string | {type} == “action” and {drawnLimit} > 0 | ✓* | ~ 32 chars | Limit Failover Prize ID The ID of the prize to draw instead when this prize’s draw limit (drawnLimit) has been reached. Must reference another prize within the same Prize Table. * Required if type is “action” and drawnLimit is greater than 0 | |||||||
| prizeTableName | string | {type} == “prize_table” | ✓* | ~ 128 chars | Prize Table Name The name of the Prize Table to delegate the draw to. Used when the prize type is “prize_table” for nested drawing. * Required if type is “prize_table” | |||||||
| weight | int | ✓ | 1 ~ 2147483646 | Draw Weight The relative weight of this prize in the Prize Table. The actual draw probability is calculated as this prize’s weight divided by the total weight of all prizes in the table. For example, if three prizes have weights of 70, 20, and 10, their draw probabilities are 70%, 20%, and 10% respectively. |
AcquireAction
Acquire Action
LotteryModel
Lottery Model
Lottery Model is an entity that defines the draw method and how to reference the draw table.
Two draw methods are available: Standard Draw, which performs draws with a fixed probability each time, and Box Draw, where a predetermined number of prizes are placed in a box, and prizes are drawn from the box one by one with each draw.
The lottery process uses a Prize Table. GS2-Script can be used to replace a part of the Prize Table with a different table when multiple drawings are performed. By using this mechanism, it is possible to apply a different Prize Table only once in a 10-round gacha.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| lotteryModelId | string | * | ~ 1024 chars | Lottery Model GRN * Set automatically by the server | ||||||||
| name | string | ✓ | ~ 128 chars | Lottery Model name Lottery Model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||||||||
| metadata | string | ~ 2048 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. | |||||||||
| mode | String Enum enum { “normal”, “box” } | ✓ | Drawing Mode Select the prize drawing method. “normal” performs draws with a fixed probability each time (prizes can be drawn repeatedly). “box” places a predetermined number of prizes in a virtual box, and each draw removes a prize from the box (guaranteeing all prizes will eventually be drawn).
| |||||||||
| method | String Enum enum { “prize_table”, “script” } | ✓ | Lottery Method Determines how the Prize Table is referenced. “prize_table” uses a statically specified Prize Table. “script” uses GS2-Script to dynamically select the Prize Table at draw time, enabling scenarios like applying a different Prize Table for one draw in a 10-draw gacha.
| |||||||||
| prizeTableName | string | {method} == “prize_table” | ✓* | ~ 128 chars | Prize Table Name The name of the Prize Table to use for this lottery model. Required when the lottery method is “prize_table”. * Required if method is “prize_table” | |||||||
| choicePrizeTableScriptId | string | {method} == “script” | ✓* | ~ 1024 chars | GS2-Script script GRN
to determine the Prize Table Script Trigger Reference - choicePrizeTable* Required if method is “script” |