This page introduces the Godot Engine repository at a high level: what it contains, how it is structured, and how its major subsystems relate to each other. It is intended as a starting point for navigating the codebase.
For build system details, see Build System. For individual subsystem deep-dives, see Major Systems and Third-Party Libraries.
The repository is a monorepo containing the engine runtime, the editor, platform backends, optional modules, third-party libraries, and documentation.
| Directory | Contents |
|---|---|
core/ | Fundamental types, object model, OS abstraction, I/O, configuration |
scene/ | Scene graph, nodes, GUI controls, animation, resources |
servers/ | Rendering, physics, audio, navigation, display, text servers |
modules/ | Optional compiled-in modules (GDScript, C#/Mono, etc.) |
editor/ | Full editor UI and tools (compiled only when TOOLS_ENABLED) |
platform/ | Platform-specific OS and display implementations |
drivers/ | Low-level hardware drivers (Vulkan, D3D12, GLES3, file I/O, audio) |
main/ | Engine entry point and initialization sequence |
thirdparty/ | Bundled third-party libraries |
doc/ | Class reference documentation in XML format |
tests/ | Unit and integration test suite |
Sources: main/main.cpp31-157 main/main.cpp118-140
The same source tree produces three distinct binary types, selected at compile time via the SCons build system defined in the root SConstruct file SConstruct161-186:
| Build Type | Compile Flag | Contents |
|---|---|---|
| Editor | target=editor | Runtime + full editor UI + import pipeline (TOOLS_ENABLED) |
| Debug export template | target=template_debug | Runtime + debug helpers, no editor (DEBUG_ENABLED) |
| Release export template | target=template_release | Minimal runtime only |
The editor/ directory is guarded throughout by #ifdef TOOLS_ENABLED main/main.cpp118-140 The Main class checks for the editor or project_manager flags at runtime to decide which MainLoop to start.
Sources: main/main.cpp118-140 main/main.cpp164-180 SConstruct161-186
The engine is organized into layers. The diagram below maps system names to the primary C++ classes that implement them.
Diagram: Engine Layered Architecture (Code Entities)
Sources: main/main.cpp164-195 core/os/os.h46-145 core/config/project_settings.h57-70
The Main class in main/main.cpp is responsible for bootstrapping the engine. It proceeds in phases before handing off to a MainLoop.
Diagram: Main Startup Sequence
Sources: main/main.cpp164-195 core/os/os.h132-140
Singleton instances initialized during setup() and setup2():
| Singleton | Class | Header |
|---|---|---|
engine | Engine | core/config/engine.h |
globals | ProjectSettings | core/config/project_settings.h |
input | Input | core/input/input.h |
display_server | DisplayServer | servers/display/display_server.h |
rendering_server | RenderingServer | servers/rendering/rendering_server.h |
Sources: main/main.cpp164-195 core/config/project_settings.cpp57-59
All engine objects inherit from Object core/object/object.h120 The ClassDB singleton maintains a registry of all registered classes, their methods, properties, and signals core/object/class_db.h50-100 This registry powers GDScript introspection, the editor Inspector, and the GDExtension API.
Node extends Object and is the base for all scene objects. Resource is the other major Object subclass, representing loadable/saveable data, managed by the ResourceLoader core/core_bind.cpp55-84
Diagram: Core Type Hierarchy
Sources: core/object/object.h120-230 core/core_bind.h55-84 core/os/os.h46-145 core/core_bind.cpp55-84
Godot's functionality is divided into several major subsystems that interact through well-defined APIs.
For details, see Major Systems.
Scenes are trees of Node objects. The SceneTree drives the per-frame process/physics loop. Nodes notify each other through the notification system and signals core/object/object.h120-230
Rendering uses a server pattern. RenderingServer is a thread-safe API that accepts commands from the main thread. Low-level drivers for Vulkan, D3D12, and GLES3 handle the hardware communication platform/windows/os_windows.cpp84-92
Scripting languages register themselves as ScriptLanguage implementations. GDScript (modules/gdscript/) and C# (modules/mono/) are the primary implementations main/main.cpp148-157
The editor is a massive tool suite built on top of the engine's UI system. It is orchestrated by EditorNode editor/editor_node.h121 and is only active when TOOLS_ENABLED is defined main/main.cpp118-140
Platform-specific code is in platform/. Each platform provides a concrete OS subclass (e.g., OS_Windows in platform/windows/os_windows.cpp31) and handles platform-specific detection in detect.py platform/windows/detect.py19-21
The abstract OS interface (core/os/os.h46-145) covers process management, file access, and environment variables. DisplayServer covers window creation and input events.
Sources: platform/windows/os_windows.cpp1-160 core/os/os.h46-145 platform/windows/detect.py19-21
Godot bundles several third-party libraries in the thirdparty/ directory to ensure consistent builds across all platforms. These include graphics APIs, audio codecs, and compression tools.
For details, see Third-Party Libraries.
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.