Catalog / Software Engineering & IT Operations / CODE-024

Automated game testing & playtesting with AI agents

AI agents (RL, imitation-learning or vision-language) play game builds at scale inside Unity/Unreal to find crashes, soft-locks and progression bugs, check performance and inform balancing, with a report per build in CI.

Games are large, stochastic, real-time 3D worlds where every build can break progression, collision or performance somewhere. Scripted tests cover only the paths someone wrote down, and human QA cannot replay everything nightly. AI agents trained by reinforcement or imitation learning, or driven by vision-language models, play the build through an engine plug-in, explore at scale, flag crashes, soft-locks and out-of-bounds bugs and report per build in CI. They complement, not replace, human testers.

Problem & value

  • Today: studios combine manual QA (internal or outsourced, e.g. in crunch before milestones), scripted smoke tests, and engine test frameworks. Regression after content changes is expensive, and rare bugs (falling through geometry, quest flags that never fire, soft-locks after a specific action order) surface late or after launch.
  • AI value: many agents run overnight on every build; they cover large state spaces, repeat deterministically from a seed, and give humans a short list of suspicious spots with replays. Balancing agents of different skill levels estimate difficulty and completion time before human playtests.
  • Evidence: EA SEED published results of using deep RL agents to augment automated game testing, including finding bugs and testing level design [3]. Danish vendor modl.ai commercialises bot-based QA for Unity and Unreal [4]. Treat vendor claims about cost savings as unverified until piloted on your game.

Variants

  • Smoke/regression bots: navigate, interact and complete a defined route on every build; fail the pipeline on crash or stuck.
  • Exploration/coverage agents: curiosity-driven RL to reach unexplored positions and states; find holes in collision and navmesh.
  • Balancing/difficulty agents: multiple skill-level agents for card, strategy or racing games; analyse win rates and economy sinks (see CODE-018 for evaluation tooling, GEN-013 for content).
  • VLM-driven GUI testers: a vision-language model reads screenshots and operates menus, UI flows and mobile games without engine access (computer-use style); slower but engine-agnostic.

How it works

  1. nightly build (CI)
  2. deploy to test farm (PC/console dev kits/cloud GPU instances)
  3. engine plug-in exposes observations (state, raycasts, screenshots) and actions (input, API)
  4. agent policy (RL / imitation / VLM planner) plays scenarios with seeds
  5. detectors: crash dumps, exceptions, stuck/soft-lock, out-of-bounds, perf budget, visual anomalies
  6. triage: dedupe, cluster, attach replay + video + seed
  7. report + tickets; human QA verifies and decides
  • Policies: PPO/SAC-style RL trained in the game with reward shaping (progress, novelty, coverage), imitation/behaviour cloning from human demos, or a VLM/LLM planner calling high-level actions. Hybrid is common: a scripted/LLM layer sets goals, a learned policy handles low-level control.
  • Detectors are classic rules (crash, hang, NaN, timeout without progress, frame-time budget), optionally supplemented by anomaly detection on telemetry and VLM review of screenshots for visual glitches (z-fighting, missing textures).
  • Human-in-the-loop: QA leads define scenarios and reward goals, review findings, confirm and prioritise bugs; humans stay responsible for feel, fun, narrative, certification and platform compliance (TRC/TCR).

Data preparation

Needed are playable builds with a test API or instrumentation, level and content data, recorded human play sessions (for imitation learning), reward definitions, and bug history. In a studio this sits in the build server/CI, Perforce or Git LFS, the bug tracker and QA spreadsheets; video recordings often lie on file shares.

Typical gaps: builds without an automation hook, no observation/action interface, inconsistent bug labels, unlabelled recordings, missing definition of "what is a bug" versus "intended", and non-deterministic builds that make agent runs hard to reproduce.

Preparation steps: 1. Expose game state and actions through the engine's test interface (ML-Agents sensors, Unreal automation). 2. Make runs reproducible with seeds and headless build targets. 3. Harvest labelled bugs from the tracker as evaluation set (PREP-020, PREP-018). 4. Record 10 to 20 hours of human play and tag sessions, if imitation learning is used. 5. Define a taxonomy of findings (crash, soft-lock, visual glitch, balance) (PREP-019).

