Launch a Distributed Simulator using Vortex Director
In this workflow, a custom Unity application must be used for a specific content package. This page describes exactly what is required to be able to use a custom Unity application, using the Vortex Integration package for Unity, in a distributed simulator.
Importing the Vortex Integration package in a Unity project
The very first step is to have a Unity project with the proper Vortex package. To import it in your project, please follow this guide first: Setup Unity project to use Vortex Studio.
Once this is done, you should have the package listed here in the Package Manager window from the Unity Editor.
Preparing scenes for a build
Your application should contain at least one Unity scene that is associated to a Vortex scene. Follow this guide to associate a Vortex scene to a Unity scene: Associate a Unity Scene and a Vortex Scene.
Your project should also contain an initial/transition scene. This is the default Unity scene that is loaded when no Exercise (each with its Vortex scene) is loaded by the Vortex Console. This scene should be empty, and/or display some kind of splash screen.
In the Unity project's Build Settings, your transition scene should be added as the first scene (index 0), which is the scene that is loaded by default when launching a Unity application.
Next, your Unity scenes associated to Vortex scenes must be added to the list. For a Unity scene to be loaded when its associated Exercise is selected from the Console, some specific requirements must be met:
You need one Equipment document (vxequipment) for your project.
You need an Exercise document (vxexercise) for each scene. Set the Vortex Scene file for an exercise from the Vortex Editor, here:
The last point, and most important, is that your Unity Scene must be have the same name as your Vortex Scene extension name.
In the scene document, in the Vortex Editor:
Scene in the Unity project's Build Settings:
This is how the Vortex Unity integration will know which scene to load when an Exercise is launched from the Vortex Console.
Building your application
Build manually from Unity Editor
Next, when your project is in a stable state, you can actually build your application from your project. This is done via the Build Settings of the Unity Editor, with the Build button.
Build from command line
It can also be done from command line. We provide a utility Editor script that can be executed from command line with any project using the Vortex Studio integration for Unity. More information here: Building the Unity application from the command line
For additional information on using Unity from command line, refer to this Unity documentation page, in the Build Arguments section, for details: https://docs.unity3d.com/Manual/EditorCommandLineArguments.html
In any case, building your application will produce a folder containing all necessary files, including the executable file, to run your build.
Preparing your application for a distributed simulator
Once you have a build folder, you need to place it in the correct place in your content package for the Vortex Director (and Service) to recognize it. Here is how:
The Setup File, set in the Vortex Director for your simulator setup, must have a parent folder named "resources". It does not need to be the immediate parent, but it needs one.
Next to this "resources" folder, at the same level, create a "bin" folder.
Copy your whole build folder (or its contents), generated previously, into this "bin" folder.
Now that your application is ready, simply configure your simulator nodes in the Vortex Director to use the "Vortex Unity" option in the Executable column. This should be done for each node of your distributed simulator.
At this point, your simulator is all set up!
Launching a distributed simulator
From the Vortex Director, simply select your simulator, then press the Launch button. If your Setup File and Vortex content is configured correctly, the Console should launch and you should have access to your Equipment and Exercises.
Once selected, press the LOAD button to launch an Exercise, which will load the corresponding Unity scene in your application.