What is the difference between plugins and modules?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Akien
:warning: Old Version Published before Godot 3 was released.

Godot uses the terms “modules” and “plugins” for different things, what is the difference between the two?

:bust_in_silhouette: Reply From: Akien

Answering myself to build up the knowledge base.

Modules are written in C++ and have direct access to the Godot API. They can be used typically to create custom nodes (such as the official gridmap module) or to bind scripting languages (like the official gdscript module). Being written in C++, they can be very efficient and extend Godot functionalities with more flexibility than plugins, but they need to be compiled together with the engine (by placing each module in the modules/ folder).

Plugins are written in GDScript and don’t need to be compiled. They can be installed on the fly to add some functionalities to the editor, such as e.g. the Tiled Tileset Importer plugin. In Godot 2.0, plugins are configured in the editor settings for all projects, while in 2.1 they will be project-specific and thus configured in the project settings (and easily installed from the asset sharing platform).

Can we (or will?) add modules on the fly too in the form of dynamic libraries? That would be handy for sharing.

Zylann | 2016-03-17 18:25

Having pre-compiled modules as dynamic libraries is quite difficult, because they would have to be compiled for each platform and using the exact same compilers as the export templates and the engine binaries.

It’s still something that we’d really like to have, and it’s being discussed in add dynamic linker support · Issue #3936 · godotengine/godot · GitHub and Include libffi · Issue #3943 · godotengine/godot · GitHub, but so far there is no clear solution to go for.

Akien | 2016-03-17 19:39