Godular

Godular helps you organize a Godot game into modules and connect their services. A module declares what it needs, what it provides, and what it shares with other modules.

Godular supplies the dependencies and starts modules in dependency order. Each provider is created once in its module and shared with its consumers. Godular waits for factories and module startup to finish before it starts dependent work.

Start a module

  1. Install the addon and enable the plugin. See Getting started.

  2. Declare a capability, a service, and a module.

# game_module.gd
class_name GameModule
extends GdlrModule

static var PROVIDERS = {
	CapScore: {"use": SvcScore},
}
static var TREE_EXPORTS = [CapScore]
  1. Mount and start the root module once.

await GdlrModuleManager.mount(GameModule)
await GdlrModuleManager.start()
  1. Request a tree export from any node.

var score: CapScore = GdlrModuleManager.request(CapScore)

Guides

Reference

Project

AI disclosure

Code, documentation, and the project icon were produced with AI assistance under human review.