Redot-Engine / redot-proposals

Redot Improvement Proposals
MIT License
33 stars 7 forks source link

Addons Future Proposal #4

Open Ughuuu opened 1 month ago

Ughuuu commented 1 month ago

Right now, add-ons can be installed per project and that's it. This plan will explain plans to extend that and form a vision of where it can be in order to maximise usability.

Add-ons vs Modules

Modules are part of the engine and are bundled with it. Examples of these are PhysicsServer2D, GDScriptLanguage. These implement an API, eg. PhysicsServer2DExtension, ScriptLanguageExtension, etc.

Add-ons are things that are not part of the engine, are built with godot-cpp (bound to a specific version, eg. 4.1, 4.2, etc.), and are downloaded and installed in the project. Examples of these are RapierPhysicsServer2D, Terrain3D, etc. The first one also implements PhysicsServer2DExtension, while the second one adds a new API.

Add-ons limitations

When installing an add-on, the workflow is you create a project, then you install all the add-ons you want. There are some limitations with this, namely:

Add-ons vision

Example vision by user @patwork for when creating a new project: image

As for managing versions/etc. a good thing would be to decouple as much as possible, possibly a package manager?

Add-ons Update

The updating of add-ons right now is very hard to do. Even if you do install an add-on and there is an update, there is no notification for update, and then for the said update, you have to manually delete all files, install new ones and restart editor (unless editor is closed).

As for update notification and versioning, there are some places add-ons come from:

For updates, at the very least, the system should be able to:

Github updates

For github, many people use it to develop their plugin, some also do release management there through github releases. This seems to be the most straightforward way to do it, however it would require a mapping between addons and github repos and github release names. Since some addons we will install we will need to probably talk to the addons developer anyway, it would be best if we could have them add some properties in their plugin.gd file.

image

As proposed by @bitbrain in his proposal for updates, we would need to expose 2 new things in the EditorPlugin:

# gets called by Godot in a separate thread
func _check_plugin_version() -> bool:
   var plugin_config:ConfigFile = ConfigFile.new()
   plugin_config.load("res://addons/pandora/plugin.cfg")
   var current_version = plugin_config.get_value("plugin", "version")

   # check latest plugin.cfg on Github
   # or verify the latest git tag etc.
   return _get_github_version() > _version_to_number(current_version)

# gets called by Godot in a separate thread
func _auto_update_plugin() -> void:
   pass

We should also expose some helpers to get github versions, etc.

For naming, I think I would like more _check_version and _update_plugin

Ughuuu commented 1 month ago

Concrete plan:

func _install_update() -> bool: return true


- Add update button in Plugins tab. Also rename Plugins tab to Addons.
- Add endorsed plugins to the plugin creation tab.
SkogiB commented 1 month ago

Excellently written and constructed issue, hoping we can get this feature in soon

tokengamedev commented 1 month ago

@Ughuuu , you can add the concrete plan as to do list in the original text,

Regarding tasks, I also want to add the following,

Also, in this proposal are we considering the following:

  1. Manage global addons (Install, Update, discover and link)
  2. Are we planning to change Project manager/ Create Project Dialog / to add addons to the project in the start.

IMO the above two items require separate proposal as it pretty big items by themselves or if you are including in this proposal, it is fine

heavymetalmixer commented 1 month ago

It would be a great adition to the engine.