# cubeww/godot-aot architecture

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

- Interactive diagram: https://gitdiagram.com/cubeww/godot-aot
- Repository: https://github.com/cubeww/godot-aot

## Overview

This is a Godot 4.7 fork whose distinguishing product capability is selectable GDScript ahead-of-time export: the editor validates a native-AOT preset, generates C++, builds a project-specific executable, and packages resources with script markers rather than source or bytecode. The regular editor and runtime continue to use the GDScript VM. The README documents the AOT stages, but their implementation files are not present in the supplied tree; those subsystem paths and links therefore reflect documented behavior, not inspected source. The graph also includes a compact view of the engine and editor layers identified by the source index.

Main entry points: [`editor`](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/editor) (Godot editor), [`main/main.cpp`](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/main/main.cpp) (Engine startup), [`modules/gdscript`](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript) (Native generation), [`editor/export/export_template_manager.cpp`](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/editor/export/export_template_manager.cpp) (Export management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_export["AOT export"]
  node_preset["Export preset"]
  node_validation["Export validation"]
  node_template["Native template"]
  node_executable["Project executable"]
  node_packaging["Resource packaging"]
end

subgraph group_scripts["GDScript backend"]
  node_generation["Native generation"]
  node_markers["Script markers"]
  node_script_runtime["GDScript VM"]
end

subgraph group_editor["Editor and runtime"]
  node_editor["Godot editor"]
  node_export_manager["Export management"]
  node_editor_ui["Editor interfaces<br/>[editor_node.h]"]
end

subgraph group_engine["Godot engine"]
  node_engine_entry["Engine startup<br/>[main.cpp]"]
  node_engine_config["Engine configuration<br/>[engine.cpp]"]
  node_project_settings[("Project settings<br/>[project_settings.h]")]
  node_resource_loading["Resource loading<br/>[resource_loader.h]"]
  node_object_runtime["Object and calls<br/>[object.h]"]
  node_platform_services["Platform services<br/>[os.h]"]
  node_display["Display server<br/>[display_server.h]"]
  node_engine_version["Engine version<br/>[version.h]"]
end

node_developer(("Project developer"))
node_compiler["Native toolchain"]
node_distribution["Exported game"]

node_developer -->|"selects backend"| node_preset
node_editor -->|"configures"| node_preset
node_preset -->|"selects AOT"| node_validation
node_validation -->|"validates inputs"| node_generation
node_generation -->|"generates C++"| node_template
node_template -->|"builds with"| node_compiler
node_compiler -->|"compiles and links"| node_executable
node_generation -->|"creates markers"| node_markers
node_editor -->|"exports resources"| node_packaging
node_executable -->|"ships with"| node_distribution
node_packaging -->|"packages"| node_distribution
node_markers -->|"included in pack"| node_distribution
node_editor -->|"runs scripts in"| node_script_runtime
node_engine_entry -->|"uses"| node_engine_config
node_engine_entry -->|"uses"| node_project_settings
node_engine_entry -->|"uses"| node_resource_loading
node_engine_entry -->|"uses"| node_object_runtime
node_engine_entry -->|"uses"| node_platform_services
node_engine_entry -->|"uses"| node_engine_version
node_editor -.->|"manages templates"| node_export_manager
node_editor -.->|"uses"| node_editor_ui
node_editor -.->|"uses"| node_display

click node_preset "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_validation "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_generation "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_template "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_executable "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_packaging "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_markers "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_editor "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/editor"
click node_export_manager "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/editor/export/export_template_manager.cpp"
click node_script_runtime "https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript"
click node_engine_entry "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/main/main.cpp"
click node_engine_config "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/config/engine.cpp"
click node_project_settings "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/config/project_settings.h"
click node_resource_loading "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/io/resource_loader.h"
click node_object_runtime "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/object/object.h"
click node_platform_services "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/os/os.h"
click node_editor_ui "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/editor/editor_node.h"
click node_display "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/servers/display/display_server.h"
click node_engine_version "https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/version.h"

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_preset,node_validation,node_template,node_executable,node_packaging toneBlue
class node_generation,node_markers,node_script_runtime toneAmber
class node_editor,node_export_manager,node_editor_ui toneMint
class node_engine_entry,node_engine_config,node_project_settings,node_resource_loading,node_object_runtime,node_platform_services,node_display,node_engine_version toneRose
class node_developer,node_compiler,node_distribution toneIndigo
```

## Components

### AOT export

- [Export preset](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [Export validation](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [Native template](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [Project executable](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [Resource packaging](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`

### GDScript backend

- [Native generation](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [Script markers](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`
- [GDScript VM](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/modules/gdscript): `modules/gdscript`

### Editor and runtime

- [Godot editor](https://github.com/cubeww/godot-aot/tree/codex/gdscript-aot/editor): `editor`
- [Export management](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/editor/export/export_template_manager.cpp): `editor/export/export_template_manager.cpp`
- [Editor interfaces](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/editor/editor_node.h): `editor/editor_node.h`

### Godot engine

- [Engine startup](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/main/main.cpp): `main/main.cpp`
- [Engine configuration](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/config/engine.cpp): `core/config/engine.cpp`
- [Project settings](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/config/project_settings.h): `core/config/project_settings.h`
- [Resource loading](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/io/resource_loader.h): `core/io/resource_loader.h`
- [Object and calls](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/object/object.h): `core/object/object.h`
- [Platform services](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/os/os.h): `core/os/os.h`
- [Display server](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/servers/display/display_server.h): `servers/display/display_server.h`
- [Engine version](https://github.com/cubeww/godot-aot/blob/codex/gdscript-aot/core/version.h): `core/version.h`

### Other components

- **Project developer**
- **Native toolchain**
- **Exported game**

## Connections

- Project developer → Export preset: selects backend (evidence: `README.md`)
- Godot editor → Export preset: configures (evidence: `README.md`)
- Export preset → Export validation: selects AOT (evidence: `README.md`)
- Export validation → Native generation: validates inputs (evidence: `README.md`)
- Native generation → Native template: generates C++ (evidence: `README.md`)
- Native template → Native toolchain: builds with (evidence: `README.md`)
- Native toolchain → Project executable: compiles and links (evidence: `README.md`)
- Native generation → Script markers: creates markers (evidence: `README.md`)
- Godot editor → Resource packaging: exports resources (evidence: `README.md`)
- Project executable → Exported game: ships with (evidence: `README.md`)
- Resource packaging → Exported game: packages (evidence: `README.md`)
- Script markers → Exported game: included in pack (evidence: `README.md`)
- Godot editor → GDScript VM: runs scripts in (evidence: `README.md`)
- Engine startup → Engine configuration: uses (evidence: `main/main.cpp`)
- Engine startup → Project settings: uses (evidence: `main/main.cpp`)
- Engine startup → Resource loading: uses (evidence: `main/main.cpp`)
- Engine startup → Object and calls: uses (evidence: `main/main.cpp`)
- Engine startup → Platform services: uses (evidence: `main/main.cpp`)
- Engine startup → Engine version: uses (evidence: `main/main.cpp`)
- Godot editor → Export management: manages templates (evidence: `editor/export/export_template_manager.cpp`)
- Godot editor → Editor interfaces: uses (evidence: `editor/export/export_template_manager.cpp`)
- Godot editor → Display server: uses (evidence: `editor/export/export_template_manager.cpp`)
