The SIMPLE Unity Plugin is a Unity Package Manager package designed to connect Unity scenes with GAMA simulations through the SIMPLE Webplatform middleware.
It provides a lightweight Unity workflow to set up a scene, connect to the middleware, generate a static preview from an experiment opened in GAMA, adjust species visual settings, and run the simulation in Play Mode. The package is designed to work without modifying simple.webplatform: the middleware is launched separately and Unity connects to it through WebSocket.
The current demo workflow is centered around the GAMA Panel, which groups scene setup, preview generation, species settings, and runtime visualization tools in one place.
In Unity:
- Open Window > Package Manager.
- Click the + button.
- Select Add package from git URL....
- Paste one of the following URLs.
For the main branch :
https://github.com/project-SIMPLE/SIMPLE-Unity-Plugin.git
For a branch :
https://github.com/project-SIMPLE/SIMPLE-Unity-Plugin.git#name-of-the-branch
For local development, you can also install the package from disk:
- Open Window > Package Manager.
- Click the + button.
- Select Add package from disk....
- Select this package's
package.json.
For local project testing, you can also add the package directly to a Unity project's Packages/manifest.json:
{
"dependencies": {
"com.project-simple.gama-unity": "file:../path/to/SIMPLE-Unity-Plugin"
}
}Do not add another copy of NativeWebSocket unless you remove the vendored copy from this package.
- Unity 6.x
- GAMA
- SIMPLE Webplatform middleware
- Middleware headset/player WebSocket port:
8080 - GAMA connected to the middleware
simple.webplatformlaunched manually
This Unity package does not modify or automatically launch simple.webplatform. The middleware is expected to be started separately.
The runtime client connects to the webplatform headset WebSocket endpoint, not directly to GAMA Server:
- Unity headset/runtime client:
ws://<webplatform-host>:8080/ - Web monitor UI:
ws://<webplatform-host>:8001/ - GAMA Server, used internally by webplatform:
ws://<gama-host>:1000/
- Start
simple.webplatformmanually. - Start GAMA.
- Open or select the target experiment in GAMA.
- Open Unity.
- Open GAMA > GAMA Panel.
- Run Setup Scene if needed.
- Use Generate Preview from GAMA.
- Adjust species settings.
- Apply settings to the preview.
- Press Play.
The experiment does not need to be already running in GAMA. It only needs to be open or selected. Unity reproduces a Play-like middleware initialization flow through port 8080 to generate the static preview.
Start simple.webplatform, then start GAMA and open or select the experiment you want to preview.
The standard preview workflow does not require the middleware catalogue, settings.json, or LEARNING_PACKAGE_PATH.
Open the GAMA Panel in Unity and click:
Generate Preview from GAMA
Unity connects to the existing middleware on port 8080, receives JSON data, and builds a static preview in the Unity scene.
After the preview is generated, detected species appear in the GAMA Panel and in the Simulation Manager Inspector.
For each species, you can adjust:
- Prefab Override
- Resources Path Override
- Color Override
- Scale Multiplier
- Position Offset
- Rotation Offset
- Visibility
These settings can be edited from the GAMA Panel or later from the Game Manager / Simulation Manager Inspector.
When Play Mode starts:
- the static preview is hidden to avoid duplicates;
- live runtime agents are created from middleware data;
- species settings are applied to live agents;
- runtime agents are grouped by species under:
[GAMA] Runtime Live Agents
├── species_name
│ ├── agent_0
│ ├── agent_1
│ └── ...
The GAMA Panel is the main entry point for the demo workflow.
It includes:
-
Setup Scene
Prepares the Unity scene for GAMA communication and runtime visualization. -
Workspace Explorer
Allows browsing local GAMA workspaces and experiments. -
Preview from the Open GAMA Experiment
Generates a static preview from the experiment currently opened or selected in GAMA. -
Species Settings
Lets users adjust visual settings per species. -
Advanced Sections
Contains diagnostics, captured JSON tools, and legacy catalogue-based workflows.
Advanced sections are collapsed by default and are not required for the standard demo workflow.
This is the main preview workflow.
It uses the middleware player WebSocket endpoint:
ws://localhost:8080/
It does not require the middleware catalogue or settings.json workflow.
The preview process:
- Connects to the middleware.
- Reproduces a Play-like initialization sequence.
- Receives JSON output from GAMA through the middleware.
- Builds a static Unity preview.
- Detects species from the generated preview.
Detected species become available after preview generation.
Species settings are shared between:
- the static preview in Edit Mode;
- live runtime agents in Play Mode;
- the Simulation Manager Inspector.
Available settings:
-
Prefab Override
Assign a Unity prefab to represent this species. -
Resources Path Override
Use a prefab available through UnityResources. -
Color Override
Override the color received from GAMA. -
Scale Multiplier
Adjust the visual size of all agents of this species. -
Position Offset
Shift all agents of this species. -
Rotation Offset
Rotate all agents of this species. -
Visibility
Show or hide one species.
You can still adjust these settings later from the Game Manager / Simulation Manager Inspector.
During Play Mode, Unity connects to the middleware and receives live simulation data.
The static preview is hidden automatically to avoid visual duplicates. Runtime agents are then created live and organized under:
[GAMA] Runtime Live Agents
Each species gets its own parent object in the hierarchy, making the scene easier to inspect during demos.
Example:
[GAMA] Runtime Live Agents
├── road
│ ├── road_0
│ ├── road_1
│ └── ...
├── building
│ ├── building_0
│ ├── building_1
│ └── ...
├── pedestrian
│ ├── pedestrian_0
│ ├── pedestrian_1
│ └── ...
└── car
├── car_0
├── car_1
└── ...
The Simulation Manager Inspector is organized into compact sections:
-
GAMA Species Overview and Attributes
Shows detected species, GAMA attributes, and Unity overrides. -
Rendering Settings
Controls camera visibility, render distance, and rendering-related options. -
Preview and Play Settings
Controls synchronization between the static preview and Play Mode. -
Scene References
Contains scene and XR references required by the setup. -
Interaction Scenario
Contains scenario-specific settings such as hotspots, vehicles, day/night logic, GAMA asks, and interaction feedback. -
Performance and Streaming
Contains runtime performance options such as object pooling, update budgets, culling, and streaming. -
Advanced Debug
Contains troubleshooting and verbose diagnostic settings.
The most important demo sections appear first. Advanced performance and debug options are collapsed by default.
The package can resolve prefabs from Unity Resources.
If no prefab is found for a species, a fallback cube is used so the agent remains visible in the scene.
Species can be customized through:
- prefab overrides;
- Resources path overrides;
- per-species visual settings.
Default primitive suggestions and improved prefab recommendations in the GAMA Panel are planned for future updates.
Prefab import from the GAMA Panel is currently being improved.
The intended workflow is to copy external prefabs into a Unity Resources folder so they can be mapped to GAMA species.
Target import folder:
Assets/Resources/GAMAImportedPrefabs/
Recommended supported assets:
.prefab.fbx.obj.mat.png.jpg.jpeg.tga
External scripts should not be imported by default.
The Workspace Explorer allows users to inspect a local GAMA workspace without requiring middleware connectivity.
It can:
- choose a workspace folder path;
- scan
.gamlfiles; - discover declared
experimentblocks; - list experiments with a heuristic capability label:
VRNon-VRVR + Non-VRUnknown
Notes:
- capability detection is heuristic and depends on keywords or metadata present in experiment blocks;
- invalid paths, missing metadata, and permission issues are handled without crashing the editor;
- Workspace Explorer is useful for browsing experiments, but the main preview workflow is based on the experiment currently opened or selected in GAMA.
-
Runtime/
Webplatform connection, simulation, serialization, localization, movement, preview, and geometry utilities. -
Runtime/ThirdParty/NativeWebSocket/
Vendored NativeWebSocket transport used by the runtime client. -
Editor/
GAMA Panel, workspace explorer, setup tools, preview tools, inspector tooling, and editor-only utilities. -
Samples~/
Importable Unity scenes and templates. -
Tests/
Runtime and editor test assemblies. -
Documentation~/
Package notes and protocol details.
Check that:
simple.webplatformis running;- GAMA is running;
- the target experiment is open or selected in GAMA;
- middleware port
8080is available.
Generate a preview first and make sure JSON output was received from the middleware.
Enable:
Hide Preview During Play
Enable:
Apply Preview Settings to Play
Then apply or save the species settings again.
Use either:
- Prefab Override;
- Resources Path Override.
If no prefab is found, the fallback cube is used.
Try one of the following:
- close and reopen Unity;
- remove
Packages/packages-lock.jsonfrom the Unity project; - reinstall the package from the Git URL;
- use the fixed commit URL for a stable demo version.
- Compatibility still needs to be tested on more GAMA experiments.
- Validation on real SIMPLE/GAMA projects is still pending.
- The advanced catalogue /
settings.jsonworkflow is not the main demo workflow. - Prefab import still needs final hardening.
- Documentation will evolve after more experiment compatibility tests.
- Default primitive and prefab suggestions in the GAMA Panel are planned but not fully finalized.
- Test on more GAMA experiments.
- Test on current real SIMPLE/GAMA projects.
- Improve default prefab suggestions in the GAMA Panel.
- Improve prefab import workflow.
- Generate full user documentation.
- Generate developer documentation.
- Prepare demo screenshots or a demo video.
- Do not modify
simple.webplatformfrom this package. - The middleware is launched separately.
- Runtime code should avoid Editor-only dependencies where possible.
- Demo UI must remain in English.
- Advanced options should remain collapsed unless needed.
- The package should remain installable through Unity Package Manager.
The package targets Unity 6.x.
The package manifest currently declares Unity 6000.0.
MIT License. See LICENSE.
Third-party notices are listed in THIRD_PARTY_NOTICES.md.