GS2-Quest
GS2-Deploy のテンプレートで使用できるリソース定義のリファレンス
GS2-Deploy リファレンス
エンティティ
Namespace
Namespace
Type: GS2::Quest::Namespace
Properties:
Name: namespace1
Description: null
TransactionSetting:
EnableAutoRun: false
QueueNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001
KeyId: grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001
StartQuestScript: null
CompleteQuestScript: null
FailedQuestScript: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1
QueueNamespaceId: null
KeyId: null
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 32文字 | ネームスペース名 | |
description | string | ~ 1024文字 | 説明文 | ||
transactionSetting | TransactionSetting | ✓ | トランザクション設定 | ||
startQuestScript | ScriptSetting | クエスト開始したときに実行するスクリプト | |||
completeQuestScript | ScriptSetting | クエストクリアしたときに実行するスクリプト | |||
failedQuestScript | ScriptSetting | クエスト失敗したときに実行するスクリプト | |||
logSetting | LogSetting | ログの出力設定 | |||
queueNamespaceId | string | ~ 1024文字 | スタンプシートの実行に使用する GS2-JobQueue のネームスペース | ||
keyId | string | ~ 1024文字 | スタンプシートの発行に使用する GS2-Key のネームスペース |
QuestGroupModelMaster
QuestGroupModelMaster
Type: GS2::Quest::QuestGroupModelMaster
Properties:
NamespaceName: namespace1
Name: quest-group-0001
Description: null
Metadata: null
ChallengePeriodEventId: null
クエストグループモデルマスター
クエストグループは複数のクエストをグルーピングするためのエンティティで、クエストの進行はグループ内で同時に1つしか実行できません。
つまり、並列でクエストを進行できるようにする必要がある場合はグループを分ける必要があります。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
name | string | ✓ | ~ 128文字 | クエストグループモデル名 | |
description | string | ~ 1024文字 | 説明文 | ||
metadata | string | ~ 1024文字 | メタデータ | ||
challengePeriodEventId | string | ~ 1024文字 | クエストに挑戦可能な期間を設定した GS2-Schedule イベントGRN |
QuestModelMaster
QuestModelMaster
Type: GS2::Quest::QuestModelMaster
Properties:
NamespaceName: namespace1
QuestGroupName: quest-group-0001
Name: quest-0001
Description: null
Metadata: null
Contents:
-
Metadata: normal
CompleteAcquireActions:
-
Action: Gs2Experience:AddExperienceByUserId
Request: Gs2Experience:AddExperienceByUserId-request1
Weight: 1
ChallengePeriodEventId: null
FirstCompleteAcquireActions: null
ConsumeActions: null
FailedAcquireActions: null
PremiseQuestNames: null
クエストモデルマスター
クエストはインゲームの開始に必要な対価とクリアしたときに得られる報酬を保持するエンティティです。
クリアしたときに得られる報酬は複数のバリエーションを用意でき、クエスト開始時に抽選することができます。
例えば、クエストのクリアフラグ管理は同じコンテンツだが、レアモンスターの出現有無で2種類のコンテンツを用意することができます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
questGroupName | string | ✓ | ~ 128文字 | クエストグループモデル名 | |
name | string | ✓ | ~ 128文字 | クエスト名 | |
description | string | ~ 1024文字 | 説明文 | ||
metadata | string | ~ 1024文字 | メタデータ | ||
contents | Contents[] | ✓ | クエストの内容 | ||
challengePeriodEventId | string | ~ 1024文字 | クエストに挑戦可能な期間を設定した GS2-Schedule イベントGRN | ||
firstCompleteAcquireActions | AcquireAction[] | [] | 初回クリア報酬アクションリスト | ||
consumeActions | ConsumeAction[] | [] | クエストの参加料 | ||
failedAcquireActions | AcquireAction[] | [] | クエスト失敗時の報酬 | ||
premiseQuestNames | string[] | [] | クエストに挑戦するためにクリアしておく必要のあるクエスト名 |
CurrentQuestMaster
CurrentQuestMaster
Type: GS2::Quest::CurrentQuestMaster
Properties:
NamespaceName: namespace1
Settings: {
"version": "2019-05-14",
"groups": [
{
"name": "main",
"metadata": "MAIN",
"quests": [
{
"name": "1-1",
"metadata": "stage1-1",
"contents": [
{
"metadata": "normal",
"completeAcquireActions": [
{
"action": "Gs2Experience:AddExperienceByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"
},
{
"action": "Gs2Inventory:AcquireItemSetByUserId",
"request": "{\\"namespaceName\\": \\"gold\\", \\"inventoryName\\": \\"wallet\\", \\"itemName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"acquireCount\\": 100, \\"expiresAt\\": null}"
}
],
"weight": 99
},
{
"metadata": "rare",
"completeAcquireActions": [
{
"action": "Gs2Experience:AddExperienceByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 10}"
},
{
"action": "Gs2Inventory:AcquireItemSetByUserId",
"request": "{\\"namespaceName\\": \\"gold\\", \\"inventoryName\\": \\"wallet\\", \\"itemName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"acquireCount\\": 500, \\"expiresAt\\": null}"
}
],
"weight": 1
}
],
"consumeActions": [
{
"action": "Gs2Stamina:ConsumeStaminaByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"staminaName\\": \\"quest\\", \\"userId\\": \\"#{userId}\\", \\"consumeValue\\": 5}"
}
],
"failedAcquireActions": [
{
"action": "Gs2Stamina:RecoverStaminaByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"staminaName\\": \\"quest\\", \\"userId\\": \\"#{userId}\\", \\"recoverValue\\": 5}"
}
],
"premiseQuestNames": [
]
},
{
"name": "1-2",
"metadata": "stage1-2",
"contents": [
{
"metadata": "normal",
"completeAcquireActions": [
{
"action": "Gs2Experience:AddExperienceByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"
},
{
"action": "Gs2Inventory:AcquireItemSetByUserId",
"request": "{\\"namespaceName\\": \\"gold\\", \\"inventoryName\\": \\"wallet\\", \\"itemName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"acquireCount\\": 200, \\"expiresAt\\": null}"
}
],
"weight": 98
},
{
"metadata": "rare",
"completeAcquireActions": [
{
"action": "Gs2Experience:AddExperienceByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"experienceName\\": \\"player\\", \\"propertyId\\": \\"player\\", \\"experienceValue\\": 20}"
},
{
"action": "Gs2Inventory:AcquireItemSetByUserId",
"request": "{\\"namespaceName\\": \\"gold\\", \\"inventoryName\\": \\"wallet\\", \\"itemName\\": \\"basic\\", \\"userId\\": \\"#{userId}\\", \\"acquireCount\\": 1000, \\"expiresAt\\": null}"
}
],
"weight": 2
}
],
"consumeActions": [
{
"action": "Gs2Stamina:ConsumeStaminaByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"staminaName\\": \\"quest\\", \\"userId\\": \\"#{userId}\\", \\"consumeValue\\": 5}"
}
],
"failedAcquireActions": [
{
"action": "Gs2Stamina:RecoverStaminaByUserId",
"request": "{\\"namespaceName\\": \\"basic\\", \\"staminaName\\": \\"quest\\", \\"userId\\": \\"#{userId}\\", \\"recoverValue\\": 5}"
}
],
"premiseQuestNames": [
"1-1"
]
}
]
},
{
"name": "sub",
"metadata": "SUB",
"quests": [
{
"name": "1-1",
"metadata": "stage1-1",
"contents": [
{
"metadata": "normal",
"completeAcquireActions": [
{
"action": "Gs2JobQueue:PushByUserId",
"request": "{\\"namespaceName\\": \\"queue-0001\\", \\"userId\\": \\"#{userId}\\", \\"jobs\\": [{\\"scriptId\\": \\"script-0001\\", \\"args\\": {}, \\"maxTryCount\\": 3}]}"
}
],
"weight": 1
}
],
"premiseQuestNames": [
]
}
]
}
]
}
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
JSONファイルの形式についてはドキュメントを参照ください。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32文字 | ネームスペース名 | |
settings | string | ✓ | ~ 5242880文字 | マスターデータ |