Nx10 Logo
Docs

Predictive Forecasts

Look into the future. Forecast your player's emotional trajectory up to 15 minutes ahead.

Time as a Training Variable

While the real-time GBI and BCI indices tell you how a player feels now, the LFM's true power lies in using time as its primary dimension. By analyzing real-time kinematic data alongside historical baselines and SAAQ ground-truth labels, the LFM builds a deeply personal cognitive-affective profile for every user.

At its core, the LFM is a sequence predictor. Just as an LLM predicts the next word, the LFM predicts the next emotional state. It forecasts short-horizon state transitions (typically ±15 minutes), allowing you to proactively adapt experiences before a player even realizes they are getting frustrated or bored.

The Forecast Data Contract

Probability matrices and trajectory horizons.

When the backend pushes a forecast down to the Unity SDK via WebSockets, it doesn't give a simple binary answer. It provides a probability distribution across various affective trajectories.

Nx10.Models.LFMForecast.cs
public enum AffectiveTrajectory 
{
    SustainedFlow,      // High probability of remaining engaged
    CognitiveBurnout,   // Path to BCI depletion
    Tilt,               // Aggressive, frustrated gameplay loop
    SessionAbandonment, // High probability they will close the app
    Recovery            // Returning to a healthy baseline
}

public class LFMForecast 
{
    // The time horizon this prediction covers (default is 15)
    public int HorizonMinutes { get; }
    
    // A dictionary of states and their probability (0.0f to 1.0f)
    public IReadOnlyDictionary<AffectiveTrajectory, float> Probabilities { get; }
    
    // The single most likely trajectory
    public AffectiveTrajectory PrimaryTrajectory { get; }
    
    // How far the user is currently drifting from their historical baseline
    public float BaselineDeviationScore { get; }

    // Helper method
    public float GetProbability(AffectiveTrajectory trajectory) 
    {
        return Probabilities.TryGetValue(trajectory, out float prob) ? prob : 0f;
    }
}

Accessing the Data

Just like the real-time indices, long-term sequence prediction is computed entirely in the LFM to preserve client device resources. Forecasts are pushed down asynchronously. You can consume these forecasts via two distinct routes depending on your game architecture.

Route 1: In-Game (Unity Client)

The easiest way to consume forecasts is directly inside your Unity project. The Nx10 SDK maintains a secure WebSocket connection to the cloud and raises C# events whenever a new forecast is available.

LFMDirector.cs
using Nx10;
using Nx10.Models;
using UnityEngine;

public class LFMDirector : MonoBehaviour
{
    void OnEnable()
    {
        Nx10Manager.Instance.Insights.OnLFMForecastUpdated += HandleForecast;
    }

    private void HandleForecast(LFMForecast forecast)
    {
        float churnRisk = forecast.GetProbability(AffectiveTrajectory.SessionAbandonment);
        float tiltRisk = forecast.GetProbability(AffectiveTrajectory.Tilt);

        if (churnRisk > 0.85f)
        {
            Debug.Log($"[LFM WARNING] 85% chance of session end within {forecast.HorizonMinutes} mins.");
            MonetizationManager.Instance.OfferHighValueRetentionBundle();
        }
        else if (tiltRisk > 0.70f)
        {
            Debug.Log($"[LFM WARNING] Player is entering Tilt.");
            MatchmakingSystem.Instance.NextMatchPreference = MatchDifficulty.Relaxed;
        }
    }
}

Route 2: Server-to-Server Webhooks

If your game uses authoritative dedicated servers (e.g., for matchmaking, persistent progression, or anti-cheat), you may not want to trust the client to handle predictive states. You can configure the Nx10 Control Plane to fire Webhooks directly to your backend.

server.js (Node.js / Express)
app.post('/api/nx10/webhooks', express.json(), (req, res) => {
    
    const { deviceId, eventType, payload } = req.body;

    if (eventType === 'lfm_forecast_alert') {
        const forecast = payload.lfmForecast;
        
        const tiltRisk = forecast.probabilities['Tilt'] || 0;
        
        if (tiltRisk > 0.80) {
            console.log(`[MATCHMAKING] User ${deviceId} has an 80% chance of Tilting.`);
            
            // Server authoritatively adjusts the player's matchmaking pool
            matchmakingService.assignToCasualPool(deviceId);
        }
    }

    res.status(200).send('Received');
});

The Data Moat: Cold Start vs. Longitudinal

The true power of the LFM lies in the fact that it learns your specific players. But how does it work on day one?

1. The Cold Start (Phenotyping)

When a brand new user installs your game, the LFM has no history for them. Within their first few minutes of playing, the SDK collects their base TAG data and compares it against population-wide Affective Phenotypes. It clusters them into a known archetype (e.g., "Aggressive Tapper, Low Tremor") to provide a highly accurate initial baseline and generalized forecast.

2. Longitudinal Observation (Per-User Embeddings)

As the user plays your game over days and weeks, the LFM continually retrains. It generates a unique, compact vector (a Per-User Embedding) that represents their individual affective pattern. It learns what their specific frustration looks like, independent of the population. This builds a massive Data Moat - the longer they play, the more profoundly the model understands them, and the more perfectly your game can adapt to them.