Evaluating Code Motion, Interaction, and Visual Taste in Practice

    Generative code can produce interactive visuals and short motion pieces quickly, but a single lucky sample is a poor measure of quality. This guide explains how to evaluate aesthetic ceiling, constraint following, and engineering usability with fixed prompts, canvas and timing rules, layered motion checks, and repeatable acceptance criteria.

    Generative code can already produce interactive visual pages and short-form motion graphics in a relatively short time. For developers, the useful result is not “one run that looked better.” It is an evaluation method that can be repeated, compared, and carried into engineering work. Gradual rollouts, sampling variation, and prompt luck all distort a single viewing. The notes below turn common tests of code animation, motion shorts, collage, and interactive aesthetics into a practical guide.

    Decide what the evaluation must answer

    Visual code generation is usually used to answer three kinds of questions.

    First, the ceiling: with a prompt that barely restricts creativity, can the model handle composition, light, materials, particles, animation, and spatial atmosphere at once, while still responding to input such as the mouse?

    Second, constraint following: when duration, resolution, frame rate, layered motion, and wobble amplitude are fixed in writing, does the output still obey those numbers, or does it fake animation by sliding the whole image?

    Third, engineering usability: can the result be split into layers, a timeline, and asset references, or is it one giant script that cannot be changed further?

    These questions need different prompts. Do not draw a conclusion from one mixed run. A ceiling test invites an open solution; a constraint test deliberately tightens the parameters. If both outputs “look good,” that only shows a decent aesthetic sample. It does not show control.

    Control the variables instead of comparing impressions

    A fair comparison should at least hold these conditions fixed: the same prompt text, the same canvas size, the same target duration and frame rate, the same asset rule (public-domain or self-supplied assets only), the same interaction mode (for example, mouse movement and clicks only), and a similar generation budget (rounds, timeout, and whether asset retrieval is allowed).

    Sampling is random. Run the same prompt several times and record both the first usable result and the best sample. That is closer to daily use than keeping only the flashiest version. If a service is opening in batches, also record when the run happened, so “the new version was not assigned yet” is not mistaken for a capability gap.

    A simple log is enough: case ID, prompt type (open or tightly constrained), whether external assets were allowed, whether layers moved independently, whether interaction could be reproduced, lines changed by hand, and failure mode. Do not invent a composite score. Without a public, reviewable protocol, a score has no meaning.

    Case 1: The aesthetic ceiling of an interactive scene

    This kind of prompt can ask the model to use composition and 3D or pseudo-3D programming. The scene should be explorable with the mouse, but no specific engine is required. Do not judge from a still screenshot. Check each dimension below.

    • Depth: Can foreground, subject, and background be separated, and does occlusion change with the viewpoint?
    • Light and color: Is the key-light direction consistent? Do highlights and shadows follow materials, rather than a single full-screen filter?
    • Materials: Do metal, paper, water, glass, and similar surfaces have distinguishable highlights and roughness, rather than one shared noise texture?
    • Particles and atmosphere: Do particles have birth, death, and depth? Do fog, dust, and glow overpower the subject?
    • Interaction: Pointer movement should change parallax, focus, or local highlights. A click should produce predictable feedback. If the piece only autoplays and ignores the mouse, mark interaction as failed.
    • Perceived performance: On an ordinary office laptop, does it drop frames obviously or add too much input delay? There is no need to promise an absolute frame rate. “Smooth to drag” or “stutters while dragging” is enough.

    The structure does not have to belong to any framework. A canvas and pointer events are enough to check whether interaction is real:

    1. const canvas = document.querySelector("canvas");
    2. const ctx = canvas.getContext("2d");
    3. const pointer = { x: 0, y: 0, active: false };
    4. canvas.addEventListener("pointermove", (e) => {
    5. const r = canvas.getBoundingClientRect();
    6. pointer.x = (e.clientX - r.left) / r.width;
    7. pointer.y = (e.clientY - r.top) / r.height;
    8. pointer.active = true;
    9. });
    10. function frame(t) {
    11. const parallax = (pointer.x - 0.5) * 40;
    12. ctx.clearRect(0, 0, canvas.width, canvas.height);
    13. drawBackground(ctx, t, parallax * 0.2);
    14. drawMidground(ctx, t, parallax);
    15. drawForeground(ctx, t, parallax * 1.6);
    16. requestAnimationFrame(frame);
    17. }
    18. requestAnimationFrame(frame);

    The point to check is that background, midground, and foreground use different displacement factors, and that those factors come from the live pointer rather than a hardcoded looping slide. If the model only outputs an auto-rotating camera and ignores the pointer, record the interaction constraint as unmet.

    Case 2: A fifteen-second motion short

    When the task is defined as a portfolio montage, the test is rhythm, not a single poster frame. Specify in advance a total length of about 15 seconds, the aspect ratio, the beat count, how shots change (hard cut, mask, or shape morph), and whether real photographs are allowed.

    The checklist can be concrete:

    1. Does the timeline cover the full duration, rather than a dense first three seconds followed by a loop of the same segment?
    2. Does each shot have an entrance, a hold, and an exit, rather than elements appearing suddenly?
    3. Does the rhythm land on the beats? You can require “one accent action per beat,” then see whether the accent falls on a cut or a scale change.
    4. Is the style consistent? A montage may jump, but type, stroke weight, and the number of colors should have limits—for example, no more than three main colors plus neutrals.
    5. Can it be exported? The preferred output is one file or function per shot, not one long string that cannot be searched.

    The most common failure in a motion short is “many elements, but no edit.” Objects looping at the same time is not a narrative. During review, ask “where should the viewer look in this second?” If there is no answer, the composition has failed.

    Case 3: A tightly constrained layered collage

    Writing resolution, duration, frame rate, and motion rules into the prompt is an effective way to separate “can draw” from “can make a piece.” For example: 1920×1080, about 8 seconds, a 30-frame way of thinking about the picture; the subject uses a lower stop-motion frame rate with a small hand-drawn wobble, while the camera uses a higher-sampled parallax push. The boat, paper waves, coral, seabirds, star chart, and whale each move and occlude one another. Sliding the whole image to fake animation is forbidden. Assets are limited to public-domain images that can be used legally.

    Pass conditions for this case should be observable facts:

    • At least six named objects have independent position or deformation functions.
    • Occlusion changes with motion. A precomposited transparent image does not count.
    • The posed object updates its pose clearly less often than the camera advances, creating a contrast between hand-drawn jitter and a sliding camera.
    • The hand wobble is small and rhythmic. It does not accumulate into a drift out of frame.
    • Asset sources can be explained. Unverifiable copyrighted images are not embedded in the result.

    Pseudocode can separate an object clock from a camera clock so that everything is not multiplied by the same time:

    1. function tick(ms) {
    2. const cameraT = ms / 1000; // continuous parallax
    3. const poseT = Math.floor(ms / 83); // stop-motion at about 12 updates per second
    4. const wobble = Math.sin(poseT) * 2; // small hand wobble, in pixels
    5. return {
    6. ship: { x: 400 + wobble, y: 520 + wave(poseT) },
    7. whale: { x: 900 - cameraT * 18, y: 300 + wobble },
    8. camera: { x: cameraT * 12, y: Math.sin(cameraT) * 4 }
    9. };
    10. }

    The numbers are an acceptance ruler, not a performance claim. Another set of pixels and beats works just as well. What matters is that object updates and camera updates run at separate rates.

    Assets, retrieval, and style changes

    When a model is allowed to retrieve real images, the risk shifts from “it does not draw well” to “the use is not legal or the match is wrong.” In practice, limit sources to libraries that are clearly free to use, or to files you supply. Keep the mapping between file names and subjects. Before collage, crop, remove backgrounds, and normalize color in a consistent way. A style change—for example, from a nautical illustration to a star chart—should use a mask, a paper fold, or a shared contour. Do not hard-cut two unrelated filters together.

    When there are many assets, store source images and exported frames in object storage, and log the prompt and asset list for each generation so the run can be reproduced. These are general engineering practices. They do not depend on any one model’s proprietary interface. If a team already manages static resources on Baidu AI Cloud, evaluation samples, exported video, and prompt archives can sit under the same object storage and access control. The point is that versions can be traced, not that switching storage vendors improves taste.

    How to read a gap in experience

    Gaps between intelligent coding tools usually show up in four things, not in a claim that one has beaten another.

    • Instruction following: Are numbers, layers, and prohibitions respected?
    • Aesthetic consistency: Do color, whitespace, type, and motion feel like the work of one designer?
    • Iteration cost: When the second round only changes “the whale’s occlusion,” does unrelated code get rewritten across a large area?
    • Stability: Across repeated generations, what share of results is usable—not only the best one?

    Running every case within a single hour is useful for probing the ceiling. It is not a sound basis for a purchasing decision. A steadier method is at least three independent generations for each tightly constrained case, then a count of passed items. Group failed samples as “ignored a number,” “whole-image slide,” “no interaction,” “asset cannot be traced,” or “code cannot be split.” Categories are more useful than adjectives.

    From a demo to a maintainable implementation

    After visual acceptance, run an engineering check as well.

    • Lift magic numbers into configuration: duration, canvas, layer speed, and wobble amplitude.
    • Separate the timeline from drawing so a layer’s position function can be tested on its own.
    • Keep asset paths outside the script. Do not paste large image data directly into code.
    • Leave a path for pointer input, keyboard input, and autoplay, so screenshot regression is possible in a headless environment.
    • Record known limits. For example, particle counts may need to be reduced as they rise. Do not assume every device stays at full frame rate.
    1. const spec = {
    2. width: 1920,
    3. height: 1080,
    4. duration: 8,
    5. layers: ["chart", "boat", "wave", "coral", "bird", "whale"],
    6. poseFps: 12,
    7. cameraFps: 24,
    8. wobblePx: 2
    9. };

    The configuration object is itself the evaluation fixture. When the model or the prompt changes, replace only the drawing implementation. Leave the acceptance spec alone. That is what makes the comparison hold.

    Summary

    A “stunning” visual generation is easy to inflate with one lucky sample. Split prompts into an open ceiling test and a tight constraint test. Fix the canvas, duration, layering, and asset rules. Accept results on independent motion, occlusion, interaction, and how easily they can be changed. Only then does the real level of an intelligent coding tool on code motion become visible. Taste still has to be judged by a person, but the standard can be written down, run again, and kept in version control. The conclusion then serves the next iteration, rather than a viewing that cannot be checked.