Method structures

On this page, you’ll learn about the overall structure of a TentuPlay event method.

Describe behaviors in sentence

A TentuPlay method can be constructed using a sentence that describes the player’s behavior to be collected in terms of data in games.

For example, let’s consider the following sentence that depicts who did what, when and where during a game.

  • While player XYZ is taking the role of character ABC,

  • the player used 50 golds to enhance "Sword of Magic,"

  • and 1270 golds were left.

This can be written as follows:

UseCurrency(player_uuid: "XYZ", //player XYZ
character_uuid: "ABC", // took the role of character ABC
currency_slug: "GOLD", // used GOLD
currency_quantity: 50, // used 50
currency_total_quantity: 1270, // 1270 were left
where_to_entity: entity.LevelUpEquipment // used GOLD to level up the equipment
where_to_category_slug: "Sword", // the category of equipment was sword
where_to_slug : "Sword of Magic"); // the equipment was "Sword of Magic"

Describe contexts

When illustrating a player’s actions in sentences, it is important to describe "where", "how", and "why" the player did something by using event methods wherever possible.

There are three groups of parameters in use depending on contexts as shown in the following table.

Context Parameters

Acquisition

from_entity, from_category_slug, from_slug

Consumption

where_to_entity, where_to_category_slug, where_to_slug

Ad view

placed_at, placed_at_slug

Acquistion context

The acquisition parameters are used in contexts where the Get methods are involved such as GetCharacter, GetPet, and GetCurrency. They contain the information about where and from what the player obtains something.

Parameter Description

from_entity

The action that causes the player to gain an object

  • An event method is used as a value of from_entity.

  • There is a difference between purchase event methods depending on payment options. If the player purchased an item with in-game currencies, the value of from_entity should be ShopPurchase. If purchasing an item with real money, it should be InAppPurchase.

from_category_slug

The type of acquistion place, source, or situation

from_slug

The place, source, or situation of acquisition

Example code
GetEquipment(player_uuid: "XYZ", //player XYZ
character_uuid: "ABC", // took the role of character ABC
item_slug: "Swords of Magic", // got "Swords of Magic"
item_quantity: 1, // 1
from_entity: entity.PlayStage // at stage
from_category_slug: "Forest of Secret" // the category of stage was "Forest of Secret"
from_slug: "Forest of Secret 1-2"); // the stage was "Forest of Secret 1-2"

Comsumption context

The compsumption parameters are used in contexts where the Use methods are involved such as UseCurrency and UseToken. They contain the information about where and for what the player consumes something.

Parameter Description

where_to_entity

The purpose for which the player consumes an object

  • An event method is used as a value of where_to_entity.

  • There is a difference between purchase event methods depending on payment options. If the player purchased an item with in-game currencies, the value of from_entity should be ShopPurchase. If purchasing an item with real money, the same should be InAppPurchase.

where_to_category_slug

The type of consumption place or outcome

where_to_slug

The place or outcome of consumption

Example code
UseCurrency(player_uuid: "XYZ", //player XYZ
character_uuid: "ABC", // took the role of character ABC
currency_slug: "DIAMOND", // used DIAMOND
currency_quantity: 50, // used 50
currency_total_quantity: 30, // 30 were left
where_to_entity: entity.ShopPurchase // used DIAMOND for in-app purchase
where_to_category_slug: "Shop", // the category of the place of purchase is the shop
where_to_slug : "GOLD 2000"); // bought 2000 gold package at the shop

Ad view context

The ad view parameters are used in contexts where the WatchAd method is involved. They contain the information about where and when the player see advertisements.

Parameter Description

placed_at

The action of the player when watching an ad

An event method is used as a value of placed_at.

placed_at_slug

The place where the ad is

Example code
WatchAd(player_uuid: "XYZ", //player XYZ
character_uuid: "ABC", //took the role of character ABC
ad_slug: "abcsef0293828zks", // Ad ID "abcsef0293828zks"
ad_type: adType.Interstitial, //Interstitial ad
placed_at: adPlacement.LoginApp, //showed when player login game
ad_status: adStatus.Start // ad started
placed_at_slug: "lobby"); //the ad was placed in the lobby