Class PGGStructureProfiler
Profiles and compares PGG-generated structures against reference demo scenes. Designed to validate that procedural generation produces results statistically similar to hand-built Synty demo structures.
HIGH-LEVEL API (for Roslyn scripts via reflection): ProfileAndSave(demoGO, "Room_Main_Area.json") → Save golden reference CompareToGolden(genGO, "Room_Main_Area.json") → Compare against saved reference ProfileAndCompare(demoGO, genGO) → Direct comparison of two GOs ListGoldenProfiles() → List saved profiles
EDITOR MENU: GrindFest > PGG > Profile Selected Object GrindFest > PGG > Save Profile of Selected
public static class PGGStructureProfiler
- Inheritance
-
objectPGGStructureProfiler
Methods
- CategorizeMesh(string)
Categorize a mesh by its name using pattern matching. Returns the category name or "Other" if no match.
- Compare(StructureProfile, StructureProfile)
Compare two structure profiles and produce similarity metrics. Uses nearest-Y matching for per-level comparison (handles different Y spacings). Filters out insignificant levels (scattered rocks, stray meshes).
- CompareToGolden(GameObject, string, float, float)
Compare a generated GameObject against a previously saved golden reference. Returns a formatted comparison report.
- FormatComparison(ComparisonResult)
Format a comparison result as a human-readable report with grades and recommendations.
- FormatProfile(StructureProfile)
Format a StructureProfile as a summary.
- ListGoldenProfiles()
List all saved golden reference profiles.
- ListProfiles()
List all saved profile filenames.
- LoadProfile(string)
Load a previously saved profile from JSON.
- Profile(GameObject, float, float)
Profile a GameObject hierarchy, analyzing mesh distribution by category and Y-level.
- ProfileAndCompare(GameObject, GameObject, float, float)
Profile two GameObjects, compare them, and return a formatted report.
- ProfileAndSave(GameObject, string, float, float)
Profile a GameObject and save the profile to JSON. Returns a formatted summary.
- SaveProfile(StructureProfile, string)
Save a profile as JSON to GrindFest.Workspace/profiles/.