Game data and request flow

Review settings, player data, and the roles of Unity and GS2.

Use this page to review the data concepts from the tutorial in one place. Each chapter also explains the concepts needed for its steps.

Game settings and player data

A game has rules you define in advance and values that change as people play.

“Completing Forest exploration grants 10 coins” is a game setting. “This player has 30 coins” is data for an individual player. GS2 manages these separately.

TermExample in this gameWhen it changes
Master dataForest exploration rewards 10 coinsA developer changes and deploys the settings
User dataThis player has 30 coinsPlayer actions or server processing

For example, when a player with 30 coins completes Forest exploration, GS2 reads the reward settings and adds 10 coins. The stored balance becomes 40.

The Unity game client handles screens, effects, and button input. When the player clicks the start button, Unity requests that GS2 start the adventure. GS2 checks the settings and player data, processes the request, and returns the result for Unity to display.

Developers deploy settings

flowchart LR
    A[Configure rewards and costs] --> B[Deploy to GS2]
    A --> C[Display data for Unity]
    B --> D[Settings used by GS2]
    C --> E[Lists and screen display]

First, configure rewards and the stamina needed for adventures, then deploy to GS2. If Unity uses assets to display product names or prices, update those too.

When changing a product’s price, update both the amount actually charged and the price shown on screen. Check that they match when making a purchase.

Players perform actions

sequenceDiagram
    participant P as Player
    participant U as Unity
    participant G as GS2
    P->>U: Start the quest
    U->>G: Specify player and quest
    G->>G: Check requirements and start the quest
    G-->>U: Result
    U-->>P: Show progress and stamina
    P->>U: Complete the quest
    U->>G: Report quest completion
    G->>G: Grant rewards and finish the quest
    G-->>U: Result
    U-->>P: Show coins and progress

Services used in this game

ServiceRole in this tutorial
GS2-Account and authenticationIdentify and log in players
GS2-QuestManage quest settings and adventures in progress
GS2-Money2Manage free coins earned as rewards
GS2-StaminaManage stamina consumed by adventures
GS2-ExchangeProcess coin spending and stamina recovery as one operation

GS2-Exchange powers the shop where players spend coins to restore stamina. Configure TransactionSettingV2 (new tab) so the payment and recovery are processed together.

Think it through

“Change the forest reward to 15”, “Increase my coins by 15”, and “Show a reward of 15 in the list”: which changes master data, user data, or the display? Understanding the difference helps you decide where to look when settings change but the screen does not.