Project Foundations
Feature-based organization, consistent naming, and version control hygiene define professional Godot projects.
Available Scripts
Core Scaffolding (Stateful / Persistent)
- project_bootstrapper.gd: Auto-generates feature folders and .gitignore.
- runtime_configurator.gd: Applies high-performance profiles and saves
override.cfg. - managed_autoload.gd: Advanced Singleton pattern with
RefCounteddelegation. - global_event_bus.gd: MANDATORY for decoupled global signals — do not re-inline EventBus samples in chat.
- node_pooling_system.gd: Thread-safe Object Pool for high-frequency scene instantiation.
- async_resource_loader.gd: MANDATORY for threaded scene transitions — do not re-inline SceneManager samples.
Runtime Utilities (Stateless / Lightweight)
- base_data_resource.gd: Reactive Resource foundation using
emit_changed(). - advanced_telemetry_logger.gd: Custom OS-level
Loggerfor crash reporting. - threaded_task_worker.gd: Robust
WorkerThreadPoolimplementation. - action_buffer_input.gd: Foundational
_unhandled_inputbuffer. - build_metadata_provider.gd: Native extraction of version and build metadata.
- feature_scaffolder.gd / scene_naming_validator.gd: Feature folder + naming gates.
Do NOT Load
dependency_auditor.gdunless troubleshooting loading errors.
NEVER Do (Expert Anti-Patterns)
Global Architecture
- NEVER group by file type —
/scripts,/spritesfolders. Nightmare maintainability. Use feature-based:/player,/ui. - NEVER mix snake_case and PascalCase in files — Standard: snake_case for files, PascalCase for nodes.
- NEVER use hardcoded get_node() paths — Brittle on reparenting. Use
%SceneUniqueNamesfor stable references. - NEVER use monolithic Autoloads — Avoid managers that hold visual node references; keep singletons focused on pure data or RefCounted delegation.
Resource Management
- NEVER forget .gitignore — Committing
.godot/folder = 100MB+ bloat + conflicts. - NEVER skip .gdignore for raw assets — Design source files (
.psd,.blend) in root will be imported unless ignored. - NEVER modify globally shared Resources directly — Strictly call
duplicate(true)for unique instances with independent state.
Performance & Threading
- NEVER block the main thread with
load()— Strictly useResourceLoader.load_threaded_request()for async scene transitions. - NEVER modify the SceneTree from a background thread — Strictly use
call_deferred()for thread-to-main-thread synchronization. - NEVER skip Mutex locking during pooled access — Strictly ensure thread-safety when using a shared
WorkerThreadPoolor Object Pool. - NEVER use
_process()for precise input — Tied to visual framerate. Strictly use_unhandled_input()to capture exact, frame-independent events.
Ownership decision tree
| Need | Prefer | Avoid |
|------|--------|-------|
| Everything for one feature (player, HUD panel) | Feature folder scene module | Type folders (/scripts, /sprites) |
| Cross-scene service with lifecycle (save, audio bus) | Autoload via managed_autoload.gd | Stuffing UI nodes into singletons |
| Many publishers/subscribers, no ownership | EventBus → MANDATORY global_event_bus.gd | Autoload that imports half the game |
| One scene's private wiring | Scene-local node + %UniqueName | Global bus for parent→child calls |
1. Naming Conventions
- Files & Folders:
snake_case(C# exception: PascalCase class-match). - Node Names:
PascalCase. - Exports:
snake_case; Inspector Title-Cases them. - Private: leading
_on members and virtuals (_ready,_process). - Signals: past-tense
snake_case(health_changed). - Unique Names:
%SceneUniqueNamesover brittleget_node()paths.
2. Feature-Based Organization
Group by feature (/entities/player, /ui/main_menu), not by file type. Keep /common, /levels, /addons.
3. Version Control
Godot-aware .gitignore (ignore .godot/) + .gdignore on raw design sources.
Workflow: Scaffolding a New Project
- Ensure
project.godotexists → runproject_bootstrapper.gd/ createentities/,ui/,levels/,common/. - Setup Git
.gitignore+ document feature-based layout inREADME.md. - Register lean Autoloads only after the ownership decision tree says so.
Typed GDScript strictness (foundations-only)
Full typed-GDScript migration lives in godot-gdscript-mastery.
For new foundations projects: Project Settings → Debug → GDScript → Untyped Declaration = Warn or Error.