N-Testing

Introduction

N-Testing allows your game to run different configurations in runtime within a single build. N-Testing will automatically obtain the remote configuration and make it available through a class named DVR.

Getting Started

💡To use N-Testing it must be enabled in your Homa Belly Manifest. Please contact your Publish Manager or Support if you have any question.

You can generate a C# script that grants you access to N-Testing parameters. To generate this script: Open project settings window Edit > Project Settings, go to HOMA > N Testing section, click Update Script button

Screenshot 2023-12-12 at 12.37.07

Initialisation

Dynamic Variables are fetched on game start, you can check if remote values are fetched using this callback:


HomaGames.Geryon.Config.OnInitialized += () =>
{
     // remote values are now fetched
};
if (HomaGames.Geryon.Config.Initialized)
{
     // another way to check if remote values are fetched
}

Using Dynamic Variables

 

Starting with Homa Belly version 1.10.+, you have access to a new Dynamic Variable version 2 interface (DVR v2).

New projects will start with DVR v2 by default, and we recommend switching to v2 when possible. You can manage which version of the DVR interface you use in the HOMA > N Testing project settings.

Dynamic Variables will always contain the proper value once N-Testing is initialised. You should not persist dynamic variables. They may be updated either with configuration overrides, or using segmentation.

DVR v2

This version allows you to read the value directly, and/or be notified whenever the value changes in the future.

Here is an example with a "MAX_FPS" variable:


// Read the value once
Application.targetFrameRate = DVR.MaxFps;

// ==== AND/OR ====

// Subscribe a delegate that will be called every time the value is updated
DVR.MaxFps.Subscribe(newFpsValue =>
{
  Application.targetFrameRate = newFpsValue;
}, 
    // Setting this to true will cause the delegate to be called when Subscribe is invoked.
    // It is true by default
    notifyOnSubscribe: true);

DVR v1 (Legacy)

This version has fewer features. You can only read the configuration value.

For example, assuming you have a dynamic variable named VIDEO_ADS_ENABLED, you should use it like:


if(DVR.VIDEO_ADS_ENABLED)
{
    // Show rewarded video ad
}
else
{
    // Do nothing, as this test configuration
    // has VIDEO_ADS_ENABLED to false
}


N-Testing SDK exposed properties

N-Testing does expose some properties you might find useful

Identifiers

  • Config.NTESTING_ID: The N-Testing ID assigned to the specific game session
  • Config.ScopeId: The scope id assigned to the scpecific installation
  • Config.VariantId: The variant id assigned to the specific installation
  • Config.OverrideId: The override id assigned to the specific session

External Tokens

External tokens do provide some useful information that allows you to link N-Testing values with any other tool/platform. You should ask your Project Manager in order to use these values.

There are 5 external tokens available, each of them exposing different information. They can be accessed through Config class:


#region External tokens

        public static string ExternalToken0 { get; private set; }
        public static string ExternalToken1 { get; private set; }
        public static string ExternalToken2 { get; private set; }
        public static string ExternalToken3 { get; private set; }
        public static string ExternalToken4 { get; private set; }

#endregion

External Tokens and Game Analytics

Since Game Analytics 6.3.10.1 and Geryon (N-Testing) 3.0.1

The dev does not need to do anything here as Homa Belly takes care of everything!

We consider that ExternalToken0 and ExternalToken1 are reserved for Game Analytics as we take care of setting the correct values in our servers.

The same way, Game Analytics custom dimensions 01 and 02 are reserved and automatically configured (in Unity Editor) and filled (in runtime) by Homa Belly. No further action is required.


#Matching done automatically
Ntesting.ExternalToken0 <> GA.customDimension01
Ntesting.ExternalToken1 <> GA.customDimension02

Ntesting.ExternalToken0 / GA.customDimension01 is currently hidden from the UI as it will correspond to the future experiment custom ID (more info to come soon).

Ntesting.ExternalToken1 / GA.customDimension02 is already present in the Homa Lab UI here:

variant