Evaluating LLMs for Complex Interactive Web Pages: Tests and Methodology
Large language models can now generate far more than static web pages, but evaluating their ability to build complex interactive applications requires more than checking whether a page renders. This article presents a practical evaluation methodology based on two demanding scenarios: a desktop-style web interface and a real-time strategy game prototype. It examines window state management, visual consistency, shared time models for real-time updates, AI-assisted research decisions, enemy targeting and path planning, and detailed controls such as speed sliders, hexagonal maps, keyboard viewport navigation, and icon-based objects. It then outlines staged prompt iteration, structured repair prompts, and an objective evaluation framework covering requirement coverage, runtime stability, visual consistency, and maintainability. The goal is to treat the model as a high-efficiency prototyping collaborator within a verifiable engineering process rather than as a fully autonomous software engineer.
I. From “Can Generate a Page” to “Can Complete Complex Interactions”
In recent years, large language models have expanded their web-generation capabilities from simple static pages to complete prototypes that include animation, interaction, data state, and business logic. Users are no longer satisfied with “generate a button” or “build a card list.” They expect the model to understand design style, interaction rules, functional constraints, and exception cases in a single pass, and to translate those requirements into front-end code that can run directly.
The difficulty of these tasks lies not in implementing an individual component, but in coordinating multiple systems. A desktop-style web page, for example, usually combines window management, drag behavior, z-order switching, animation transitions, and visual style. A strategy game prototype must handle a map, units, resources, research, enemy and friendly relationships, pathfinding, and time progression. Both require strong requirements-analysis ability rather than simple code completion.
Therefore, when evaluating a model’s web-generation capability, it is not enough to check whether the page can open. The following dimensions also matter:
- Whether it accurately understands natural-language requirements.
- Whether it can decompose complex goals into implementable modules.
- Whether it can maintain data consistency across components.
- Whether it can preserve existing functionality after multiple rounds of modification.
- Whether it can self-correct based on runtime results.
- Whether the visual presentation and interaction experience meet expectations.
II. Desktop-Style Web Page Generation: Visual Replication Is Not Functional Completion
In a typical test, a model can be asked to build a web interface with a retro desktop style. The page must support window dragging, window focus, minimization, and closing, and must include a window-switching animation with a three-dimensional feel.
On the surface, this requirement appears to focus on visual design. In practice, it contains several front-end engineering problems.
1. Window dragging requires complete state management
Dragging a window involves at least the following state:
- The current position of the window;
- The offset when the pointer or touch point is pressed;
- Whether the window is currently being dragged;
- Whether the window is at the top layer;
- Whether the window extends beyond the visible area;
- The stacking relationship among multiple windows.
A more reliable implementation records the difference between the pointer position and the window’s top-left corner when the user presses the title bar, updates the coordinates on pointer movement according to the displacement, and clears the drag state after the pointer is released. If absolute coordinates are used without boundary constraints, windows can easily be dragged off-screen. If no layer index is maintained, click-to-front behavior cannot be implemented.
2. Visual style must be decomposed into executable properties
“Retro translucent desktop style” is not a single parameter. It is a combination of multiple visual features, including:
- A translucent background;
- A blur effect;
- Soft borders and shadows;
- A gradient title bar;
- Rounded buttons;
- A layered pop-up animation;
- A unified icon and font system.
If the prompt only says “make a beautiful desktop,” the model usually improvises. The result may have a similar style but fail to meet specific requirements. A more effective prompt explicitly defines the page structure, color direction, transparency, window behavior, animation rhythm, and control positions.
For example, the requirement can be split into the following layers:
Page layer: desktop background, taskbar, window containerWindow layer: title bar, content area, action buttonsInteraction layer: drag, focus, close, minimizeAnimation layer: open, close, switch, scaleConstraint layer: windows cannot move completely out of the viewport; layering remains correct after operations
This layered description helps the model establish a stable implementation plan and makes later item-by-item acceptance easier.
3. Slow generation does not mean high generation quality
Generating complex web pages often requires longer reasoning and code organization time. When traffic is high or the task is complex, page-generation speed may decrease noticeably. But slow speed only means that processing took time; it does not directly imply higher final quality.
In actual tests, a common situation occurs: the code structure looks complete and the page runs, but the visual result is worse than an earlier version. Possible reasons include:
- Excessive refactoring during generation replaces existing styles;
- The model focuses on functional implementation and ignores visual details;
- Style overrides appear after multiple rounds of modification;
- Animation and transparency effects behave inconsistently across browser environments;
- Complex requirements are compressed into components that are too simple.
Therefore, page generation should use two separate standards: functional acceptance and visual acceptance. Judgments should not rely only on code length or generation speed.
III. Complex Game Prototypes Better Test Overall Model Capability
Compared with simple page layout, a strategy game prototype is better suited as a comprehensive test because a game requires not only an interface but also a continuously running state system.
A simplified real-time strategy game contains at least the following objects:
- A map grid;
- Cities or bases;
- Player and enemy units;
- Resource quantities;
- A research tree;
- Unit movement logic;
- Friend/foe identification;
- Game speed;
- Camera or viewport control;
- Victory and defeat conditions.
If a model can only generate static buttons and decorative elements, it will struggle to complete this type of task. It must convert natural-language descriptions into data structures, update loops, and interaction controls.
IV. Real-Time Versus Turn-Based: The Key Is the Time Model
Requiring the game to use real-time strategy mode rather than traditional turn-based mode is not about simply removing an “End Turn” button. The core requirement is to rebuild the game’s time model.
Turn-based games usually advance state when the player finishes an action. Real-time games require a continuously running time loop. A general implementation approach is:
function update(deltaTime) {updateResources(deltaTime);updateResearch(deltaTime);updateUnits(deltaTime);updateEnemyAI(deltaTime);resolveCombat(deltaTime);}
In a browser environment, updates can be driven by an animation-frame loop:
let previousTime = performance.now();function loop(currentTime) {const deltaTime = currentTime - previousTime;previousTime = currentTime;update(deltaTime);render();requestAnimationFrame(loop);}requestAnimationFrame(loop);
What truly matters is that all units and systems share the same time baseline, rather than each object independently using a different timer. Only then can resource growth, unit movement, enemy behavior, and combat resolution remain consistent in time.
If speed adjustment is added, the implementation should avoid directly modifying fixed times inside the logic. Instead, a speed multiplier should affect the time step:
const effectiveDelta = deltaTime * gameSpeed;
When speed changes from a slower setting to a faster one, the game logic should remain stable. Units should not teleport, resources should not grow abnormally, and collision should not fail because the refresh frequency changed.
V. AI-Assisted Research: From Button Function to Automatic Decision-Making
Adding an optional automatic research assistant to a game actually involves two parts. The first is the user interface, such as a checkbox, toggle, or status indicator. The second is decision logic: how the system determines what should be researched at the current moment.
The simplest strategy may be to automatically select the first available item in research-tree order. A more reasonable implementation should at least check:
- Whether current resources are sufficient;
- Whether prerequisite technologies have been completed;
- Whether a research project has already been occupied by another task;
- Whether the current situation requires priority development of economy, defense, or military;
- Whether the automatic assistant is enabled.
The research logic can be abstracted as follows:
function selectResearch(state) {const available = state.techTree.filter(tech =>!tech.completed &&tech.prerequisites.every(id => state.completedTech.has(id)) &&state.resources >= tech.cost);return chooseByPriority(available, state);}
The key point here is not to build truly complex artificial intelligence. It is whether the model understands that an “assistant system” means continuously observing state, filtering feasible options, and executing automatically, rather than merely adding a button with no real effect.
VI. Automatic Enemy Seeking: Target Selection and Path Planning Are Both Essential
Requiring all units to automatically seek enemies involves at least two problems: target discovery and movement path planning.
Target discovery needs to consider:
- Whether enemy units are within the visible range;
- Whether to prioritize enemy units or enemy cities;
- Whether multiple targets exist;
- Whether a target has already been locked by other units;
- Whether to search again after the target disappears.
Path planning needs to handle:
- Whether the map contains obstacles;
- Whether units can pass through certain terrain;
- Whether movement costs differ;
- Whether dangerous areas should be avoided;
- Whether the path should be recalculated after the target position changes.
For a simple grid map, breadth-first search can be used. If the map has different movement costs, weighted path search is more appropriate. A model’s first implementation may use straight-line movement. This can look effective in a demo, but problems appear once obstacles are introduced.
Therefore, acceptance testing should include multiple scenarios:
- The enemy is directly in front of the unit.
- The enemy is separated from the unit by an obstacle.
- Multiple enemy targets exist at the same time.
- The target moves or disappears.
- Multiple units compete for the same target.
- The unit can trigger combat or capture after reaching the target.
Only when the implementation works in all these scenarios can the model be considered to have implemented relatively complete automatic behavior.
VII. Interface Control Requirements Reveal Detail Understanding
Some seemingly simple control requirements often reveal whether the model truly understands the task.
1. Speed slider
Speed control should not only change a number in the interface; it should also affect internal game time progression. It is advisable to display the current multiplier and enforce reasonable minimum and maximum values to prevent users from entering invalid values.
2. Regular hexagonal map
A regular hexagonal grid differs from a rectangular grid in its coordinate system and adjacency relationships. Each tile usually has six neighbors, and map rendering must handle horizontal offsets or axial-coordinate conversion. If the model only rotates rectangles to look hexagonal while still using four-direction adjacency internally, the display and logic will be inconsistent.
3. Keyboard viewport control
Keyboard-based viewport switching must consider focus. When the user is typing text or operating a slider, the arrow keys should not unexpectedly move the map. The implementation should also handle continuous key presses, boundary constraints, and different keyboard layouts.
4. Icon-based objects
Using icons for cities, units, resources, and enemies can improve information recognition efficiency, but icons cannot replace status explanations. It is advisable to provide color, text labels, hover tooltips, or selection highlighting at the same time, rather than relying on a single visual symbol.
VIII. Multi-Turn Prompt Iteration: Do Not Stack All Requirements at Once
Complex tasks are not suitable for a single extremely long prompt. A more reliable approach is staged iteration.
In the first stage, generate a minimal runnable version that only requires the page skeleton and core state.
In the second stage, add the main interactions, such as window dragging, map movement, unit selection, and speed control.
In the third stage, add automatic decision-making, including the research assistant, target seeking, and path planning.
In the fourth stage, focus on visual optimization, such as transparency, shadows, icons, animations, and responsive layout.
In the fifth stage, perform defect repair. Explicitly list the issues that have been found instead of vaguely saying “please optimize.”
An effective repair prompt should contain:
- The functionality that currently works correctly;
- The specific problem that currently occurs;
- The steps to reproduce the problem;
- The expected result;
- The functionality that must not be broken;
- The areas that need to be checked carefully after modification.
This approach reduces the probability that the model will break other modules while fixing one problem.
IX. How to Establish an Objective Evaluation Standard
It is advisable to evaluate a model-generated complex web page from four perspectives.
1. Requirement coverage
Check each original requirement item by item, paying particular attention to constraints that are easy to overlook.
2. Runtime stability
Check whether the page produces errors, lag, or state corruption during continuous operations, repeated open/close operations, rapid speed switching, and simultaneous movement of multiple units.
3. Visual consistency
Check whether colors, spacing, fonts, layering, transparency effects, icons, and animations form a unified style.
4. Maintainability
Observe whether the code has clear data structures, reasonable component separation, and explicit state boundaries. Runnable code is not necessarily suitable for further iteration. In complex interaction scenarios in particular, maintenance cost is often more important than initial generation.
X. Conclusion: Model Capability Should Be Placed in a Verifiable Engineering Process
The new generation of large language models can already handle fairly complex requirements in web generation and interactive prototype development. They are especially effective at rapidly building interfaces, completing interaction logic, and making continuous modifications based on natural language. In actual use, however, model output still fluctuates significantly: the same requirement may produce visual regression, missing functionality, or changes in code structure across different rounds.
Therefore, a model should not be treated as a fully automated software engineer. It should be treated as a highly efficient prototyping collaborator. Users need to take responsibility for requirement decomposition, acceptance design, problem reproduction, and final tradeoffs.
For desktop-style web pages, the focus should be on window state, visual hierarchy, and interaction consistency. For real-time strategy games, the focus should be on the time model, state synchronization, path planning, and automatic decision-making. Only by splitting these goals into verifiable modules and combining them with staged prompts and systematic testing can the value of large models in complex front-end development be fully realized.
