This document is about: QUANTUM 1
SWITCH TO

Project Structure

When you download and decompress the quantum SDK to start the development of a new game, these two folders are the most relevant:

  • quantum.code - contains the Visual Studio solution for the gameplay simulation code (independent of Unity);
  • quantum.unity - bootstrap Unity project with sample scripts to integrate the simulation with the rendering engine;
Quantum SDK folder structure
Quantum SDK folder structure.

This manual covers topics about the implementation of a quantum simulation using the provided quantum.code Visual Studio solution, and integration with the sample bootstrap Unity project.

Visual Studio Solution (quantum.state and quantum.systems)

Quantum Visual Studio Solution
quantum.code Visual Studio solution, with the two projects: quantum.state for game state data and quantum.systems for game logic.

Quantum requires the game to be developed with an ECS (entity, components and systems) approach, which means the game state data structures revolve around the Entity and Component concepts (augmented by other expected types).

The game state data is defined with Quantum's custom DSL (domain specific language) in the quantum.state project using files with the .qtn extension.
Details about this topic are covered in the next chapter of this manual.

The game logic is written in stateless Systems (with regular C#, with extensive use of unmanaged pointers for performance reasons).
Systems must be stateless because the Quantum simulator only guarantees deterministic rollbacks for data kept directly in the game state structures (declared through the DSL).
The chapter on Systems covers managing entities (create/destroy/update), and also signals (inter-systems communication) and events (fine-grained API for informing the rendering engine - Unity - of game state changes).

The quantum.code Visual Studio solution builds the containing projects as DLLs that are directly updated to the Unity Bootstrap project Plugins folder, but that can be easily customized to a different path by changing the output folder of the quantum.systems project (as shown below):

Quantum DLL output path
Quantum build pipeline uses the standard VS project output path. Simply change the path here to send the generated DLLs to any custom location.

Bootstrap Unity Project

Bootstrap Unity project structure
Bootstrap Unity project structure.

The provided bootstrap Unity project contains pre-built integration scripts to simplify both running a Quantum game and also using Unity as the rendering engine for the decoupled simulation (created with the aforementioned quantum.code solution).

The chapter about the bootstrap project covers the most important topics such as how to run the simulation, inject input, render game state, process events callbacks, run in online mode with Photon, etc.

Back to top