Nx10 Logo
Docs

Real-Time Indices

Lightning-fast cloud inference. Listen to the LFM's real-time outputs to adapt your game loop instantly.

How Real-Time Inference Works

As the SDK quietly streams telemetry from the device, the LFM acts as a highly-optimized inference engine. It interprets how a person feels right this millisecond by rapidly analyzing roughly 50 constructed kinematic variables (e.g., tremor amplitude, stroke speed, tap cadence, pressure variance).

Because this layer runs on our specialized infrastructure rather than the user's device, it operates with sub-120ms latency while keeping your game's CPU and battery footprint completely untouched. It streams two primary indices back to your game code via WebSockets: the Game Behaviour Index (GBI) and the Brain Charge Index (BCI).

Game Behaviour Index (GBI)

The spectrum of engagement, mapping boredom to frustration.

The GBI measures mechanical arousal and valence. When a player is bored, their kinematic energy drops (slow, lazy, rhythmic sweeps). When frustrated, their kinematic energy spikes chaotically (hard taps, high-velocity erratic micro-movements, heavy pressure).

The Data Contract

Nx10.Models.GBIState.cs
public enum GBIStateCategory 
{
    SevereBoredom = -2,
    MildBoredom = -1,
    FlowState = 0,
    MildFrustration = 1,
    SevereFrustration = 2
}

public struct GBIState 
{
    // Ranges from -1.0 (Boredom) to +1.0 (Frustration). 0.0 is perfect Flow.
    public float Score; 
    
    // The categorized bucket for easy switch-statements
    public GBIStateCategory Category;
    
    // 0.0 to 1.0 indicating how confident the LFM is in this reading
    public float Confidence; 
    
    public DateTime TimestampUTC;
}
✅ What it CAN tell you
  • If the current difficulty is perfectly balanced.
  • The exact second a boss fight goes from "challenging" to "unfair".
  • If the player is mindlessly grinding without engagement.
❌ What it CANNOT tell you
  • Why they are frustrated. (Is it the game mechanics, or did they just spill their coffee?)
  • Long-term emotional health. GBI is strictly a measurement of the immediate present.

Brain Charge Index (BCI)

The measure of cognitive load, attention, and mental fatigue.

Every intense interaction drains cognitive capacity. The BCI looks at the degradation of precision and reaction timing to estimate how much "Brain Charge" the user has left before their performance falls off a cliff or they abandon the session.

The Data Contract

Nx10.Models.BCIState.cs
public enum TrendDirection 
{
    Decreasing = -1,
    Stable = 0,
    Increasing = 1 // Cognitive recovery (e.g., during a loading screen or chill zone)
}

public enum BCILevel 
{
    Depleted = 0, // High risk of churn / mistakes
    Fatigued = 1,
    Optimal = 2,
    Peak = 3      // Hyper-focused
}

public struct BCIState 
{
    // Ranges from 0.0 (Depleted) to 1.0 (Peak Focus)
    public float Score;
    
    public BCILevel Level;
    public TrendDirection Trend;
    
    // Milliseconds since the last significant shift in BCI
    public long TimeInStateMs; 
}
✅ What it CAN tell you
  • When a player needs a breather or pacing shift.
  • If your tutorial is demanding too much reading/attention at once.
  • Whether a player is actively recovering during inventory management.
❌ What it CANNOT tell you
  • If the player is physically sleep-deprived (it measures active cognitive load, not global biology).
  • Their IQ or inherent skill level. It only measures their relative cognitive expenditure against their own baseline.

Accessing the Data

You can access the GBI and BCI data through two different routes depending on whether your game relies on client-side or server-side authority.

Route 1: In-Game (Unity Client)

The most common approach is subscribing directly to the SDK's C# events within Unity. The SDK maintains a fast WebSocket connection to the LFM, raising events in your game instantly. This allows for instantaneous, client-side interventions like spawning a health pack or slowing down enemy animations.

EmotionController.cs
public class EmotionController : MonoBehaviour
{
    void OnEnable()
    {
        Nx10Manager.Instance.Insights.OnGBIUpdate += HandleGBI;
        Nx10Manager.Instance.Insights.OnBCIUpdate += HandleBCI;
    }

    private void HandleGBI(GBIState state)
    {
        // Only react if the model is confident
        if (state.Confidence < 0.6f) return;

        if (state.Category == GBIStateCategory.SevereFrustration)
        {
            GameDirector.Instance.LowerAggroRadius();
        }
    }

    private void HandleBCI(BCIState state)
    {
        if (state.Level == BCILevel.Depleted && state.Trend == TrendDirection.Decreasing)
        {
            GameDirector.Instance.TriggerSafeZoneEvent();
        }
    }
}

Route 2: Server-to-Server Webhooks

If your game uses authoritative dedicated servers, you can configure the Nx10 Control Plane to fire Webhooks to your backend whenever a player crosses a critical emotional threshold.

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

    if (eventType === 'gbi_critical_threshold') {
        const gbi = payload.gbiState;
        
        if (gbi.category === 'SevereFrustration') {
            console.log(`[GAMEMASTER] User ${deviceId} is highly frustrated.`);
            
            // Send a command down to the connected game server instance to spawn an easy loot drop
            gameServerOrchestrator.dispatchCommand(deviceId, "SPAWN_LOOT_DROP");
        }
    }

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