Skip to content

Unity checks

Four frames of wooden stakes ending above the ground, each with a visible gap

What a contact check is for: torch stakes on Crescent Lagoon that float 12 to 16 cm above the ground. A reviewer measured them and marked them as a blocker.

The Unity check tools are a small editor-only package, com.awdk.agenttools. Agents call them to measure the open scene, so a claim like "no z-fighting" rests on a number and a file.

The package sits in unity-package/com.awdk.agenttools/. It has no hard dependency on the VRChat SDK. How to add it to a project: install.

How a tool is started

Every entry point is a static method that returns a plain-text report. The agent calls it through the editor bridge:

return AWDK.AgentTools.ZFightScan.Status();

Long work never blocks the editor for more than about 2 s per call:

flowchart LR
    a["Start(...)"] --> b["returns STARTED"]
    b --> c["Status()"]
    c -- still running --> c
    c -- final report --> d[done]
  • Start(...) returns STARTED .... The work is sliced over editor updates.
  • The agent polls Status() until it returns the final report.
  • A call that timed out is polled again, never started again.
  • The tools are read-only unless stated.
  • rootPath is a hierarchy path such as Building/Floor1. null means the whole loaded scene.

Released in the package

Package version 0.4.0 ships these and the PropGate checks further down.

Tool Measures Writes
ZFightScan overlapping coplanar triangle pairs from different renderers: the cause of z-fighting a text report ending PAIRS=<n> COMPLETE
ZFightRender which z-fights are visible from given camera shots <name>_zmask.png per shot, z-fight pixels in magenta; a report ending SHOTS=<n> ZFIGHT_PIXELS=<total> COMPLETE
WorldCapture nothing: it takes screenshots outDir/<name>.png per shot; a report ending SHOTS=<n> COMPLETE
PerfSample play-mode frame cost: Camera.Render time, GPU frame time, draw calls, batches, triangles one JSON file per sample
WorldAudit rule breaks, with object paths a text report
WorldUploader nothing: it builds and uploads several scenes of one project the upload itself

Z-fighting is the flicker you see where two surfaces lie on the same plane.

ZFightScan

ZFightScan.Start(string rootPath = null, float planeEps = 0.0015f, float minOverlapArea = 0.0004f,
                 bool includeSelf = false, bool includeOppositeFacing = false)
ZFightScan.Status()
  • The gate: fix every pair of 4 cm² or more on a player-visible surface, then re-run.
  • Only a report ending PAIRS=0 COMPLETE is clean.
  • PARTIAL, ABORTED, ERROR or STATE=idle mean re-run.
  • Never start a second scan while one is running. ZFightScan.Cancel() stops one.
  • A whole large outdoor world took about 330 s. To verify a fix, scan only the roots that changed.

ZFightRender

ZFightRender.Start(string outDir, string shotsJson)
ZFightRender.Status()

It uses the same shots as WorldCapture. The scan finds every coplanar overlap; the render shows which ones a player sees.

Not covered: skinned meshes, terrain, particles, transparent materials.

WorldCapture

WorldCapture.Shoot(string outDir, string shotsJson)
WorldCapture.Status()

The shots are a JSON list:

[{"name":"01_wide","pos":[x,y,z],"look":[x,y,z],"fov":60,"w":1600,"h":900}]
  • Defaults: fov 60, 1600×900, at most 8192 px per side. Optional "near" and "far", default 0.03 and 1000.
  • It uses one persistent camera object named __CapCam__ and adds no lights.
  • Helper objects named __*__ are swept before the scene is saved.

PerfSample

PerfSample.Start(string outJson, float settleSeconds = 15, int warmupFrames = 40, int frames = 200,
                 string disableRootsCsv = null)
PerfSample.Status()
  • Play mode only. It waits, skips the warm-up frames, then samples.
  • It measures whatever the cameras render. The agent moves the player to the viewpoint first.
  • disableRootsCsv switches renderers off under each root. That is how one part's cost is measured.
  • Samples are ranked by mainThreadMs and graded with perf_grade.py.

