Skip to content

Signal bus #21

Description

@nullbuilds

Is your feature request related to a problem? Please describe.
Godot does not provide an easy to use DI system so busses are the easiest way to connect signals for nodes instantiated dynamically.

For simplicity, many Godot games use a single bus autoload to connect nodes which need to influence each other without directly referencing one another but these autoloads can become difficult to keep track of as the project grows.

Describe the solution you'd like
A signal bus with data driven signals that any type of script can reference (static, ref counted, node, autoload). Tracking of unused or excessively called signals. A channel/scope system so all signals on a given channel can be muted when they shouldn't be listened to (eg game over signals firing while on the menu).

Describe alternatives you've considered
Basic signal bus autoloads can't tell you when a signal is no longer in use nor do they provide a way to stop a signal from being emitted when it shouldn't be.

Directly connecting component signals without a bus is possible and methods to do this already exist in the node utils script but doing this extensively requires expensive tree searches to find compatible nodes.

Additional context
Modelling the bus or signals as resources would force devs to face signals abuse upfront and could allow for easy detect of unused signals via the editor's built-in culling tool.

Metadata

Metadata

Assignees

Labels

status/approvedThis issue has been approved for implementation.type/enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions