A Practical Guide to Applying LLMs in 3D Scene and Game Development
Large language models can already produce runnable graphics and gameplay code, but their output needs clear boundaries and acceptance criteria before it can enter production. This article covers five areas—toolchains, 3D prototyping, game workflows, live-ops analytics, and interaction/camera systems—explaining input specifications, validation methods, and risk controls for each stage. All numeric thresholds are starting references and should be adjusted to your project.
Large language models can already write runnable graphics and gameplay code, but their output requires explicit boundaries and acceptance criteria before it can go into production. This article walks through five areas—toolchains, 3D prototyping, game workflows, live-ops analytics, and interaction/camera work—covering input specifications, validation methods, and risk control for each. The numeric thresholds here are starting references; teams should tune them to their own projects.
1. Aligning on Concepts: What Is HaaS?
HaaS stands for Harness as a Service. The core idea is to wrap a large model as a callable service and equip it with tools: a code execution sandbox, version control operations, build commands, unit test runners, and so on. The model never connects directly to production; it completes tasks inside a controlled set of tools.
The relationship between HaaS and CI/CD: the model is one step in the pipeline. Its output must pass the existing gates—compilation, tests, and code checks—before it can be merged or released. The model does not replace these gates.
A minimal viable architecture has five parts:
- Model gateway: handles authentication, rate limiting, and request logging, with secrets and personal information stripped from logs.
- Sandboxed execution environment: no production credentials; outbound network access restricted to a domain whitelist.
- Tool registry: every tool declares its input format, output format, and permission scope.
- Result validation: compilation passes, unit tests pass, and static analysis shows no critical warnings—all three are required.
- Human approval gates: merging to the main branch, releasing versions, or changing permission configurations must be confirmed by a person.
Teams should agree internally on what “HaaS” means, so different people don’t attach different meanings to the same term.
2. 3D Prototyping and Asset Generation
2.1 Browser-Based Prototypes
For quickly validating 3D effects in the browser, the common stacks are Three.js or Babylon.js. Pin the framework version in package.json or a lock file—for example, lock Three.js to a specific minor version—otherwise the model may generate code that calls deprecated APIs.
When describing requirements to the model, specify:
- Units: meters or centimeters—this directly affects collision and motion parameters.
- Coordinate system: Y-up or Z-up; default conventions differ across engines.
- Dimensions and connections: e.g., gear diameter, bearing positions, rotation range in degrees.
- Motion parameters: e.g., rotation speed, acceleration, start and end times.
Collision detection requires an explicit choice. Axis-aligned bounding boxes (AABB) are cheap and good for roughly determining whether two parts might overlap, but they cannot represent precise contact shapes. Precise collision needs a physics engine such as cannon-es or Rapier. When no approach is specified, the model often defaults to one implementation—and that default may not fit your needs.
For acceptance, run the simulation at a fixed timestep and record positions per frame. For example, require a part’s displacement error within one second to be under 1 cm; anything beyond that fails. A simple single part usually works within one conversation round; assembling multiple parts typically takes several rounds of correction.
2.2 Procedural Generation of Buildings and Large Scenes
Procedural content generation (PCG) means having the model write scripts that batch-place buildings, vegetation, and roads. Models are well suited to this because the logic is rule-based.
The table below lists common tool categories and their main risks:
| Scenario | Common Tools | Input | Output | Main Risks |
|---|---|---|---|---|
| Web prototypes | Three.js, Babylon.js | Dimensions, motion parameters | Runnable browser page | Framework version mismatch, unspecified collision approach |
| Batch scene generation | Blender Python API, Houdini, in-engine PCG tools | Spatial rules, density parameters | Scene files or scripts | Intersecting buildings, disconnected roads |
| In-engine gameplay | Unity (C#), Unreal (C++ or Blueprints) | Gameplay rules, interface definitions | Components or scripts | Engine version incompatibility |
| Materials and textures | Dedicated material tools, generative image tools | Material descriptions, parameter ranges | Texture files | Unclear licensing, incorrect normal orientation |
In PCG, rules should be written as parameter tables rather than natural-language descriptions. For example: minimum spacing between buildings is 8 meters, road width is 4–6 meters, vegetation density is no more than 30 plants per 100 square meters. A parameter table can be read and checked directly by scripts.
After generation, use scripts to automatically check three things: the number of overlapping faces between building models, the distribution range of terrain heights, and whether the main roads are connected. Only after all three checks pass should designers refine the visual focal points.
3. Game Workflows: Gameplay Validation and the Art Pipeline
3.1 Gray-Box Gameplay Validation
The goal at this stage is to determine as quickly as possible whether a mechanic is fun—not to achieve visual polish. Take grid-based turn combat as an example: define the interface first, then let the model implement it. Below is an example of movement range calculation using breadth-first search, computing the tiles a unit can reach within a given number of steps:
from collections import dequedef move_range(grid_w, grid_h, start, max_steps, blocked):"""Return tiles reachable within max_steps (excluding start). `blocked` is a set of obstacle tiles."""visited = {start: 0}queue = deque([start])while queue:x, y = queue.popleft()if visited[(x, y)] == max_steps:continuefor dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):nx, ny = x + dx, y + dyif not (0 <= nx < grid_w and 0 <= ny < grid_h):continueif (nx, ny) in blocked or (nx, ny) in visited:continuevisited[(nx, ny)] = visited[(x, y)] + 1queue.append((nx, ny))visited.pop(start)return set(visited)
Acceptance criteria include these test cases:
- Tiles at the map edge must not return out-of-bounds coordinates.
- Obstacle tiles must not appear in the movement range.
- Whether tiles occupied by other units can be passed through must match the design document.
- The attack range formula (Manhattan or Chebyshev distance) must match the design document.
Failure conditions: the movement range includes out-of-bounds tiles, attack range deviates from the design, or turn order is wrong. For manual verification, a designer plays three consecutive matches, recording per-turn duration, unit survival counts, and win/loss distribution to judge whether the mechanic is balanced.
3.2 Art Production and the Asset Pipeline
In art production, models are good at repetitive work: batch UV unwrapping, material parameter adjustments, and generating LOD (level of detail) models. Blender’s Decimate modifier and engines’ built-in LOD tools can both handle polygon reduction; the model’s job is to write scripts that batch-invoke these tools.
Before importing into the engine, assets must pass compliance checks:
- Polygon count does not exceed the limit for that asset category.
- Material count does not exceed the set value.
- Texture dimensions are powers of two, e.g., 512, 1024, 2048.
- File naming follows team conventions.
- Generated assets (images, models, audio) record their source and license information.
Copyright deserves special attention. Generative tools differ in training data and terms of service; before commercial use, legal counsel should confirm the scope of the license, and the asset record should keep the name and version of the generation tool.
3.3 Auditing Generated Code
Model-generated code must go through normal review. Static analysis tools catch obvious errors; dependency scanners check third-party libraries for licenses and known vulnerabilities. Never include API keys, account passwords, or database addresses in prompts. If code needs such information, it should read it from environment variables or a secrets management service.
4. Release and Live Ops: Player Feedback Analysis
Player reviews, support tickets, and telemetry logs are large in volume and messy in format; reading them one by one is expensive. A large model can do the initial classification, but its results need human verification.
The recommended workflow:
- Data anonymization: remove player nicknames, phone numbers, emails, and IP addresses; replace player identifiers with irreversible hashes. Keep only fields required for analysis. Data storage locations must comply with the data protection regulations of the relevant region.
- Classification and tagging: the model outputs a label for each piece of feedback—“Bug Report,” “Balance,” “Art Style,” “Controls/UX,” or “Other”—plus a confidence score. Items with confidence below 0.7, and anything involving refunds, bans, or payments, go directly to human handling.
- Periodic sampling: each week, randomly sample 200 items for manual review and compute the agreement rate between model and human labels. If agreement falls below 85%, adjust the prompt or redefine the label boundaries.
- Correlate with telemetry: link “Bug Report” tags to crash logs and level-failure records; link “Balance” tags to level completion rates and average clear times. The model generates the correlation reports; designers decide what to change.
- Set alerts: if a level’s abandonment rate rises more than 20% above baseline within a week, automatically notify that level’s owner. 20% is a starting threshold; teams should adjust it based on historical variance.
- Assign owners: every tag category needs a responsible person. Client bugs go to the client lead; balance issues go to designers. Teams should agree on response times—for example, acknowledge within 48 hours, and run a retrospective within 7 days after the fix ships.
The key principle: the model only classifies and correlates feedback; final judgment and fix decisions are made by people.
5. Interaction and Camera Implementation
5.1 Door Interaction Logic
The core of interaction logic is a state machine plus event-based communication. When asking the model to generate interaction code, require it to split player input, environment changes, and character behavior into independent components that communicate via events.
Here is an example prompt structure:
Role: You are a senior game client engineer, proficient in Unity C#.Task: Write an interaction script for a door in a 3D scene.Requirements:1. When the player enters within 2 meters in front of the door, the door opens smoothly over 0.8 seconds.2. After the player leaves the trigger area, wait 2 seconds, then the door closes automatically.3. If an obstacle is detected while opening or closing, stop immediately and hold the current angle.4. Door state is communicated to other components via events; components must not reference each other directly.Output: Complete class code, plus unit tests or play-mode test steps.
Acceptance testing should cover: the player rapidly entering and exiting the doorway, a box placed in the doorway, multiple players triggering simultaneously, and the door being blocked mid-opening. Record the door’s final state and animation duration for each scenario.
5.2 Parameter Control for Cameras and Animation
Camera work is implemented through changes in camera parameters. Teams should provide parameter ranges and let the model generate scripts within those ranges, rather than relying on vague descriptions like “cinematic feel.”
Reference parameter ranges:
- Focal length: 24 mm to 85 mm—wide angles for showing environments, telephoto for close-ups.
- Horizontal field of view: 40 to 90 degrees; going beyond this range tends to cause discomfort.
- Shot duration: 2 to 8 seconds per shot.
- Easing curves: use ease-in-out to avoid sudden acceleration or stopping at shot boundaries.
For acceptance, have the model output a keyframe table for each shot, then use a script to check whether the view-angle change between adjacent shots exceeds the set threshold, and whether the playback frame rate stays at or above 95% of the target frame rate.