Tools: Unity ML-Agents, Unreal Gauntlet, Label Studio, FFmpeg. Share of effort: medium, around 30 percent. See GUIDE-003 and PREP-021 for feedback capture.

Implementation paths

Which path for whom

  • smb (B): Small studios get the best value from engine RL toolkits (Unity ML-Agents) plus cloud VLM APIs for visual checks, as no off-the-shelf product fits their game.
  • enterprise (C): Unreleased builds are valuable IP and test fleets need many GPUs, so a self-hosted agent stack on a shared internal platform pays off.
  • developer (C): Open-source RL libraries and local vision models run on your own GPU without sending builds to third parties.

Path A — Buy (off-the-shelf)

  • Game-QA bot platforms: modl.ai (Denmark, EU) with Unity/Unreal plug-ins [4]; others include Regression Games, GameDriver (Unity test automation), Altom AltTester (Romania, EU; Unity UI/automation), Razer QA Companion, and QA-services providers that use own agent tooling (e.g. Keywords Studios, Testronic). Check engine and console support, on-prem/EU hosting, NDA/IP handling of unreleased builds, CI integration.
  • Choose A when: mid-size studio, standard genres, no ML team, wish to start within weeks.

Path B — Build on cloud APIs

  • Recommended for most studios with some engineering capacity: use engine RL toolkits (Unity ML-Agents [1], Unreal Learning Agents [2]) plus a VLM/LLM planner via API for goals, menu navigation and screenshot triage (Claude, Gemini, GPT, Mistral with vision; EU regions or EU provider Mistral for pre-release content).
  • Infrastructure: cloud GPU/CPU fleets (EU regions) for parallel headless instances, orchestrated from GitHub Actions, GitLab CI, Jenkins or Perforce-based pipelines; results to Grafana/OpenSearch.
  • Choose B when: custom game mechanics, need for tight CI integration, moderate training budget.

Path C — Self-host (open source)

  • Training: Unity ML-Agents (Apache 2.0) [1], Unreal Learning Agents [2], Gymnasium-style environments [5], Stable-Baselines3 and RLlib for PPO/SAC, CleanRL for reference implementations, Godot RL Agents for Godot.
  • VLM layer: open-weight VLMs such as Qwen-VL family or Gemma-class models served with vLLM/Ollama for screenshot reading and menu navigation.
  • Hardware: simulation is often CPU-bound; HW3 (one pro GPU) plus many CPU cores trains and runs a modest farm; HW4 for large parallel pixel-based training. Studio-owned build farms typically already exist.

Path D — Custom training

Normal for this use case: policies are game-specific. Data is self-generated (self-play, exploration) and optionally human demonstrations from internal playtests (tens to hundreds of sessions for imitation). Invest when the game has long, complex progression, when you maintain a live-service title with frequent content drops, or when you reuse the agent framework across several titles. Generalist game agents (DeepMind SIMA [6]) are research, not yet a QA product.

State of the art (2026)

  • RL exploration agents with curiosity/coverage rewards are production practice at larger studios; published work shows they can find real bugs and test level design when combined with engine hooks [3].
  • VLM/LLM agents now make engine-agnostic GUI and menu testing feasible and cut the cost of writing scenario logic with natural language goals; they are slower, non-deterministic and weaker at fast real-time control.
  • Engine vendors ship RL toolkits directly (Unity ML-Agents, Unreal Learning Agents), lowering the entry barrier [1][2].
  • Limits and failure modes: reward hacking (agent exploits a bug as a "win" rather than reporting it); agents explore unlike humans, so coverage is not player realism; non-determinism makes repros flaky unless seeds and frame stepping are controlled; policies need retraining after major content or control changes; false positives (intended behaviour flagged) consume triage time; fun, readability and narrative cannot be judged by an agent; unmatched skill levels distort balancing. Public benchmarks for game-QA agents are scarce, so evaluate on your own seeded bug set (injected bugs with known locations).

Shared resources & combinations

  • RL + simulation stack is shared with other control/optimisation cases; the VLM/computer-use layer with CODE-004 (test generation), CODE-014 (bug triage, reproduction and fixing: feed agent findings into the same ticket flow) and CODE-018 (tracing/evaluation of the LLM planner).
  • Adjacent game cases: GEN-013 (content generation: test generated levels and dialogue), ANOM-036 (anti-cheat: same telemetry, different goal), SPEECH-023 (voice moderation).

