World Creation
Welcome to the World Creation guide. This track is an in-depth exploration of the procedural and algorithmic pipelines provided by the Spatial Experience SDK. It covers how to model, texturize, and populate expansive virtual worlds that are physically aligned and dynamically synchronized with a moving vehicle.
1. Tailored vs. Procedural Content Strategy
To build infinite virtual worlds, we must understand the core content production strategies:
- Tailored Content: Represents the traditional game development paradigm. Artists manually place, sculpt, and adjust every game object, tree, and collider in a scene. While this grants precise artistic control, it does not scale. It is impossible to manually design unique environments for millions of miles of real-world roads.
- Procedural Content: Passes the burden of environment population onto rules-based algorithms. Instead of placing assets by hand, the developer defines logical rules, mathematical constraints, and data-flow modifiers. The world is compiled dynamically in real-time as the player moves.
The Spatial Experience SDK employs a procedural content strategy. You configure the generation rules inside an Elastic Graph, and the engine evaluates these rules on-the-fly, querying geographical databases (like OpenStreetMap) to sculpt terrains and spawn props matching the passenger's actual real-world location.
2. The Spatial Evaluation Rule (Location Dependency)
Important
To architect robust and optimized spatial experiences, developers must understand a fundamental architectural boundary of the Spatial Experience SDK: The Elastic Graph is strictly location-dependent and is entirely time-blind.
- Recalculation Trigger: The Elastic Scene Generator (ESG) recalculates map values, terrain meshes, and spawner coordinates only when the player's vehicle transitions between coordinate sectors (cells), and only at the leading edge where new cells load.
- The Parked/Idle Car Scenario: If a passenger's vehicle remains stationary or parked in the same neighborhood, no graph recalculations are triggered. The virtual scene's active cells remain static, and spawning routines remain entirely idle.
Note
Scripting Strategy Cross-Reference:
For a detailed walkthrough of the programming strategies used to address this time-blind spatial constraint (such as scripting moving NPCs or triggering background scene-swaps), refer to our Location vs. Time guide inside the Code section.
3. The Generation Strategy (Pipeline)
To synchronize your virtual environment with physical vehicle telemetry, the SDK utilizes a highly optimized four-stage generation strategy:
flowchart TD
%% Inputs
subgraph Input_Layer ["1. GIS & Sensor Inputs"]
OSM("Map Server <br> (OpenStreetMap / GIS Data)")
State("State Receiver <br> (GPS / Speed / Orientation)")
end
%% Graph Logic
subgraph Graph_Layer ["2. Elastic Graph (Algorithmic Logic)"]
Graph("Elastic Graph Evaluation <br> (Heightmaps, Road Masks, Spawning Poses)")
end
Input_Layer -->|Geo data & Telemetry stream| Graph_Layer
%% Unity Generation
subgraph Unity_Generation ["3. Scene Compilation (ESG Engine)"]
ESG("Elastic Scene Generator <br> (Deforms Terrains & Spawns Objects)")
end
Graph_Layer -->|Evaluates procedural rules| Unity_Generation
%% Outputs
subgraph Display_Layer ["4. Motion-Synchronized Output"]
SceneView([Unified Virtual Experience])
end
Unity_Generation -->|Assembles active world cells| Display_Layer
%% Styling (Vibrant, highly colored borderless theme)
style Display_Layer fill:#dcfce7,stroke-width:0px
style SceneView fill:#16a34a,stroke-width:0px,color:#fff
style Input_Layer fill:#e0f2fe,stroke-width:0px
style OSM fill:#0284c7,stroke-width:0px,color:#fff
style State fill:#0ea5e9,stroke-width:0px,color:#fff
style Graph_Layer fill:#f3e8ff,stroke-width:0px
style Graph fill:#7c3aed,stroke-width:0px,color:#fff
style Unity_Generation fill:#fce7f3,stroke-width:0px
style ESG fill:#db2777,stroke-width:0px,color:#fff
- GIS & Sensor Inputs: The pipeline queries localized coordinates from the physical vehicle sensors (via the State Receiver) and downloads matching geographic features from our Map Server.
- Algorithmic Evaluation (Elastic Graph): The downloaded map nodes and coordinates are filtered through your custom node rules inside the Elastic Graph to compile height, density, and coordinate sets.
- Unity Compilation (ESG): The Elastic Scene Generator (ESG) reads the compiled graph definitions, deforms and paints native Unity terrains, and triggers procedural spawners.
- Motion Synchronization: The active terrain cells are continually shifted and rotated in virtual space to stay pinned under the physical vehicle, delivering a comfortable, latency-free passenger experience.
4. Dual-Core Processing: Maps & Poses
The Elastic Graph models your virtual world by separating computations into two fundamental, complementary data types:
- Maps (2D Grayscale Grids): These represent two-dimensional mathematical matrices containing floating-point values between
0and1. Maps are used to sculpt terrain height profiles, blend grass/rock texture weights, define object-clearing masks, and scale procedural vegetation densities. - Pose Sets (Position-Rotation Tuples): These represent containers of discrete spatial coordinate points (
GlobalPosition) accompanied by three-dimensional rotation angles. Pose Sets are fed into procedurally automated spawners to determine the exact coordinates where 3D game objects are instantiated.
5. Preserving the Collision-Free Mandate
A fundamental constraint of vehicle-bound XR development is that the passenger's vehicle must never collide with or clip procedurally generated obstacles. Colliding with virtual objects while the physical vehicle is moving smoothly in the real world breaks immersion and triggers immediate motion sickness.
To enforce this, the generation strategy heavily relies on Road Network Masks and Distance Transforms:
- Road Network Masks: Algorithmic filters that identify the exact coordinate polygons of physical roads and lanes.
- Distance Transforms: Extrapolate these masks outward to calculate safe distance zones (e.g. "Do not spawn any tree within 10 meters of the road center"). By multiplying spawning density maps with these distance-transform masks, you guarantee that procedural forests and cities cleanly clear out of the passenger's driving path.
6. Leveraging Prefab Modularity
Procedural content generation does not mean you have to learn modeling or rendering from scratch. The Elastic Graph's spawning system operates on standard, modular Unity Prefabs:
- Standard Asset Workflow: You can build, model, and configure your prefabs exactly as you do in standard Unity development—attaching mesh renderers, custom scripts, animations, rigidbodies, audio sources, particle emitters, and Level-Of-Detail (LOD) groups.
- Algorithmic Distribution: Once a prefab is complete, you simply assign it as a reference parameter inside your graph's Spawner Nodes. The graph then takes care of procedurally instantiating, scaling, rotating, and pooling hundreds of instances across the landscape based on your math rules.
Topics & Chapters
This World Creation track is divided into 5 granular implementation chapters:
- The Elastic Graph – A holistic overview of the graph editor, node categories, terrain sculpting, and map processing.
- Elastic Spawning – Detailed walk-through of spawning setups, Pose nodes, Spawner nodes, road masks, and density maps.
- Quality and Performance – Outlines critical practices to balance visual fidelity and high-frequency frame rates.
- Advanced Terrain Modelling – Explores complex modeling combinations, including pose-based elevation profiles.
- Graph Node Overview – A comprehensive parameter reference guide for all out-of-the-box graph nodes.