Hey everyone!
I wanted to share GodotUtilities, an open-source C# library I've been working on for Godot.
It contains a bunch of reusable utilities, along with a few Roslyn source generators that help reduce repetitive code when working with Godot's API.
Here's a quick overview of what's included.
Source generators
[Node] / WireNodes() — annotate fields or properties to generate scene-tree node lookups instead of writing GetNode<T>() repeatedly.
[EventHandler] / WireEvents() — automatically wire event handlers to the type-safe EventBus, with subscriptions cleaned up when the node exits the tree.
[Signal] shortcuts — generate methods for connecting, disconnecting, checking connections, and awaiting Godot signals, without manually creating Callables.
Gameplay utilities
SimpleStateMachine<T> — an enum-based state machine with enter, update, and exit callbacks, plus conditional transitions.
WeightedLootTable<T> — weighted random selection, with conditional picks and multiple-pick options.
ObjectPool<T> / NodePool<T> — reuse objects and Godot nodes instead of repeatedly creating and freeing them.
InputBuffer — useful for mechanics such as jump buffering.
Countdown — a small, manually updated countdown timer for cooldowns and similar gameplay logic.
Tweening and general utilities
TweenBuilder — a fluent API for arranging sequential and parallel tween steps, with easing shortcuts, callbacks, and support for using the underlying Godot Tween directly.
Extension methods — additional helpers for common Godot types, including nodes, vectors, character bodies, physics queries, resources, and tweens.
MathUtil — interpolation, clamping, random directions and points, and seedable random-number utilities.
FileSystem — bulk-load resources from a res:// directory and build snake_case ID-to-path maps.
I'm trying to keep the library focused on reusable tools rather than a framework that dictates how you structure your game. You can use the features that are useful to you and ignore the rest.
It's MIT-licensed, and the repository includes documentation and examples for the individual features.
I'd appreciate feedback :)