Effort, cost & KPIs

  • Path A: weeks to integrate a plug-in and first scenarios; subscription or per-hour pricing, so request a pilot on a real build.
  • Path B/C/D: 2–9 months (plug-in, reward design, CI, triage); drivers are engineer time and farm hours.
  • KPIs: bugs found per build that humans confirm (precision) and share found before human QA (recall on injected bugs), coverage (% of navmesh/areas/quests reached), time to detect after the breaking commit, false-positive rate, triage hours per report, flaky-repro rate, human QA hours moved to exploratory testing.

People & change

Involve: management funds the pilot and accepts that agents complement, not replace, human QA. The QA lead is the process owner and defines what counts as a finding; developers (end users) must expose test hooks and read the reports. IT provides build agents and GPU capacity; legal/compliance checks licences of engines, platform rules and any third-party content in the test builds.

Works council: no, usually. Agents play the game, not employees, and the system does not evaluate people (§87(1) no. 6 BetrVG). It becomes relevant if human playtester sessions are recorded and analysed per person; then involve the council. Inform it under §90(1) no. 3 BetrVG when QA processes change. A DPO/DPIA matters only if real player or tester data (video, voice, telemetry) enters training or evaluation.

AI literacy: support QA staff (Art. 4 AI Act) with training on interpreting agent reports, false positives and the limits of RL coverage (GUIDE-006).

Pilot and communication: run agents alongside human QA on one level or build for 4 to 6 weeks and compare found bugs. Concern: "QA jobs disappear." Answer: agents take repetitive regression runs; testers focus on feel, fun and edge cases and decide which findings matter (GUIDE-008, GUIDE-009).

Risks, regulation & compliance

  • EU AI Act: minimal risk. A QA tool for software is not an Annex III use; no Art. 5 practice involved. Art. 4 AI literacy applies to staff. If the same agents later model player behaviour for monetisation or matchmaking, reassess separately (manipulative dark patterns fall under consumer-protection law and potentially Art. 5(1)(a) if subliminal/manipulative techniques cause harm).
  • GDPR: bots generate no personal data, but human demonstrations and telemetry from beta players or testers may contain personal data (account IDs, voice chat, behaviour). Get consent or anonymise; employee recordings fall under works-council co-determination in e.g. Germany.
  • IP/confidentiality: unreleased builds sent to cloud APIs need contracts, EU region and no-training terms.
  • Platform rules: console certification still requires manual verification; do not run bots against live servers without operator approval (terms of service, load, anti-cheat flagging).
  • Mitigations: seeded deterministic runs, human verification before closing tickets, keep a scripted baseline, audit log of agent versions.

Getting started

  1. Inject 20–30 known bugs (collision holes, soft-locks, broken triggers) into a branch as a measurable benchmark.
  2. Add engine hooks (ML-Agents or Learning Agents) and a headless build mode; make runs seedable.
  3. Start with a simple goal bot and a stuck/crash detector in nightly CI; measure the benchmark first.
  4. Add an exploration/curiosity agent and a VLM triage step for screenshots; compare precision against QA findings.
  5. Pilot one commercial platform (e.g. modl.ai) on the same benchmark before deciding build versus buy.

Sources

  1. Unity ML-Agents Toolkit — https://github.com/Unity-Technologies/ml-agents
  2. Epic Games — Learning Agents in Unreal Engine — https://dev.epicgames.com/documentation/en-us/unreal-engine/learning-agents-in-unreal-engine
  3. Bergdahl et al., EA SEED — Augmenting Automated Game Testing with Deep Reinforcement Learning — https://arxiv.org/abs/2103.15819
  4. modl.ai — AI-driven game QA and bots — https://modl.ai
  5. Farama Foundation — Gymnasium — https://gymnasium.farama.org
  6. Google DeepMind — SIMA, a generalist AI agent for 3D virtual environments — https://deepmind.google/discover/blog/sima-generalist-ai-agent-for-3d-virtual-environments/
  7. Regulation (EU) 2024/1689 (AI Act) — https://eur-lex.europa.eu/eli/reg/2024/1689/oj
  8. Stable-Baselines3 — https://github.com/DLR-RM/stable-baselines3