WorldAudit

WorldAudit.Run(string rootPath = null)

One synchronous call. It reports:

  • VRCStation components (seat stations),
  • pickups with proximity other than 0.1 or AutoHold other than No,
  • realtime or Mixed lights,
  • leftover __*__ helper objects,
  • MeshColliders on likely walkable surfaces,
  • colliders on props,
  • static renderers missing a second UV set,
  • uncompressed textures on scene materials,
  • NO_JUMPING, when no script in the world turns jumping on.

The prop-collider check depends on names. It only sees objects under an ancestor whose name contains Prop or Props, Dressing, Furniture, Decor or Clutter as a separate word. That is why dressing lives under <Area>/Props.

Two prop colliders are allowed, by name: LieDownCollider (off by default, on a bed or couch) and SolidCollider (always on, on big furniture).

WorldUploader

WorldUploader.Plan(list)
WorldUploader.Start(list)

It compiles only when the VRChat worlds SDK is installed. Plan is read-only. Start refuses on a dirty open scene, on leftover __*__ objects, or when not logged in.

An upload is your decision. Agents prepare it; they do not decide it.

PropGate and its checks

New in package version 0.4.0

PropGate, its seven checks and the joint check pass their planted-defect tests. They have not yet been run on a full world, so their thresholds are not calibrated.

PropGate runs seven measured checks on one scene root and writes one table (TSV file) per check, plus propgate_summary.tsv.

PropGate.Start(string rootPath, string outDir, string supportRoots = null)
PropGate.Status()

The final line reads PROPGATE ... CHECKS=7 FINDINGS=<n> BLOCKERS=<n> COMPLETE. Only a last line ending COMPLETE counts.

Check Measures Blocker classes
MeshScan each distinct mesh: open edges, inside-out parts, and whether the defect is visible to a player. Writes meshscan.tsv class A or B with visible=yes
ContactSweep each prop's underside against the surface below it. Writes contact.tsv FLOAT (more than 1 cm above its support), SUNK (more than 2 cm under), NOSUPPORT (nothing within 0.6 m below)
OverhangCheck how much of a prop's footprint has support. Writes overhang.tsv OVERHANG (10 % or more of the points unsupported)
ParticleAudit each particle system: material, texture, size, and whether it stays in its declared volume. Writes particles.tsv NO_MATERIAL, ERROR_SHADER, NO_TEXTURE, OPAQUE, EMITS_OUTSIDE, LIVE_OUTSIDE
UnlitPropAudit materials that take no scene light, or glow without being a lamp. Writes unlit.tsv ERROR_SHADER, UNLIT, EMISSIVE_NOT_LAMP
GeneratedMeshCensus scene meshes with no model file behind them and more than a box's 12 triangles. Writes generated.tsv SCENE_MESH, PROBUILDER, PRIMITIVE
JointCheck each declared joint: the gap between the joint point and the surface it must touch. Writes joints.tsv OPEN, DEEP, NO_TARGET, DETACHED, MISSING, BAD_SPEC
  • Each check can also run alone: <Check>.Start(rootPath, outDir), <Check>.Status(), <Check>.Cancel().
  • The checks are read-only and run in edit mode. Only ParticleAudit is meant for play mode too.
  • The checks locate defects. Zero findings never says the result looks right.

Declared joints

A joint is a point where one model must touch another: a rope on its ring, a strap on its trunk.

Where Form
Model file an empty named Joint_<name>, child of the part it belongs to
Scene the same empty, tagged EditorOnly
Sidecar <Model>.model.json "joints": [{"name", "point": [x,y,z], "attaches_to", "max_gap_m", "embed_m"}]

Default limits per joint: a 2 mm gap and a 20 mm embed.

Declared particle volumes

An effect that covers an area declares where it belongs. The builder adds an empty child named ParticleVolume, tagged EditorOnly. Its position is the box centre and its scale is the box size.

The full reference, with every column and what each check cannot see, is docs/unity-tools.md.