TentuPlay

Documentation

SDK Version:
Language:

Download the TENTUPLAY Unity SDK

Download the TentuPlay Unity SDK Package.

Unity should be 2017 or later and .NET should be 3.5 equivalent or later.

Import the TENTUPLAY Unity SDK

Download the TentuPlay Unity SDK Package. In Unity Editor, click Menu-Assets-Import Package-Custom Package and select the downloaded SDK.

_TentuPlaySDKDemo
You can learn how to use TENTUPLAY SDK through the demo game.

TentuPlay
The core of TENTUPLAY. Dll files, scripts and prefabs are included.

Plugins
3rd party plugins to run TENTUPLAY.

TPAdviceTemplates
The template scripts and prefabs provided for the TENTUPLAY advice UI.

Using TENTUPLAY

  1. Collect game log using TENTUPLAY SDK

    1. Upon game events, call adequate methods of TPStashEvent class.
    2. The game event logs are collected in the client devices' database.
    3. Collected logs are uploaded to the server in every Upload Data Interval (sec) or when UploadData is called.
  2. Data analysis using TENTUPLAY's behaviour analysis AI technology.

    1. Data data uploaded onto the server is analyzed.
    2. In-game guides are created for each player.
    3. These in-game guides include personalized messages and item or purchase recommendations.
  3. Send in-game guide.

    1. Send personalized guides using TPMentor class.
    2. Templates for advice scripts and prefabs are provided in TPAdviceTemplates and can be easily customized to fit your game UI.

Configure TentuPlay Settings

How to Configure in Unity Editor:

To configure the SDK for use with your game, select TentuPlay - Edit Settings from the menu bar.

Api Key: The TentuPlay API Key for the authentication. You can create or get your project credential from TentuPlay Console - Project - Project Settings - General - Project Credentials.

Secret: The TentuPlay API Secret Key the authentication. You can create or get your project credential from TentuPlay Console - Project - Project Settings - General - Project Credentials.

TentuPlay Debug Mode: Select this option to debug TENTUPLAY. Turn this option off for the deploy build. It may be redundant.

Auto Upload: Select this option to automatically upload data from clients' devices to the server. Warning: Call TP functions only on main thread or Turn off autoUpload in settings and manually upload on mainthread.

Upload Interval (sec): The minimum interval for the upload. (Default value is set to 1200.)

How to Configure in the Script

Assign static fields of TentuPlaySettings class prior to the very first TentuPlay Class declaration, and you can configure TentuPlay Settings without TentuPlaySettings.asset.

using TentuPlay;
TentuPlaySettings.ApiKey = "MY_API_KEY";
TentuPlaySettings.Secret = "MY_SECRET_KEY";
TentuPlaySettings.DEBUG = true; // Default is false
TentuPlaySettings.UsePersistDBConn = false; // Default is false
TentuPlaySettings.AutoUpload = true; // Default is false
TentuPlaySettings.DeferredSendIntervalSec = 1200; // Default is 1200

// The first class or method called.

SDK for Data Collection

TentuPlaySDKDemo

  1. TentuPlaySDKPlayerController is a component of the Player.

  2. You can refer to TentuPlaySDKPlayerController.cs for example on TPStashEvent.

How to Use Data Collecting SDK methods

Upon game events, call adequate methods of TPStashEvent class. Go to TentuPlay API Documentation for the details.

Debugging SDK for Data Collection

Get Started

  1. Make sure that TentuPlay Debug Mode is on.
  2. Make sure that Api Key and Secret Key is correct.
  3. Check Auto Upload if you want to use the auto upload option.
  4. In the Unity Editor, throw a game event that includes TPStashEvent.

Debugging Data Collecting and Uploading

  1. When the uploading is successful, you will see this message in Unity Editor console: TPDebug||Upload successful: SUCCESS_MESSAGE
  2. When the uploading is failed, you will see this message in Unity Editor console: TPError||Upload Error: ERROR_MESSAGE
  3. When the uploading is successful, you can inspect the last 100 events uploaded in the TentuPlay Console - Project - Project Settings - SDK Status.

SDK for In-game Guides

Get Started

The result of TentuPlay's game data analysis should be preceded.

TentuPlaySDKDemo

  1. TPAdviceController in the Canvas is a controller to show advice dynamically.
    TPAdviceController.prefab is under Assets/TentuPlay/TPAdviceTemplates.

  2. TentuPlayCRMPlayerController is a component of the Player.

  3. Value for the field tpAdviceController of TentuPlayCRMDemoController is TPAdviceController of the Canvas.

  4. TentuPlay loads Advices corresponding to the player_uuid and shows them dynamically.

In the demo game, player 'TentuPlayer' can click the mailbox while playing the game and open the sample in-game guide. Find more detailed explanation and example in the TentuPlayCRMPlayerController.cs.

Using Advice UI

Get Started

  • Advice UI prefab and script for Non-Paying User with High Expectations persona is under:
    • Assets/TentuPlay/TPAdviceTemplates/Resources/TPAdviceWindowUINonpaying_Players.prefab
    • Assets/TentuPlay/TPAdviceTemplates/TPAdviceWindowUINonpayingPlayersController.cs
  • Advice UI prefab and script for Smart and Busy persona is under:
    • Assets/TentuPlay/TPAdviceTemplates/Resources/TPAdviceWindowUISmart_And_Busy.prefab
    • Assets/TentuPlay/TPAdviceTemplates/TPAdviceWindowUISmartAndBusyController.cs

TPAdviceWindowUI

  • Root GameObject: U Dialog and TPAdviceWindowUI{SomePersona}Controller are the components.

  • Close button: - Root GameObject: U Dialog and TPAdviceWindowUI{SomePersona}Controller are the components.

  • Button for item or in-app purchases:
    • TPAdviceWindowUI{SomePersona}Controller.GoToAdviceEvent is included in the On Click Event.
    • Item Id Viewer and Go To Shop Example logs item id in the Unity Console when the button is clicked. They are a sample function.

  • Contents of Advice: Modify the contexts of PlaceAdvice in TPAdviceWindowUI{SomePersona}Controller.cs.