How to read DVR/N-Testing values in a way compatible with segmentation?

How to determine if an N-Testing variable in your game can be used in segmentation, and how to build your game's code around segmentation

Here is the main challenge when working with segmentation: How to craft an experience as coherent as possible for the user, while still tweaking its parameter based on its behaviour.

Part 1: assessing balance between coherence and manoeuvrability

This question is the first you want to ask yourself when you want to use segmentation for a part of you game. Because players will create a mental model of your game, and changing variables against this mental model can easily worsen the user experience.


Let's take an example: Let's say my game is an auto-chess, where the player's fighter configuration competes automatically against the game's configuration (think of Merge Master).  And let's say the user discovered that an archer level 2 can kill a dinosaur level 2 in 5 arrows. If after level 7 for some reason an archer level 2 kills their level 2 dinosaur in 2 shots, then the game will look rigged.
But if instead they see a "damage multipliers" pop-up for archers for this level, then this change in power is expected, and it will feel that the game still "plays by the rules".

The effect of segmentation will greatly vary between the different types of variables. Obviously the more hidden ones will be safer to change, like loot tables for a surprise chest.


Note: try not to remove features using segmentation! It would be detrimental to the user experience. Move them behind a paywall instead (soft of hard currency). Adding features through segmentation is fine though. 

Part 2: designing code around segmentation

To work with segmentation, you will need to be familiar with DVR v2, and have it enabled in your game. See this article for more information.

Once you have decided which variables you want to use with segmentation, developers need to make sure that changes of this variable value will not cause issues in the game.

⚠️ When using segmentation, the values can change at truly anytime during gameplay!


Here are a couple of things to be aware of:

Contract breaking

This is the most important design feature to think about when using segmentation: do not break the contract you have with the user. This is even more essential when you know that variable updates can happen anytime.

For example: if the player opens an IAP screen, that will give the player 500 gems. But this gem count is controlled by segmentation, and between the screen opening and the player clicking "purchase", the gem count is reduced to 200. The player will buy what they think is a 500 gems pack, and only receive 200.
This is worst case scenario because real money is involved, but that can be applied to any 2-step action where you show the effect before the player commits to the action. This can also easily happen with rewarded videos.

How to fix: you should save the value in the pop-up's controller itself, to ensure consistency. You can update the value every time the pop-up is opened, if the pop-up stay opened during the whole process.

Changing game values mid-gameplay

If you need to update gameplay related values, you should probably wait for the time between levels. If your game does not have levels or the levels are too big, have a look at the "Make transition smooth" section.

Default values behaviour

Some N-Testing values describe the default values of a system, that the player will be able to override later. For example, should sound be enabled by default? Or do I want this screen to be shown at the start of every game?

Most of the time, those values do not work well with segmentation. But if you want to make one work with the system, make sure that the default value is not saved as if it was user input, in case this default value change in the future.

Make sure preparation is done before main work!

If you want to toggle features with segmentation, and if those features require some actions beforehand, make sure those actions are taken care of! You can make use of the DVR.YourValue.ValueChanged event for that.

Example: if you want to toggle high value ads using segmentation, you must make sure that you call LoadHighValueX() methods when the toggle switches from false to true.

Make transition smooth

If you want some element to change values, but those values are always available to the user, then you could make use of linear interpolation (Lerp)!

For example: Let's say your game is non-linear, and taking place on islands. You could want to change the colour of the ocean. But there is always a piece of ocean on the screen, so changing its colour discreetly will not be an easy task. That is where lerp comes in: when the colour changes in N-Testing, you can instead of swapping it, lerp between the two values, to transition smoothly. This is particularly effective if the object changing is not the centre of the attention.