Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addons Future Proposal #4

Open
Ughuuu opened this issue Oct 15, 2024 · 4 comments
Open

Addons Future Proposal #4

Ughuuu opened this issue Oct 15, 2024 · 4 comments

Comments

@Ughuuu
Copy link

Ughuuu commented Oct 15, 2024

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:

  • Github
  • Gitlab
  • Other(eg. godot addons website or other websites for addons)

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

  • get the latest version of the addon
  • get the update mechanism of the addon.

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
Copy link
Author

Ughuuu commented Oct 15, 2024

Concrete plan:

  • extend EditorPlugin with:
func _is_update_available() -> bool:
	return true
	
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
Copy link

SkogiB commented Oct 16, 2024

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

@tokengamedev
Copy link

tokengamedev commented Oct 16, 2024

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

Regarding tasks, I also want to add the following,

  • Way of identifying the plugin has a new version (design) it will be called from is_update_available.
  • Way of migrating Godot plugins to Redot addons.

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
Copy link

It would be a great adition to the engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants