How to Test AI-Generated Games: Evaluation Methods and a Practical Checklist
This article explains why testing AI-generated games is fundamentally different from checking whether generated code compiles, and what a credible evaluation pipeline looks like. It covers the six most common evaluation mistakes, the limits of LLM-based subjective scoring and unit tests, how to build human-verified reference implementations, how to turn vague design intent into frame-level runtime assertions (with a runnable Python example), how to keep results reproducible under non-determinism and input jitter, a gated checklist with suggested thresholds and failure severity levels, and how to wire generation, execution, assertion, and feedback into a closed loop. It also notes why fully green automated gates still require human playtesting.
1. Why evaluating AI-generated games is hard: from “code is written” to “game is playable”
Once a large model can produce a runnable game prototype from a single natural-language description, the focus of evaluation shifts quickly from “can it generate code” to “can you actually play it.” These questions usually get filed under AI game testing, AIGC game evaluation, or generative game acceptance, but the real difficulty is not code quality. A game is a continuously evolving interactive process: does the character land after jumping, are collisions correct, does scoring follow the rules, does the game crash after abnormal player input. None of that can be proven by reading code statically or by looking at a single screenshot.
Common mistakes when evaluating AI-generated games fall into six categories, each with a fairly clear fix:
- Looking only at code or screenshots. A screenshot proves something existed in one instant; it cannot prove state evolution between frames. Fix: add frame-level trajectory replay and runtime assertions.
- Treating LLM subjective scoring as the final gate. Model scores fluctuate with the prompt, model version, and sampling configuration. Fix: use them only for early triage and failure explanation.
- Using unit tests instead of end-to-end evaluation. Unit tests suit pure functions and local logic, but playability depends heavily on dynamic interaction. Fix: add runtime scenario evaluation.
- Testing only the happy path. Testing only the path where “the player behaves as designed” misses pause, illegal input, repeated collisions, and abnormal restarts. Fix: add abnormal input and boundary scenarios.
- Fixing the random seed but still depending on wall-clock time. Jitter in real input timing makes the same action produce different results. Fix: use simulated frames, timestamp alignment, or frame-by-frame advancement.
- Hiding flaky failures behind retries. Retrying does not turn an unstable problem into a stable pass. Fix: mark any failure across multiple replays as flaky and handle it according to its risk level.
2. Where the two most common approaches stop working
2.1 LLM subjective scoring: fine for early triage, wrong as a final gate
LLM subjective scoring typically has the model read the game’s code, logs, or screenshots and then judge whether it is “playable,” whether “the gameplay is complete,” and whether “the visuals look wrong.” Its advantage is speed: it is good at catching obvious problems early, such as whether there is a menu, whether there is a character, whether input produces feedback, and whether the code structure is visibly a mess.
But it is not suitable as a standalone quality gate, for three reasons:
- Subjective scoring depends on the prompt, model version, and sampling parameters, so results fluctuate easily.
- Screenshots and code cannot fully express frame-to-frame state changes.
- Its ability to judge runtime issues such as physics, collision, timing, and input jitter is limited.
The workable rule: LLM subjective scoring is only for triage and explanation, and should not be merged with frame-level assertion gates into a single score. In other words, it can help surface things that “look wrong,” but it cannot replace evidence that “the game is playable.”
2.2 Unit tests: fine for pure logic, wrong for dynamic interaction
Unit tests reliably verify function-level inputs and outputs: score calculation, item counts, health boundaries, damage formulas, random seed initialization, and so on. If the game logic is decomposed into many pure functions, unit tests can significantly improve local reliability.
But the real difficulty in a game is continuous interaction. A test showing that “the jump function returns the correct value” does not prove the character remains stable under continuous movement, collision, gravity, frame stepping, and input jitter. Unit tests tend to slice interactive behavior into isolated points, losing frame-level state evolution — and frame-level evolution is exactly what playability hinges on.
So unit tests are appropriate for verifying local logic, but they cannot replace full runtime evaluation.
3. The core tension: the gap between design intent and runtime evidence
The structural contradiction in evaluating AI-generated games is that evaluation needs both to know “what this game was supposed to be” and to verify “what it actually does when it runs.”
| Observation method | What it provides | What it lacks |
|---|---|---|
| Code or screenshots only | A vague sense of design intent, e.g. there is a character, there is jumping, there is scoring | Reliable runtime evidence; cannot prove frame-to-frame trajectories, collisions, or landing behavior |
| Unit tests only | Local runtime results, e.g. formulas are correct, boundary values are correct | User-perceivable gameplay evidence; hard to prove a complete interaction loop |
| LLM scoring only | Fast subjective judgment, suitable for triage | A stable gate; results are easily influenced by prompts and model versions |
If the reference implementation and the generated artifact use different underlying mechanisms — for example, the reference uses a custom physics system while the generated artifact uses a third-party physics engine — you should not require identical code paths. The acceptance criterion should be player-perceivable behavior and observable runtime traces: under the same input script, whether key states, key events, and key results meet the acceptance criteria matters more than whether the implementation is the same.
4. How to build reference implementations: a human-verified comparison baseline
To close the gap between design intent and runtime evidence, one pragmatic approach is to build a set of human-verified reference implementations. A reference implementation is not a throwaway demo; it is a standard answer that has actually been run, interacted with, and put under version control.
Reference implementations should cover typical mechanics rather than chase quantity:
- Character movement and directional control;
- Jump, double jump, falling, and landing;
- Collision detection and boundary handling;
- Scoring and combos;
- Item pickup and consumption;
- State transitions such as pause, resume, fail, and restart;
- Win/loss determination;
- Player death and respawn;
- Input anomaly and illegal-action tolerance;
- Random seeds and reproducible runs.
Each reference implementation should record its version number, runtime environment, engine version, input script, acceptance criteria, sampling conventions, and manual verification record. Its value lies in serving three roles at once: an executable expression of design intent, a comparison baseline for runtime behavior, and a source for constructing automated assertions.
The build process can be reduced to four steps: first, pick typical mechanics; second, run them manually and confirm the experience is correct; third, record the input script, key trajectories, and acceptance fields; fourth, bring them into regression evaluation as a baseline for later generated artifacts.
5. From intent to evidence: frame-level runtime assertions
The key action in evaluation is translating vague human expectations into runtime constraints a program can execute. For example, “the character should be able to jump, should not jump absurdly high, and should land back on the ground” can become frame-level sampling and assertions.
Before writing assertions, you must state where runtime observability comes from. There are three common paths:
- The engine exposes a test interface. This is the ideal case: you can read position, velocity, state machine, score, and events directly, and replaying input is straightforward.
- Collect state through a debugger or in-process hooks. This suits cases where you cannot modify engine source but can attach a test framework. You need to confirm the collection overhead does not meaningfully change behavior.
- Under black-box conditions, you can only capture the screen and inject keyboard, mouse, or gamepad events. Here you can only make approximate judgments, for example deciding whether the character moved based on pixels or screen recognition. Such conclusions are clearly weaker than interface-level sampling and their limitations should be stated.
The example below is a frame-level check for a 2D platformer jump. The code assumes screen coordinates: the y axis points down, so y decreases when jumping up, and the apex is obtained with min(trajectory). If your engine uses y-up coordinates, use max(trajectory) instead and adjust the airborne and height assertions accordingly.
# Convention: screen coordinates, y axis points down; y decreases when jumping up.# EPS: floating-point tolerance, unit: pixels# LIMIT: maximum jump height, unit: pixelsEPS = 0.5LIMIT = 180.0class RuntimeEngine:"""Minimal interface contract. In real evaluations, the host framework provides a concrete implementation."""def launch(self, level_id: str, seed: int, fixed_fps: int):"""Launch the level and return a session object.The session object must at least provide:- step(): advance one frame- spawn_player(): obtain the player object- press(action: str): inject an input event"""raise NotImplementedError("Implemented by the host evaluation framework")def step(self):raise NotImplementedErrordef spawn_player(self):raise NotImplementedErrordef press(self, action: str):raise NotImplementedErrordef start_game_session(engine, level_id: str):"""Start the game, enter the given level, and return a session that automation can drive."""return engine.launch(level_id=level_id, seed=42, fixed_fps=60)def frames_until_land(game_session, player, ground_y: float, max_frames: int = 240):"""Record the y-coordinate trajectory from the current frame until landing or until max_frames is exceeded."""airborne = Falsetrajectory = []while len(trajectory) < max_frames:# In screen coordinates, y decreases when jumping up; on landing, velocity is downward (positive).# Both conditions must hold: "has left the ground" and "is currently descending",# so that standing still is not mistaken for landing.if airborne and player.velocity_y > 0 and player.position.y >= ground_y - EPS:breaktrajectory.append(player.position.y)game_session.step()# Mark as having been airborne as soon as the character leaves the ground.if player.position.y < ground_y - EPS:airborne = Truetrajectory.append(player.position.y)return trajectorydef require(condition: bool, message: str):"""Explicit check. In CI, avoid relying on assert, because python -O skips assert statements."""if not condition:raise RuntimeError(message)def verify_jump_mechanic(game_session):player = game_session.spawn_player()start_y = player.position.y# Inject jump inputgame_session.press("jump")trajectory = frames_until_land(game_session, player, ground_y=start_y)# In screen coordinates, the apex corresponds to the minimum y.apex_y = min(trajectory)landed_y = trajectory[-1]# The jump must leave the groundrequire(apex_y < start_y - EPS, "Jump had no effect: the character never left the ground")# Jump height must not exceed the design limitrequire(start_y - apex_y <= LIMIT, "Jump height exceeds the design limit")# The character should land within a reasonable number of frames, close to the start positionrequire(abs(landed_y - start_y) <= EPS, "Character did not land on time: gravity or collision logic may be broken")if __name__ == "__main__":# In real CI, the host evaluation framework injects a RuntimeEngine implementation:# engine = HostRuntimeEngine()# game_session = start_game_session(engine, level_id="tutorial_01")# verify_jump_mechanic(game_session)pass
This code reflects two key design ideas. First, intent is made explicit: “can jump, does not jump too high, must land” is written as clear checks. Second, evidence comes from runtime: instead of relying on reading code, it drives the game and collects frame-level state.
Note that python -O skips assert, so CI gates should use explicit exceptions, unit test framework assertions, or test runner assertions. Reproducibility prerequisites — such as a fixed random seed, fixed frame rate, recorded engine version, and pinned dependencies in a container — are covered in Section 6.
6. Boundary conditions and governance: making evaluation reproducible
Automated evaluation cannot cover only the happy path; it must also handle the uncertainty of real systems.
Non-determinism and reproducible baselines. Physics engines, frame rates, floating-point error, and random seeds can all make the same input produce different trajectories. Fix the random seed, fix the frame rate, record the engine version, pin the runtime in a container, and use tolerance-based assertions plus multiple replays. If you need to compare trajectories, align them by simulated frame or timestamp before comparing rather than relying on real wall-clock time.
Input timing jitter. Real input may be delayed or arrive out of order. Evaluation should use timestamped event queues and advance by simulated frames wherever possible. Input events should be aligned to frames so that results do not fluctuate with machine load.
Missing environment dependencies. Differences in GPUs, drivers, system libraries, and dependency packages across machines can change behavior. Use container images or standardized environment snapshots, run a dependency self-check before launch, and record information about failing environments.
Subjective scoring variance. LLM scores are easily influenced by prompts. Fix the prompt template, record the model version, and run multiple sampling rounds for triage, but do not use it as the only gate.
Security boundaries. Evaluation may need to execute model-generated code, launch game processes, and access files or network resources. Use isolated sandboxes, least privilege, resource limits, and dependency-source scanning to avoid supply-chain risk. Container startup and process execution should have clear permission boundaries and audit logging.
7. An executable checklist for a trustworthy evaluation system
Combine evaluation metrics with gate thresholds. The table below can serve as a starting template, but concrete thresholds need to be calibrated to your project type, risk level, and user experience goals.
| Check | Evidence type | Implementation action | Measurement and suggested gate |
|---|---|---|---|
| Launch rate | Startup logs, first-frame render, error codes | Cold-launch the game in a container environment and wait for the first frame | Successful sessions / launch attempts; suggested not below 98%, with at least 20 launch attempts |
| Interactability rate | Input events, state changes, action responses | Inject movement, jump, attack, pause, and other inputs | Injected events producing the expected state change / events that should respond; suggested not below 95% |
| Core mechanic pass rate | Frame-level trajectories, assertion results | Replay each core mechanic at least 3 times | Pass only if all N runs pass; any failure marks it flaky and is handled as P1 or P0 |
| Crash rate | Crash logs, exception stacks, process exit codes | Run continuously and apply abnormal input | Crashed sessions / total sessions; suggested not above 1%, and P0 failures must be 0 |
| Frame-level state sampling | Position, velocity, state machine, score, events | Record key fields every frame | Missing key fields / frames that should be sampled; suggested not above 1% |
| Reproducibility | Environment versions, random seed, input scripts | Repeat runs with the same version and same environment | Identical trajectories / total replays; suggested not below 95%, and must be calibrated per project |
Frame-level sampling should include at least: frame_id, timestamp, player_position, velocity, current_state, score, health, input_action, event_id, error_code.
Failure severity can be graded as follows:
- P0: cannot launch, black screen, crash, hang, or cannot enter the game;
- P1: core mechanic failure, e.g. jump does not land, collision passes through, scoring is wrong, or the game cannot resume after pause;
- P2: non-core experience issues, e.g. slightly off animations, wrong hint text, missing secondary sound effects.
Regression gates can be set as follows: P0 must be 0; if P1 failures exceed the threshold, block the release; P2 issues may enter a fix-later queue. Multiple retries may only be used to rule out environmental noise and must never turn a flaky failure into a pass. For core mechanics, a single failed replay means the item is unstable.
It is also worth stressing that a fully green automated gate does not mean the game is playable. AI-generated games still need human playtesting to confirm control feel, level pacing, visual feedback, and overall experience quality. Automation delivers “reproducible evidence”; humans deliver “experience judgment.”
8. Engineering it: the generate, evaluate, and feedback loop
Once evaluation is defined as a set of automatically executable checks, it fits naturally into the development workflow:
- Generate: the model produces game code, assets, and level configuration;
- Artifact hosting: build outputs, version numbers, and run scripts are stored in object storage;
- Container execution: pull the artifact in an isolated container and launch the game;
- Event collection: collect input, frame state, logs, crash information, and performance data;
- Assertion execution: run launch checks, interaction checks, mechanic validation, and regression tests;
- Report aggregation: summarize pass rates, failure types, trajectory data, and screenshot evidence;
- Feedback and fixes: route failures back to the generating model or to a manual fix process.
This loop can be built on general-purpose cloud capabilities such as object storage, container runtime, message queues, logging services, and monitoring and alerting, without locking into a single vendor or tool. What matters is not which platform you pick, but standardizing generation, execution, collection, assertion, and feedback.
9. FAQ
Why can’t we just look at screenshots?
A screenshot captures a single instant. It cannot show the character’s movement trajectory across consecutive frames, collision outcomes, or state changes.
Can unit tests replace end-to-end evaluation?
No. Unit tests are good for pure functions and local logic, but playability depends heavily on dynamic interaction, which needs runtime evaluation.
How should reference implementations be built?
Start with typical mechanics, verify them by running them manually, and record version, input script, acceptance criteria, and sampling fields. Reference implementations are not there to show off; they exist to provide a stable anchor.
How do you put AI-generated game evaluation into practice?
First turn core mechanics into frame-level assertions, then bring launch, interaction, crashes, sampling, and reproducibility into the gate system, and finally use human playtesting to confirm the experience.
Conclusion
Whether an AI-generated game is actually playable is fundamentally a question of evaluation methodology. Looking at code, screenshots, or a single model score alone cannot produce a reliable conclusion. The workable path is to anchor design intent with human-verified reference implementations, extract evidence through runtime state collection, and bring launch rate, interactability rate, core mechanic pass rate, crash rate, reproducibility, and failure grading into the gate system. Only when evaluation moves from “looks decent” to “is genuinely playable and genuinely reproducible” does assessing AI game generation capability become engineering-credible.
