GS2-Matchmaking Deploy/CDK Reference
Entities
Resources targeted by the Deploy operation
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a namespace before you can start using each service.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||
| description | string | ~ 1024 chars | Description | |||||||||||
| transactionSetting | TransactionSetting | Transaction Settings Configuration for controlling how transactions are processed when executing matchmaking operations. | ||||||||||||
| enableRating | bool | false | Enable Rating Whether to enable the Glicko-2 based rating calculation function. When enabled, players can submit match results via the Vote system and have their ratings automatically updated. Requires RatingModel master data to be configured. Defaults to false. | |||||||||||
| enableDisconnectDetection | String Enum enum { “disable”, “enable” } | “disable” | Disconnect Detection Controls whether players in matchmaking must periodically report they are still waiting. When enabled, if a player does not send a keep-alive within the configured timeout period, they are automatically removed from the Gathering. This prevents “ghost” players from blocking matchmaking completion. Defaults to “disable”.
| |||||||||||
| disconnectDetectionTimeoutSeconds | int | {enableDisconnectDetection} == “enable” | ✓* | 15 ~ 600 | Disconnect Detection Timeout (seconds) The number of seconds to wait without a keep-alive report before a player is considered disconnected and removed from the Gathering. Only applies when disconnect detection is enabled. Must be between 15 and 600 seconds. * Required if enableDisconnectDetection is “enable” | |||||||||
| createGatheringTriggerType | String Enum enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | Create Gathering Trigger Type The type of action to execute when a new Gathering is created. Can trigger GS2-Realtime room creation for real-time communication, or execute a GS2-Script for custom logic. Defaults to “none”.
| |||||||||||
| createGatheringTriggerRealtimeNamespaceId | string | {createGatheringTriggerType} == “gs2_realtime” | ✓* | ~ 1024 chars | GS2-Realtime namespace to create rooms when creating a gathering * Required if createGatheringTriggerType is “gs2_realtime” | |||||||||
| createGatheringTriggerScriptId | string | {createGatheringTriggerType} == “gs2_script” | ✓* | ~ 1024 chars | GS2-Script script GRN
to be executed when creating a gathering * Required if createGatheringTriggerType is “gs2_script” | |||||||||
| completeMatchmakingTriggerType | String Enum enum { “none”, “gs2_realtime”, “gs2_script” } | “none” | Complete Matchmaking Trigger Type The type of action to execute when matchmaking completes (all role slots are filled). Can trigger GS2-Realtime room creation for the matched players, or execute a GS2-Script for custom post-match logic. Defaults to “none”.
| |||||||||||
| completeMatchmakingTriggerRealtimeNamespaceId | string | {completeMatchmakingTriggerType} == “gs2_realtime” | ✓* | ~ 1024 chars | GS2-Realtime namespace GRN
to create rooms when matchmaking is complete * Required if completeMatchmakingTriggerType is “gs2_realtime” | |||||||||
| completeMatchmakingTriggerScriptId | string | {completeMatchmakingTriggerType} == “gs2_script” | ✓* | ~ 1024 chars | GS2-Script script GRN
to be executed when matchmaking is complete * Required if completeMatchmakingTriggerType is “gs2_script” | |||||||||
| enableCollaborateSeasonRating | String Enum enum { “enable”, “disable” } | “disable” | Enable Season Rating Collaboration Whether to enable integration with GS2-SeasonRating for season-based rating calculations. When enabled, a rating calculation session is automatically created in the specified GS2-SeasonRating namespace when matchmaking completes. Defaults to “disable”.
| |||||||||||
| collaborateSeasonRatingNamespaceId | string | {enableCollaborateSeasonRating} == “enable” | ✓* | ~ 1024 chars | Season Rating Namespace GRN * Required if enableCollaborateSeasonRating is “enable” | |||||||||
| collaborateSeasonRatingTtl | int | {enableCollaborateSeasonRating} == “enable” | 60 | 60 ~ 7200 | Season Rating Result TTL (seconds) The maximum time in seconds to wait for match result submissions via GS2-SeasonRating after matchmaking completes. If results are not submitted within this period, the rating session expires. Must be between 60 and 7200 seconds. Defaults to 60. * Required if enableCollaborateSeasonRating is “enable” | |||||||||
| changeRatingScript | ScriptSetting | Script setting to be executed when the rating value changes Script Trigger Reference - changeRating | ||||||||||||
| joinNotification | NotificationSetting | Join Notification Push notification settings for when a new player joins a Gathering. Notifies existing participants that a new player has joined, allowing the game client to update the matchmaking UI. | ||||||||||||
| leaveNotification | NotificationSetting | Leave Notification Push notification settings for when a player leaves a Gathering. Notifies remaining participants that a player has left, allowing the game client to reflect the change. | ||||||||||||
| completeNotification | NotificationSetting | Complete Notification Push notification settings for when matchmaking completes (all role slots are filled). Notifies all participants that the Gathering is full and the match can begin. | ||||||||||||
| changeRatingNotification | NotificationSetting | Change Rating Notification Push notification settings for when a player’s rating value changes after vote processing. Notifies the affected player of their new rating, allowing the game client to display the updated value. | ||||||||||||
| logSetting | LogSetting | Log Output Settings Configuration for outputting API request/response logs to GS2-Log. When configured, matchmaking operations (create/join/leave gathering, vote, rating changes, etc.) are logged for monitoring and analysis. |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Matchmaking::Namespace
Properties:
Name: namespace-0001
Description: null
TransactionSetting: null
EnableRating: true
EnableDisconnectDetection: null
DisconnectDetectionTimeoutSeconds: null
CreateGatheringTriggerType: none
CreateGatheringTriggerRealtimeNamespaceId: null
CreateGatheringTriggerScriptId: null
CompleteMatchmakingTriggerType: none
CompleteMatchmakingTriggerRealtimeNamespaceId: null
CompleteMatchmakingTriggerScriptId: null
EnableCollaborateSeasonRating: disable
CollaborateSeasonRatingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001
CollaborateSeasonRatingTtl: 60
ChangeRatingScript: null
JoinNotification: null
LeaveNotification: null
CompleteNotification: null
ChangeRatingNotification: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001import (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/matchmaking"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
matchmaking.NewNamespace(
&SampleStack,
"namespace-0001",
matchmaking.NamespaceOptions{
EnableRating: true,
CreateGatheringTriggerType: matchmaking.NamespaceCreateGatheringTriggerTypeNone,
CompleteMatchmakingTriggerType: matchmaking.NamespaceCompleteMatchmakingTriggerTypeNone,
EnableCollaborateSeasonRating: matchmaking.NamespaceEnableCollaborateSeasonRatingDisable,
CollaborateSeasonRatingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001"),
CollaborateSeasonRatingTtl: pointy.Int32(60),
LogSetting: &core.LogSetting{
LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Matchmaking\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Matchmaking\Model\Options\NamespaceOptions(
enableRating: true,
createGatheringTriggerType: \Gs2Cdk\Matchmaking\Model\Enums\NamespaceCreateGatheringTriggerType::NONE,
completeMatchmakingTriggerType: \Gs2Cdk\Matchmaking\Model\Enums\NamespaceCompleteMatchmakingTriggerType::NONE,
enableCollaborateSeasonRating: \Gs2Cdk\Matchmaking\Model\Enums\NamespaceEnableCollaborateSeasonRating::DISABLE,
collaborateSeasonRatingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl: 60,
logSetting: new \Gs2Cdk\Core\Model\LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
)
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.matchmaking.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.matchmaking.model.options.NamespaceOptions()
.withEnableRating(true)
.withCreateGatheringTriggerType(io.gs2.cdk.matchmaking.model.enums.NamespaceCreateGatheringTriggerType.NONE)
.withCompleteMatchmakingTriggerType(io.gs2.cdk.matchmaking.model.enums.NamespaceCompleteMatchmakingTriggerType.NONE)
.withEnableCollaborateSeasonRating(io.gs2.cdk.matchmaking.model.enums.NamespaceEnableCollaborateSeasonRating.DISABLE)
.withCollaborateSeasonRatingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001")
.withCollaborateSeasonRatingTtl(60)
.withLogSetting(new io.gs2.cdk.core.model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
))
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Matchmaking.Model.Namespace(
stack: this,
name: "namespace-0001",
options: new Gs2Cdk.Gs2Matchmaking.Model.Options.NamespaceOptions
{
enableRating = true,
createGatheringTriggerType = Gs2Cdk.Gs2Matchmaking.Model.Enums.NamespaceCreateGatheringTriggerType.None,
completeMatchmakingTriggerType = Gs2Cdk.Gs2Matchmaking.Model.Enums.NamespaceCompleteMatchmakingTriggerType.None,
enableCollaborateSeasonRating = Gs2Cdk.Gs2Matchmaking.Model.Enums.NamespaceEnableCollaborateSeasonRating.Disable,
collaborateSeasonRatingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl = 60,
logSetting = new Gs2Cdk.Core.Model.LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import matchmaking from "@/gs2cdk/matchmaking";
class SampleStack extends core.Stack
{
public constructor() {
super();
new matchmaking.model.Namespace(
this,
"namespace-0001",
{
enableRating: true,
createGatheringTriggerType: matchmaking.model.NamespaceCreateGatheringTriggerType.NONE,
completeMatchmakingTriggerType: matchmaking.model.NamespaceCompleteMatchmakingTriggerType.NONE,
enableCollaborateSeasonRating: matchmaking.model.NamespaceEnableCollaborateSeasonRating.DISABLE,
collaborateSeasonRatingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001",
collaborateSeasonRatingTtl: 60,
logSetting: new core.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, matchmaking
class SampleStack(Stack):
def __init__(self):
super().__init__()
matchmaking.Namespace(
stack=self,
name='namespace-0001',
options=matchmaking.NamespaceOptions(
enable_rating=True,
create_gathering_trigger_type=matchmaking.NamespaceCreateGatheringTriggerType.NONE,
complete_matchmaking_trigger_type=matchmaking.NamespaceCompleteMatchmakingTriggerType.NONE,
enable_collaborate_season_rating=matchmaking.NamespaceEnableCollaborateSeasonRating.DISABLE,
collaborate_season_rating_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001',
collaborate_season_rating_ttl=60,
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
)
print(SampleStack().yaml()) # Generate TemplateTransactionSetting
Transaction Settings
Transaction Settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | Whether to automatically execute issued transactions on the server side | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | Whether to commit the execution of transactions atomically * Applicable only if enableAutoRun is true | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Applicable only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Applicable only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Applicable only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
ScriptSetting
Script Setting
In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.
There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script’s execution results to halt API execution or control the API’s response content.
In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.
There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024 chars | GS2-Script script GRN
executed synchronously when the API is executed Must be specified in GRN format starting with “grn:gs2:”. | |||||||||||
| doneTriggerTargetType | String Enum enum { “none”, “gs2_script”, “aws” } | “none” | How to execute asynchronous scripts Specifies the type of script to use for asynchronous execution. You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
| |||||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-Script script GRN
for asynchronous execution Must be specified in GRN format starting with “grn:gs2:”. * Applicable only if doneTriggerTargetType is “gs2_script” | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-JobQueue namespace GRN
to execute asynchronous execution scripts If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN. There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason. * Applicable only if doneTriggerTargetType is “gs2_script” |
NotificationSetting
Push Notification Settings
This is a setting for sending push notifications when an event occurs in a GS2 microservice. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.
GS2-Gateway’s push notifications can be used to forward notifications to mobile push notification services when the destination device is offline. By properly utilizing mobile push notifications, you can implement a flow in which players are notified even if they exit the game during matchmaking and later return to it.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gatewayNamespaceId | string | “grn:gs2:{region}:{ownerId}:gateway:default” | ~ 1024 chars | GS2-Gateway namespace to use for push notifications Specify the GS2-Gateway namespace ID in GRN format starting with “grn:gs2:”. | ||||||||
| enableTransferMobileNotification | bool? | false | Whether to forward the notification as a mobile push notification When this notification is sent and the destination device is offline, specify whether to forward it as a mobile push notification. | |||||||||
| sound | string | {enableTransferMobileNotification} == true | ~ 1024 chars | Sound file name to be used for mobile push notifications The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound. * Applicable only if enableTransferMobileNotification is true | ||||||||
| enable | String Enum enum { “Enabled”, “Disabled” } | “Enabled” | Whether to enable push notifications
|
LogSetting
Log Output Setting
Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
CurrentModelMaster
Currently active Models master data
This master data describes the definitions of Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Note
Please refer to GS2-Matchmaking Master Data Reference for the JSON file format.Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | String Enum enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 chars | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | CurrentModelMaster | Updated master data of the currently active Models |
Implementation Example
Type: GS2::Matchmaking::CurrentModelMaster
Properties:
NamespaceName: namespace-0001
Mode: direct
Settings: {
"version": "2020-06-24",
"ratingModels": [
{
"name": "rating-0001",
"initialValue": 1500,
"volatility": 100,
"metadata": "RATING_0001"
},
{
"name": "rating-0002",
"initialValue": 1500,
"volatility": 150,
"metadata": "RATING_0002"
}
],
"seasonModels": [
{
"name": "season-0001",
"maximumParticipants": 50,
"challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"
},
{
"name": "season-0002",
"maximumParticipants": 100,
"challengePeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"
}
]
}
UploadToken: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/matchmaking"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
matchmaking.NewNamespace(
&SampleStack,
"namespace-0001",
matchmaking.NamespaceCreateGatheringTriggerTypeNone,
matchmaking.NamespaceCompleteMatchmakingTriggerTypeNone,
matchmaking.NamespaceOptions{},
).MasterData(
[]matchmaking.RatingModel{
matchmaking.NewRatingModel(
"rating-0001",
1500,
100,
matchmaking.RatingModelOptions{
Metadata: pointy.String("RATING_0001"),
},
),
matchmaking.NewRatingModel(
"rating-0002",
1500,
150,
matchmaking.RatingModelOptions{
Metadata: pointy.String("RATING_0002"),
},
),
},
[]matchmaking.SeasonModel{
matchmaking.NewSeasonModel(
"season-0001",
50,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001",
matchmaking.SeasonModelOptions{
},
),
matchmaking.NewSeasonModel(
"season-0002",
100,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002",
matchmaking.SeasonModelOptions{
},
),
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Matchmaking\Model\Namespace_(
stack: $this,
name: "namespace-0001",
createGatheringTriggerType: \Gs2Cdk\Matchmaking\Model\Enums\NamespaceCreateGatheringTriggerType::NONE,
completeMatchmakingTriggerType: \Gs2Cdk\Matchmaking\Model\Enums\NamespaceCompleteMatchmakingTriggerType::NONE
))->masterData(
[
new \Gs2Cdk\Matchmaking\Model\RatingModel(
name:"rating-0001",
initialValue:1500,
volatility:100,
options: new \Gs2Cdk\Matchmaking\Model\Options\RatingModelOptions(
metadata:"RATING_0001"
)
),
new \Gs2Cdk\Matchmaking\Model\RatingModel(
name:"rating-0002",
initialValue:1500,
volatility:150,
options: new \Gs2Cdk\Matchmaking\Model\Options\RatingModelOptions(
metadata:"RATING_0002"
)
)
],
[
new \Gs2Cdk\Matchmaking\Model\SeasonModel(
name:"season-0001",
maximumParticipants:50,
challengePeriodEventId:"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"
),
new \Gs2Cdk\Matchmaking\Model\SeasonModel(
name:"season-0002",
maximumParticipants:100,
challengePeriodEventId:"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"
)
]
);
}
}
print((new SampleStack())->yaml()); // Generate Templateclass SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.matchmaking.model.Namespace(
this,
"namespace-0001",
io.gs2.cdk.matchmaking.model.enums.NamespaceCreateGatheringTriggerType.NONE,
io.gs2.cdk.matchmaking.model.enums.NamespaceCompleteMatchmakingTriggerType.NONE
).masterData(
Arrays.asList(
new io.gs2.cdk.matchmaking.model.RatingModel(
"rating-0001",
1500,
100,
new io.gs2.cdk.matchmaking.model.options.RatingModelOptions()
.withMetadata("RATING_0001")
),
new io.gs2.cdk.matchmaking.model.RatingModel(
"rating-0002",
1500,
150,
new io.gs2.cdk.matchmaking.model.options.RatingModelOptions()
.withMetadata("RATING_0002")
)
),
Arrays.asList(
new io.gs2.cdk.matchmaking.model.SeasonModel(
"season-0001",
50,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"
),
new io.gs2.cdk.matchmaking.model.SeasonModel(
"season-0002",
100,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Matchmaking.Model.Namespace(
stack: this,
name: "namespace-0001",
createGatheringTriggerType: Gs2Cdk.Gs2Matchmaking.Model.Enums.NamespaceCreateGatheringTriggerType.None,
completeMatchmakingTriggerType: Gs2Cdk.Gs2Matchmaking.Model.Enums.NamespaceCompleteMatchmakingTriggerType.None
).MasterData(
new Gs2Cdk.Gs2Matchmaking.Model.RatingModel[] {
new Gs2Cdk.Gs2Matchmaking.Model.RatingModel(
name: "rating-0001",
initialValue: 1500,
volatility: 100,
options: new Gs2Cdk.Gs2Matchmaking.Model.Options.RatingModelOptions
{
metadata = "RATING_0001"
}
),
new Gs2Cdk.Gs2Matchmaking.Model.RatingModel(
name: "rating-0002",
initialValue: 1500,
volatility: 150,
options: new Gs2Cdk.Gs2Matchmaking.Model.Options.RatingModelOptions
{
metadata = "RATING_0002"
}
)
},
new Gs2Cdk.Gs2Matchmaking.Model.SeasonModel[] {
new Gs2Cdk.Gs2Matchmaking.Model.SeasonModel(
name: "season-0001",
maximumParticipants: 50,
challengePeriodEventId: "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"
),
new Gs2Cdk.Gs2Matchmaking.Model.SeasonModel(
name: "season-0002",
maximumParticipants: 100,
challengePeriodEventId: "grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import matchmaking from "@/gs2cdk/matchmaking";
class SampleStack extends core.Stack
{
public constructor() {
super();
new matchmaking.model.Namespace(
this,
"namespace-0001",
matchmaking.model.NamespaceCreateGatheringTriggerType.NONE,
matchmaking.model.NamespaceCompleteMatchmakingTriggerType.NONE
).masterData(
[
new matchmaking.model.RatingModel(
"rating-0001",
1500,
100,
{
metadata: "RATING_0001"
}
),
new matchmaking.model.RatingModel(
"rating-0002",
1500,
150,
{
metadata: "RATING_0002"
}
)
],
[
new matchmaking.model.SeasonModel(
"season-0001",
50,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001"
),
new matchmaking.model.SeasonModel(
"season-0002",
100,
"grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002"
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Templatefrom gs2_cdk import Stack, core, matchmaking
class SampleStack(Stack):
def __init__(self):
super().__init__()
matchmaking.Namespace(
stack=self,
name="namespace-0001",
create_gathering_trigger_type=matchmaking.NamespaceCreateGatheringTriggerType.NONE,
complete_matchmaking_trigger_type=matchmaking.NamespaceCompleteMatchmakingTriggerType.NONE,
options=matchmaking.NamespaceOptions(
enable_rating=True,
enable_collaborate_season_rating=matchmaking.NamespaceEnableCollaborateSeasonRating.DISABLE,
collaborate_season_rating_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:seasonRating:namespace-0001',
collaborate_season_rating_ttl=60,
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
).master_data(
rating_models=[
matchmaking.RatingModel(
name='rating-0001',
initial_value=1500,
volatility=100,
options=matchmaking.RatingModelOptions(
metadata = 'RATING_0001'
),
),
matchmaking.RatingModel(
name='rating-0002',
initial_value=1500,
volatility=150,
options=matchmaking.RatingModelOptions(
metadata = 'RATING_0002'
),
),
],
season_models=[
matchmaking.SeasonModel(
name='season-0001',
maximum_participants=50,
challenge_period_event_id='grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0001'
),
matchmaking.SeasonModel(
name='season-0002',
maximum_participants=100,
challenge_period_event_id='grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace-0001:event:event-0002'
),
],
)
print(SampleStack().yaml()) # Generate TemplateRatingModel
Rating Model
GS2 uses Glicko-2 as its rating algorithm. Glicko-2 has several parameters, but GS2-Matchmaking aggregates them into a single parameter, volatility, which represents the totality of the parameters. Volatility is a parameter that expresses the magnitude of change; the larger the value, the greater the change in the rating value.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| ratingModelId | string | * | ~ 1024 chars | Rating Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Rating Model name Rating Model-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. | |||
| initialValue | int | 1500 | 100 ~ 10000 | Initial Rating Value The starting rate value assigned to new players when they first participate in rated matchmaking. Defaults to 1500. All players begin at the same rating and it adjusts based on match results. | ||
| volatility | int | 100 | 1 ~ 20000 | Rating Volatility A Glicko-2 parameter that controls how much the rating value changes after each match. Higher values cause larger rating fluctuations, making ratings adjust more quickly. Lower values result in more stable ratings that change gradually. Defaults to 100. |
SeasonModel
Season Model
Defines the season-specific settings for Season Matchmaking, including the period of persistent gatherings, maximum participant count, and tier integration settings. Managed by GS2-Schedule for period control, and can be linked with GS2-Experience for persistent gathering within the same tier as needed.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| seasonModelId | string | * | ~ 1024 chars | Season Model GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Season Model name Season Model-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. | |||
| maximumParticipants | int | ✓ | 2 ~ 1000 | Maximum Number of Participants The maximum number of players that can join a single Season Gathering. Once this limit is reached, the Season Gathering is considered full and no more players can join. Must be between 2 and 1000. | ||
| experienceModelId | string | ~ 1024 chars | Experience Model GRN
for Tier Management The GRN of the GS2-Experience experience model used to determine player tiers. The player’s rank within this experience model is used as their tier for matchmaking, ensuring players are grouped with others at a similar level. If not specified, tier-based grouping is disabled and all players are matched together regardless of level. | |||
| challengePeriodEventId | string | ✓ | ~ 1024 chars | Challenge Period Event GRN The GRN of the GS2-Schedule event that defines the active period for this season. Season Gatherings can only be created and joined while this event is active. When the event period ends, the season closes and new matchmaking is no longer possible. |