How project-simple/simple.toolchain works
• The “GAMA Plugin” – a set of Java/Maven-based modules (with files like pom.xml, ant scripts, and Eclipse project descriptors) that integrate as a plugin into the GAMA simulation environment.
• The “Unity Template” – a full-fledged Unity project containing scenes, assets, scripts, and editor extensions intended to serve as a starting point for building Unity applications (including VR/AR setups) that work with the SIMPLE toolchain.
Main Components
a. GAMA Simulation Environment (external system) – the host into which the “GAMA Plugin” is installed.
– Versioning and build scripts (using Maven and Ant for tasks)
– GAML extension modules (e.g., “gaml.extension.unity”) and other package areas that indicate command handling, species extension, operator definitions, and serialization.
– Connection and communication components (the “Connection” package under “Gama Provider”, WebSocketConnector, etc.) which likely manage bidirectional communication between GAMA and the Unity client.
c. Unity Template – a Unity Project that:
– Provides assets, scenes (both for game simulations and demo environments like multi-player and VR templates)
– Contains user-interface elements and scripts (e.g., “GAMAGeometryExportUI.cs”, “GAMAGeometryLoaderUI.cs”) and runtime logic (for player movement and simulation managers).
– Integrates plugins (such as WebSocket libraries) to connect to the GAMA Plugin for simulation data exchange.
d. Communication Layer – often implemented via WebSockets (as evidenced by the “WebSocket.cs” files in both the Unity Template and the “Gama Provider/Connection” folder). This layer shows the bidirectional data flow between the simulation (GAMA Plugin) and the Unity client.
Relationships and Interactions
• The GAMA Plugin sits within the GAMA simulation environment. It exposes a set of APIs or event handlers (likely through serialized data and commands in the “Serialization” and “Simulation” modules) for receiving simulation commands from or sending simulation updates to external systems.
• The Unity Template serves as a client that uses these APIs and communication channels to synchronize simulation state, trigger scene changes, or update visuals in real-time. This interaction is typically mediated via the WebSocket communication layer.
• At a higher level, the two parts are “paired” – one builds on the simulation side and the other on the visualization/client side.
• The build and configuration scripts (files under .github/workflows and project settings for Unity) indicate that there is an automated process for managing releases and integration across these two components.
Architectural Patterns and Design Principles
• Modularity is key: the GAMA Plugin is built as a stand-alone module (with its own Maven/Ant build structure) that integrates with GAMA, while the Unity Template is organized as a standard Unity project with well-separated assets, scenes, and scripts.
• There is a clear separation of concerns between simulation (back-end/GAMA) and visualization (front-end/Unity). The communication layer (WebSocket connectors) decouples these two parts.
• Dependency management and continuous integration are present (evidenced by the presence of GitHub Actions workflow files for building and releasing plugins), reinforcing a modular, testable design.