# gmoddev/gargantuan architecture

> Architecture diagram of the GitHub repository gmoddev/gargantuan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gmoddev/gargantuan
- Repository: https://github.com/gmoddev/gargantuan

## Overview

Gargantuan is an experimental Luau game engine with an Instance/DataModel runtime and server-authoritative semantics. Its main loop runs from project authoring through validated document mutation and persistence, into an isolated Play DataModel where scripts and gameplay systems execute, then publishes render and replication views. The README documents editor, packaging, networking, physics, and animation capabilities; paths for these unsampled subsystems are taken from the repository tree, so their internal wiring is not expanded. The supplied Engine excerpt supports the runtime orchestration and render path; unsampled source limits other call-level relationships.

Main entry points: [`src/Engine.cpp`](https://github.com/gmoddev/gargantuan/blob/main/src/Engine.cpp) (Engine Loop), [`src/classes/DataModel.cpp`](https://github.com/gmoddev/gargantuan/blob/main/src/classes/DataModel.cpp) (Authoritative DataModel), [`src/render/RenderPublisher.cpp`](https://github.com/gmoddev/gargantuan/blob/main/src/render/RenderPublisher.cpp) (Render Publication), [`src/editor/EditorHost.cpp`](https://github.com/gmoddev/gargantuan/blob/main/src/editor/EditorHost.cpp) (Editor Host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring and Projects"]
  node_editor_host["Editor Host<br/>[EditorHost.cpp]"]
  node_project["Project and Filesystem<br/>[Project.cpp]"]
  node_play_session["Play Session<br/>[PlaySession.cpp]"]
end

subgraph group_authority["Authoritative Runtime"]
  node_mutation["Mutation Gateway"]
  node_datamodel["Authoritative DataModel<br/>[DataModel.cpp]"]
  node_journal["Change Journal<br/>[ChangeJournal.cpp]"]
  node_schema["Runtime Schema<br/>[RuntimeSchema.cpp]"]
end

subgraph group_gameplay["Gameplay Systems"]
  node_engine["Engine Loop<br/>[Engine.cpp]"]
  node_scripts["Luau Runtime<br/>[ScriptEngine.cpp]"]
  node_players["Player Lifecycle<br/>[Players.cpp]"]
  node_physics["Physics Backends<br/>[PhysicsBackend.cpp]"]
  node_animation["Animation Runtime"]
end

subgraph group_presentation["Presentation"]
  node_render_publish["Render Publication"]
  node_renderer["Renderer<br/>[Renderer.cpp]"]
  node_editor_viewport["Editor Viewport<br/>[EditorViewport.cpp]"]
end

subgraph group_distribution["Networking and Packaging"]
  node_network["Replication Runtime"]
  node_remotes["Remote Dispatch<br/>[RemoteManager.cpp]"]
  node_packaging["Project Packaging<br/>[PackageBuilder.cpp]"]
end

node_studio(("Gargantuan Studio"))
node_peer(("Network Peers"))

node_studio -->|"sends commands"| node_editor_host
node_editor_host -->|"submits edits"| node_mutation
node_project -->|"loads project"| node_datamodel
node_mutation -->|"validates mutations"| node_datamodel
node_datamodel -->|"records changes"| node_journal
node_play_session -->|"starts isolated runtime"| node_engine
node_engine -->|"steps scripts"| node_scripts
node_engine -->|"starts player runtime"| node_players
node_engine -->|"updates animation"| node_animation
node_engine -->|"publishes scene"| node_render_publish
node_render_publish -->|"provides snapshot"| node_renderer
node_editor_viewport -->|"consumes frames"| node_render_publish
node_datamodel -->|"projects state"| node_network
node_network -->|"replicates state"| node_peer
node_remotes -->|"dispatches remotes"| node_peer
node_packaging -->|"packages project"| node_project

click node_editor_host "https://github.com/gmoddev/gargantuan/blob/main/src/editor/EditorHost.cpp"
click node_project "https://github.com/gmoddev/gargantuan/blob/main/src/filesystem/Project.cpp"
click node_play_session "https://github.com/gmoddev/gargantuan/blob/main/src/editor/PlaySession.cpp"
click node_mutation "https://github.com/gmoddev/gargantuan/blob/main/src/runtime/MutationGateway.cpp"
click node_datamodel "https://github.com/gmoddev/gargantuan/blob/main/src/classes/DataModel.cpp"
click node_journal "https://github.com/gmoddev/gargantuan/blob/main/src/runtime/ChangeJournal.cpp"
click node_schema "https://github.com/gmoddev/gargantuan/blob/main/src/reflection/RuntimeSchema.cpp"
click node_engine "https://github.com/gmoddev/gargantuan/blob/main/src/Engine.cpp"
click node_scripts "https://github.com/gmoddev/gargantuan/blob/main/src/scripting/ScriptEngine.cpp"
click node_players "https://github.com/gmoddev/gargantuan/blob/main/src/services/Players.cpp"
click node_physics "https://github.com/gmoddev/gargantuan/blob/main/src/physics/PhysicsBackend.cpp"
click node_animation "https://github.com/gmoddev/gargantuan/blob/main/src/animation/AnimationRuntime.cpp"
click node_network "https://github.com/gmoddev/gargantuan/blob/main/src/network/ReplicationCoordinator.cpp"
click node_remotes "https://github.com/gmoddev/gargantuan/blob/main/src/network/RemoteManager.cpp"
click node_render_publish "https://github.com/gmoddev/gargantuan/blob/main/src/render/RenderPublisher.cpp"
click node_renderer "https://github.com/gmoddev/gargantuan/blob/main/src/render/Renderer.cpp"
click node_editor_viewport "https://github.com/gmoddev/gargantuan/blob/main/src/editor/EditorViewport.cpp"
click node_packaging "https://github.com/gmoddev/gargantuan/blob/main/src/packaging/PackageBuilder.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_editor_host,node_project,node_play_session toneBlue
class node_mutation,node_datamodel,node_journal,node_schema toneAmber
class node_engine,node_scripts,node_players,node_physics,node_animation toneMint
class node_render_publish,node_renderer,node_editor_viewport toneRose
class node_network,node_remotes,node_packaging,node_studio,node_peer toneIndigo
```

## Components

### Authoring and Projects

- [Editor Host](https://github.com/gmoddev/gargantuan/blob/main/src/editor/EditorHost.cpp): `src/editor/EditorHost.cpp`
- [Project and Filesystem](https://github.com/gmoddev/gargantuan/blob/main/src/filesystem/Project.cpp): `src/filesystem/Project.cpp`
- [Play Session](https://github.com/gmoddev/gargantuan/blob/main/src/editor/PlaySession.cpp): `src/editor/PlaySession.cpp`

### Authoritative Runtime

- [Mutation Gateway](https://github.com/gmoddev/gargantuan/blob/main/src/runtime/MutationGateway.cpp): `src/runtime/MutationGateway.cpp`
- [Authoritative DataModel](https://github.com/gmoddev/gargantuan/blob/main/src/classes/DataModel.cpp): `src/classes/DataModel.cpp`
- [Change Journal](https://github.com/gmoddev/gargantuan/blob/main/src/runtime/ChangeJournal.cpp): `src/runtime/ChangeJournal.cpp`
- [Runtime Schema](https://github.com/gmoddev/gargantuan/blob/main/src/reflection/RuntimeSchema.cpp): `src/reflection/RuntimeSchema.cpp`

### Gameplay Systems

- [Engine Loop](https://github.com/gmoddev/gargantuan/blob/main/src/Engine.cpp): `src/Engine.cpp`
- [Luau Runtime](https://github.com/gmoddev/gargantuan/blob/main/src/scripting/ScriptEngine.cpp): `src/scripting/ScriptEngine.cpp`
- [Player Lifecycle](https://github.com/gmoddev/gargantuan/blob/main/src/services/Players.cpp): `src/services/Players.cpp`
- [Physics Backends](https://github.com/gmoddev/gargantuan/blob/main/src/physics/PhysicsBackend.cpp): `src/physics/PhysicsBackend.cpp`
- [Animation Runtime](https://github.com/gmoddev/gargantuan/blob/main/src/animation/AnimationRuntime.cpp): `src/animation/AnimationRuntime.cpp`

### Presentation

- [Render Publication](https://github.com/gmoddev/gargantuan/blob/main/src/render/RenderPublisher.cpp): `src/render/RenderPublisher.cpp`
- [Renderer](https://github.com/gmoddev/gargantuan/blob/main/src/render/Renderer.cpp): `src/render/Renderer.cpp`
- [Editor Viewport](https://github.com/gmoddev/gargantuan/blob/main/src/editor/EditorViewport.cpp): `src/editor/EditorViewport.cpp`

### Networking and Packaging

- [Replication Runtime](https://github.com/gmoddev/gargantuan/blob/main/src/network/ReplicationCoordinator.cpp): `src/network/ReplicationCoordinator.cpp`
- [Remote Dispatch](https://github.com/gmoddev/gargantuan/blob/main/src/network/RemoteManager.cpp): `src/network/RemoteManager.cpp`
- [Project Packaging](https://github.com/gmoddev/gargantuan/blob/main/src/packaging/PackageBuilder.cpp): `src/packaging/PackageBuilder.cpp`

### Other components

- **Gargantuan Studio**
- **Network Peers**

## Connections

- Gargantuan Studio → Editor Host: sends commands
- Editor Host → Mutation Gateway: submits edits
- Project and Filesystem → Authoritative DataModel: loads project
- Mutation Gateway → Authoritative DataModel: validates mutations
- Authoritative DataModel → Change Journal: records changes
- Play Session → Engine Loop: starts isolated runtime
- Engine Loop → Luau Runtime: steps scripts
- Engine Loop → Player Lifecycle: starts player runtime
- Engine Loop → Animation Runtime: updates animation
- Engine Loop → Render Publication: publishes scene
- Render Publication → Renderer: provides snapshot
- Editor Viewport → Render Publication: consumes frames
- Authoritative DataModel → Replication Runtime: projects state
- Replication Runtime → Network Peers: replicates state
- Remote Dispatch → Network Peers: dispatches remotes
- Project Packaging → Project and Filesystem: packages project
