-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorial ‐ Step 1
Create a new GAMA project, then copy inside in this project the folders "models" and "includes" from "Toy Models/Traffic" of the model library. In the "model" folder, delete all the models except "Traffic and Pollution.gaml".
Open the "Traffic and Pollution.gaml" model in the editor, then, select in the "Unity VR" menu "Model to VR". A Wizard should open.
-
Minimum duration of a cycle (in s): set the value to 0.1. This represents the minimum time between two simulation steps. As GAMA will be sending information to Unity at each simulation step, setting a minimum value for this variable ensures that the Unity client doesn't receive too much information too quickly.
-
Main experiment: name of the experiment, which will be extended to include a VR version. In the case of the model used in this tutorial, only one experiment is defined ("traffic"), which will be extended.
-
Main display: name of the display, which will be extended to include a VR version. In the case of the model used in this tutorial, only one display is defined ("carte"), which will be extended.
-
Display to hide: displays that will not be displayed in the experiment. In this tutorial, we don't want to have the "carte" display, so it must be checked.
- Species to be sent to Unity: select the agent species to be sent to Unity at each simulation step. To be more precise, at each simulation step, the position of each agent of these species is sent to Unity. You can filter the list of agents to be sent, to ensure that only non-overlapping agents and those too far from the player are sent. In this tutorial, we will only send mobile "people" agents (only check this species).
- Species to be sent to Unity as static geometries: select the agent species to be sent to Unity as static geometries (sent only once at the start of the game). For each species to be sent, it is possible to define whether these geometries will have a collider, will be 3D or not, will be selectable (i.e. the possibility of defining an interaction with them), the buffer around the geometry, the height of the geometry (only for 3D geometries), a "Tag" to identify the current type of geometries in Unity, and finally a color used to display them in Unity. In this tutorial, we'll send as static geometries the building species (with no collider, in 3D, non-selectable, with a buffer of 0.0, a height of 10m, no tag, and #black color). We'll also send the road species (with a collider, in 3D, selectable, a buffer of 2.0, a height of 1m, for the tag "intractable", and #gray color).
-
Minimum number of players: how many players are required to run the simulation. In this tutorial, we'll set this to 1.
-
Maximum number of players: does an unlimited number of players can connect to the game? In this tutorial, we'll check this option.
-
Maximum number of players: if the model/game has a maximum number of players, what is this maximum number (it must be greater than 0). In this tutorial, we'll set it to 1 to limit the number of players to one.
-
Init location of the players: sets the initial location of the players. In this example, we'll set it to {1000,1000}.
-
Perception radius of player agent: if this option is greater than 0.0, it filters the agents to be sent to Unity, sending only those agents that are at a distance less than or equal to the perception radius. In this tutorial, we'll leave the default value (0.0) as we don't wish to filter the agents sent to Unity.
-
Minimum distance between agents to be sent: if greater than 0.0, this option filters the agents to be sent to Unity, so as to send only those agents that are too close (distance greater than this minimum distance). In this tutorial, we'll leave the default value (0.0) as we don't wish to filter the agents sent to Unity.
-
Player Size: player display size in GAMA. In this tutorial, we'll set it to 20.0.
-
Player color: player display color in GAMA. In this tutorial, we'll set it to #red.
You can then click on finish to generate a new file: "traffic_model_VR.gaml", which will be used to launch the VR version of the model (experiment vr_xp). If the experiment does not appear, simply close the file and reopen it for GAMA to validate the file.