Skip to content

Implement Wave 1 + Wave 2 import pipeline#3

Merged
kylaalsbury-nealy merged 1 commit into
mainfrom
feat/import-pipeline
May 14, 2026
Merged

Implement Wave 1 + Wave 2 import pipeline#3
kylaalsbury-nealy merged 1 commit into
mainfrom
feat/import-pipeline

Conversation

@kylaalsbury-nealy

Copy link
Copy Markdown
Contributor

Lands the foundation and parallel-track tasks from docs/roadmap.md so researchers can drag a Studio JSON export into Assets/ and spawn a fully-componented environment with collider and prefab-substitution support.

Wave 1 - Foundation:

  • F1: build/publish-core-dll.{ps1,sh} scripts + Plugins/README explaining how to drop in the netstandard2.1 OpenApparatus.Core.dll from a sibling openapparatus-core clone.
  • F2: Runtime components (EnvironmentRoot, Room, Wall, RoomObjectInstance, OpeningSpec), MultiRoomEnvironmentAsset ScriptableObject + supporting data types, OpenApparatusSpace coord-handedness helper, MaterialResolver, OpenApparatusGeometry mesh wrapper.
  • F3: MaterialResolver synthesises pipeline-appropriate defaults via Shader.Find when no authored .mat is present; versionDefines wire URP / HDRP detection through both asmdefs; Materials/README documents the authored-default override path.

Wave 2 - Parallel:

  • A: JsonEnvironmentImporter (ScriptedImporter for .json) with v3 sniff
    • v4 schema marker discriminator, POCO mirror of the JSON schema, Newtonsoft.Json deserialisation (added as a UPM dependency), and a JsonGeometryBuilder that produces per-room floor/wall/ceiling meshes as sub-assets. Foreign .json files fall through to TextAsset.
  • B: GltfEnvironmentPostprocessor recognises Room_, Room_wall, and Room_object_ node names and attaches the matching components. Best-effort start/end from mesh bounds; passage defaults to Closed unless a paired JSON wins.
  • I: ColliderBuilder generates BoxCollider on each Wall (rotated to align with the segment) and one BoxCollider per Room tile, gated by MultiRoomEnvironmentAsset.ColliderMode.
  • J: PrefabSubstitutionTable ScriptableObject + ReorderableList editor + PrefabSubstitutionApplicator that swaps RoomObjectInstance placeholders for researcher-supplied prefabs with position / rotation / scale overrides.
  • D: Samples~/ImportedEnvironment/ with single_room.json + README, wired into package.json's samples block.
  • E: Tests/Editor/ asmdef + tests for OpenApparatusSpace, JSON discriminator / importer, glTF postprocessor, collider builder, prefab substitution; GitHub Actions workflow runs edit-mode tests via game-ci/unity-test-runner against Tests/UnityProject (a minimal host that consumes the package via a relative file:// dependency).

EnvironmentSpawner ties the spawn flow together: places rooms + walls + placeholder objects, then runs PrefabSubstitutionApplicator and ColliderBuilder in that order. Asset inspector exposes ColliderMode and Substitution above the Spawn button.

Known gaps documented for follow-up:

  • Plugins/OpenApparatus.Core.dll is not committed; run the publish script against the sibling openapparatus-core clone to produce it.
  • single_room.glb fixture for the glTF postprocessor needs Studio export; current glTF test exercises the name-recognition logic via a synthetic GameObject hierarchy.
  • JsonGeometryBuilder produces simple wall prisms without door cutouts; geometry quality is "topology-verifiable" not "presentation-ready".

Lands the foundation and parallel-track tasks from docs/roadmap.md so
researchers can drag a Studio JSON export into Assets/ and spawn a
fully-componented environment with collider and prefab-substitution
support.

Wave 1 - Foundation:
- F1: build/publish-core-dll.{ps1,sh} scripts + Plugins/README explaining
  how to drop in the netstandard2.1 OpenApparatus.Core.dll from a sibling
  openapparatus-core clone.
- F2: Runtime components (EnvironmentRoot, Room, Wall, RoomObjectInstance,
  OpeningSpec), MultiRoomEnvironmentAsset ScriptableObject + supporting
  data types, OpenApparatusSpace coord-handedness helper, MaterialResolver,
  OpenApparatusGeometry mesh wrapper.
- F3: MaterialResolver synthesises pipeline-appropriate defaults via
  Shader.Find when no authored .mat is present; versionDefines wire URP /
  HDRP detection through both asmdefs; Materials/README documents the
  authored-default override path.

Wave 2 - Parallel:
- A: JsonEnvironmentImporter (ScriptedImporter for .json) with v3 sniff
  + v4 schema marker discriminator, POCO mirror of the JSON schema,
  Newtonsoft.Json deserialisation (added as a UPM dependency), and a
  JsonGeometryBuilder that produces per-room floor/wall/ceiling meshes
  as sub-assets. Foreign .json files fall through to TextAsset.
- B: GltfEnvironmentPostprocessor recognises Room_<id>, Room_<id>_wall_<n>,
  and Room_<id>_object_<slot>_<idx> node names and attaches the matching
  components. Best-effort start/end from mesh bounds; passage defaults to
  Closed unless a paired JSON wins.
- I: ColliderBuilder generates BoxCollider on each Wall (rotated to align
  with the segment) and one BoxCollider per Room tile, gated by
  MultiRoomEnvironmentAsset.ColliderMode.
- J: PrefabSubstitutionTable ScriptableObject + ReorderableList editor +
  PrefabSubstitutionApplicator that swaps RoomObjectInstance placeholders
  for researcher-supplied prefabs with position / rotation / scale
  overrides.
- D: Samples~/ImportedEnvironment/ with single_room.json + README, wired
  into package.json's samples block.
- E: Tests/Editor/ asmdef + tests for OpenApparatusSpace, JSON discriminator
  / importer, glTF postprocessor, collider builder, prefab substitution;
  GitHub Actions workflow runs edit-mode tests via game-ci/unity-test-runner
  against Tests/UnityProject (a minimal host that consumes the package via
  a relative file:// dependency).

EnvironmentSpawner ties the spawn flow together: places rooms + walls +
placeholder objects, then runs PrefabSubstitutionApplicator and
ColliderBuilder in that order. Asset inspector exposes ColliderMode and
Substitution above the Spawn button.

Known gaps documented for follow-up:
- Plugins/OpenApparatus.Core.dll is not committed; run the publish script
  against the sibling openapparatus-core clone to produce it.
- single_room.glb fixture for the glTF postprocessor needs Studio export;
  current glTF test exercises the name-recognition logic via a synthetic
  GameObject hierarchy.
- JsonGeometryBuilder produces simple wall prisms without door cutouts;
  geometry quality is "topology-verifiable" not "presentation-ready".
@kylaalsbury-nealy kylaalsbury-nealy merged commit 028f0bc into main May 14, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant