Godot addons offer a powerful way to extend the engine's functionality without having to modify its core. This flexibility empowers the community to create custom solutions without burdening the engine itself. However, as addon developers, we must strike a balance between compatibility and functionality. This article explores the trade-offs involved, focusing primarily on Godot Engine 4.x.
Godot currently has two major versions in circulation:
Each major version consists of minor versions (e.g., Godot 4.0, 4.1, etc.) that mainly introduce new features and bug fixes. These are followed by maintenance versions (e.g., 4.0.1, 4.1.2) focusing on bug fixes, compatibility improvements, and minor UX enhancements. Typically, maintenance releases are non-API-breaking.
When developing addons, it's crucial to consider which Godot features you'll be using from the outset. Suppose you have an addon compatible with all minor versions of Godot 4.x. Your initial compatibility matrix might look like this:
Godot Version | Addon Version |
---|---|
4.0.x | 1.0.x |
4.1.x | 1.0.x |
Let's say Godot 4.1 introduces a new feature called static variables:
class_name CustomClass extends RefCounted
# shared between instances of this class
static var my_var:int
Using this feature would make your addon incompatible with Godot 4.0.x. You now have three options:
✅ Maximum flexibility
⛔️ High administrative overhead
Godot Version | Addon Version |
---|---|
4.0.x | 1.0.x |
4.1.x | 1.1.x |
You could maintain a separate 1.0
branch for Godot 4.0.x compatibility, cherry-picking bug fixes as needed. This approach increases administrative overhead, especially if you're using Continuous Integration.
✅ Access to all new features
⛔️ Risk of alienating some users
Godot Version | Addon Version |
---|---|
4.1.x | 1.1.x |
By dropping support for older versions, you can fully utilize the new features but may lose users who are still on Godot 4.0.x.
✅ Broad user base
⛔️ Limited access to new features
Godot Version | Addon Version |
---|---|
4.x | 1.x |
This approach minimizes administrative work but restricts you from using newer features.
The best approach depends on various factors:
If you wish to support both Godot 3 and 4, you can maintain separate branches for each. For example, my addon beehave has two branches: godot-4.x and godot-3.x, each tailored to its respective Godot version.