Advanced Capabilities Scene

Overview

Quickly add various capabilities to your scene by simple drag-and-drop of game-ready RIDE prefabs with minimal setup involved.

This tutorial is geared toward developers and researchers working with the RIDE project source and new to the Unity development platform.

Page Contents

AdvancedDemo-02-2021

Requirements

Users new to RIDE and Unity will want to ensure their development environment is fully setup before continuing further. See the Standalone Application Customization tutorial for details.

Important

The example in this tutorial utilizes the A* movement system solution over the standard Unity navigation mesh movement system. This solution is optional for RIDE users currently. The A* Pathfinding Project Pro package license is per seat and can be obtained from the Unity Asset Store.

Add Prefabs to New Scene

Empty Scene

Start by creating a new empty scene in the Unity editor.

  1. Unity editor, File > New Scene
  2. Select “Empty” option
  3. Click Create button
  4. File > Save As…
  5. Within the project directory, navigate to /Assets/Scenes
  6. Create a new sub-folder, giving it the same name as the new scene that will be saved (Ex. “AdvancedTest”)
  7. Open this new sub-folder
  8. Name the scene the same as the sub-folder and click Save

Drag-and-Drop Prefabs

Next, drag into the scene Hierarchy panel various RIDE prefabs that encapsulate capabilities of the API.

  1. In Project panel, search field, type “ridesystems”
  2. Drag the corresponding RideSystems prefab into the scene Hierarchy. This prefab initializes all the systems available in RIDE. Expand the prefab in the Hierarchy view to disable systems as desired.
  3. In Project panel, search field, type “lightrig”
  4. Drag the corresponding DirectionalLightRig prefab into the scene Hierarchy. This generic lighting rig provides even lighting for terrain maps.
  5. In Project panel, search field, type “terrainloader”
  6. Drag the corresponding TerrainLoader prefab into the scene Hierarchy. Use of this prefabs enables terrain map streaming at run-time.
  7. In Project panel, search field, type “cameralos”
  8. Drag the corresponding TerrainCameraLOS prefab into the scene Hierarchy. This prefab adds a camera with custom controls and script for line-of-sight (LOS) rendering.
  9. In Project panel, search field, type “measuredis”
  10. Drag the corresponding TerrainMeasureDistance prefab into the scene Hierarchy. This prefab contains scripts and UI for the terrain measurement system.
  11. In Project panel, search field, type “destructor”
  12. Drag the corresponding TerrainDestructor prefab into the scene Hierarchy. This prefab contains scripts and UI for the terrain destruction system.
  13. In Project panel, search field, type “terrainlos”
  14. Drag the corresponding TerrainLOSAgentCreator prefab into the scene Hierarchy. This prefab contains scripts and UI for the spawning of LOS agents. 
  15. In Project panel, search field, type “selectorui”
  16. Drag the corresponding SelectorUI prefab into the scene Hierarchy. This prefab enables drag-select of agents.
  17. In Project panel, search field, type “agentformation”
  18. Drag the corresponding AgentFormationMovementCommands prefab into the scene Hierarchy. This prefab allows the user to give movement commands to selected agents.

Add TerrainCenter Object

Instance an empty game object that will serve as the center/origin point in which terrain tiles stream into the scene at run-time.

  1. Right-click in the Hierarchy view, and choose “Create Empty”
  2. Rename this object “TerrainCenter”
  3. Ensure Transform Position values 0, 0, 0

Modify Instanced Prefabs

RideSystems

Switch to A* movement system for agents.

  1. Expand RideSystems prefab in Hierarchy panel
  2. Select UnityNavMeshMovementSystem and disable it from the Inspector panel
  3. Select UnityAStarMovementSystem and enable it from the Inspector panel

TerrainLoader

Load specific terrain map and adjust parameters.

Note, the example shown in the top image utilizes TL_Korabela.

  1. Select TerrainLoader prefab in Hierarchy panel
  2. Input desired terrain map s3 link, map LoD value, terrain map collision s3 link, and collision LoD value
  3. Set loading point to TerrainCenter object
  4. Set a radius for how far to render terrain from loading point

TerrainCameraLOS

Adjust the Transform Position and Rotation values as needed to ensure a framed view for a particular location of interest on the map at runtime.

Verify Scene at Run-Time

Play Scene

  1. Ensure all changes up to this point for the scene are saved.
  2. Verify the scene works by clicking the Play button in the top-center of the Unity toolbar to compile and launch the scene.
  3. Open the Console panel to watch for any errors/warnings.
  4. If the scene runs successfully, stop the editor run-time mode by clicking the Play button again.

Achievement Unlocked!

Further expand your scene by adding other RIDE system prefabs, or system prefabs of your own design.

Scene Information and Instructions

Visit the Examples documentation for individual capability details and instruction.

This “AdvancedTest” scene utilizes the following capabilities: