Samples and reference

Find demos, samples, and detailed references for what you want to build or learn.

This completes the adventure game tutorial. The resources below help you find implementations for a feature or look up API parameters when you need them during development.

Review the tutorial’s settings and concepts

Tutorial code and templates

Download chapter 1’s login C# script and Account template, or use the table below for later chapters. Replace C# files with the same name as directed in each chapter. Chapter 4 uses the code from chapter 3.

ChapterStudio view codeSDK C# codeSDK server settings
Chapter 2AdventureStudioView.csAdventurePlay.csadventure-game.yaml
Chapter 3AdventureStudioView.csAdventurePlay.cs
AdventurePlayer.cs
adventure-game.yaml
Chapter 5AdventureStudioView.csAdventurePlay.cs
AdventurePlayer.cs
adventure-game.yaml
Chapter 6AdventureStudioView.csAdventurePlay.cs
AdventurePlayer.cs
adventure-game.yaml
Chapter 7Use chapter 6’s codeUse chapter 6’s codeadventure-game.yaml
Chapter 8AdventureStudioView.csAdventurePlay.csUse chapter 7’s settings

Find a feature

FeatureTutorialDetailed reference
Account creation and loginChapter 1Account API (new tab)
Quests and completion rewardsChapter 3Quest API (new tab)
Read coin balancesChapter 3Money2 API (new tab)
Spend staminaChapter 5Stamina API (new tab)
Buy stamina with coinsChapter 6Transaction settings (new tab)
Change rewards and add questsChapter 7Master data management (new tab)
Synchronize charactersRealtime chapterSynchronization tutorial (new tab)

Reduce requests at startup

As your screens use more data, you can fetch player data in one batch with LoadUserDataAsync after login. The results enter the SDK cache and are used by subsequent data reads.

await Gs2.LoadUserDataAsync(login);

Make this call after login, before individual screens begin fetching data. In the SDK tutorial, this is in AdventureLogin.cs, after Gs2.LoginAsync(...) returns and just before Session = login;. Later changes reach the screen through handlers or subscriptions such as SubscribeWithInitialCallAsync.

Batch loading reduces the requests needed for individual reads. It is not an additional requirement for resuming with the same player. See the GS2 blog introduction (Japanese, new tab) for details.

Explore demos and samples

When something does not work

Troubleshooting lists common symptoms and where to investigate. Start with the entry closest to your situation. For API parameters and errors, use the service references in the table above.