Why Frame Time Matters

Game performance can be described using both frames per second (FPS) and frame time.

  • Frame time measures how long it takes to produce one frame.
  • More work during a frame can increase frame time.
  • Systems such as AI, animation, physics, and rendering can all contribute to per-frame workload.
  • For this example, we use 60 FPS as a performance target.

At 60 FPS, the available time per frame is approximately:

\[ \frac{1000\text{ ms}}{60} = 16.67\text{ ms} \]

Source: Epic Games, Introduction to Performance Profiling and Configuration in Unreal Engine.

The Performance Data

To demonstrate the statistical method, this presentation uses a simulated game profiling dataset.

Each observation records:

  • active enemy count
  • frame time in milliseconds
  • corresponding estimated FPS

Enemy counts range from 10 to 200, with four simulated profiling observations at each level.

Research Question

How does frame time change as the number of active enemies increases?

The data are simulated for demonstration purposes and do not represent measurements from a specific commercial game.

Enemy Count vs. Frame Time

The simulated observations suggest a positive relationship: scenes with more active enemies tend to have higher frame times.

Simple Linear Regression

Simple linear regression models the relationship between one explanatory variable and one response variable.

\[ Y = \beta_0 + \beta_1X + \varepsilon \]

For this analysis:

\[ \text{Frame Time} = \beta_0 + \beta_1(\text{Enemy Count}) + \varepsilon \]

  • \(\beta_0\) = intercept
  • \(\beta_1\) = expected change associated with one additional enemy
  • \(\varepsilon\) = unexplained variation

Source: NIST/SEMATECH Engineering Statistics Handbook, Linear Least Squares Regression.

Interpreting the Fitted Model

The model fitted to the simulated profiling data is:

\[ \widehat{\text{Frame Time}} = 6.26 + 0.054(\text{Enemy Count}) \]

The fitted slope is approximately 0.054 milliseconds per enemy.

For an increase of 10 active enemies, the model predicts an average increase of approximately:

\[ 10 \times 0.054 = 0.54\text{ ms} \]

This is an estimated relationship within the simulated data, not a universal performance rule for all games.

Regression Fit and the 60 FPS Budget

The dashed line marks the approximately 16.67 ms frame-time budget associated with 60 FPS.

Interactive Performance Explorer

Hover over points for profiling details.

R Code Behind the Analysis

R’s lm() function is used to fit linear models.

performance_model <- lm(
  frame_time ~ enemy_count,
  data = performance_data
)

summary(performance_model)

ggplot(
  performance_data,
  aes(
    x = enemy_count,
    y = frame_time
  )
) +
  geom_point() +
  geom_smooth(method = "lm")

Source: R Core Team, R Documentation: Fitting Linear Models (lm).

What This Means for Game Development

In this simulated profiling example:

  • frame time tends to increase as enemy count increases
  • regression summarises the relationship with an interpretable slope
  • a frame-time budget provides a practical performance reference
  • profiling data can help developers identify when optimisation may be necessary

Limitation

Real game performance may not remain linear. Enemy behaviour, AI complexity, pathfinding, animation, physics, rendering, hardware, and optimisation techniques can affect performance in ways that a simple model cannot fully capture.

Key Takeaway

Statistical modelling can help turn profiling data into information that supports performance and design decisions.

Sources

Epic Games.
Introduction to Performance Profiling and Configuration in Unreal Engine.
Epic Developer Community Documentation.

NIST/SEMATECH.
Engineering Statistics Handbook: Linear Least Squares Regression.
National Institute of Standards and Technology.

R Core Team.
R Documentation: Fitting Linear Models (lm).