I am looking through the engine code, and I'm trying to get a grasp of the functional reasons and the philosophy behind the distinction between Core components and Module components. I'm having a very hard time finding any writing about this on the internet. What makes something belong in core/
, and what makes something belong in modules/
? Does the engine functionally handle inhabitants of modules/
different than those of core/
?
My impression is that Core components are things which are absolutely essential to the engine's functioning, whereas Modules are things which can be done without or replaced. In practice though it seems to be murkier. I'll give two examples.
The Input system lives inside core/
. This makes sense. Every program will need some input, and even the Godot Editor uses Input to handle the user interacting with the editor. However, perhaps I want to replace Input with a different input system. Perhaps I want to simply extend its functionality. I came across this proposal which has been stuck in limbo for a while. The proposer would like to add support for two or more mice and for that to correctly propagate via InputEvents. This is not something which is easily solved without modifying Input and other classes which live in core/
. For reasons such as these, it seems like it would make sense for Input and related to be a Module.
GDScript is inside modules/
. This makes sense. You could strip out GDScript and make a game entirely with C++ if you want to. However, the GDScript module and the script-editing-related classes under editor/
are interdependent. The editor overall won't function quite right without either of them.
So I feel like I could use some help understanding the decision-making and the dichotomy. Any thoughts are appreciated, and I have some specific questions regarding Input. Would it make sense for Input to exist as a module? Would it actually make a functional difference for it to be a module? Does that have any affect on performance or compilation? Is it any easier to maintain a git branch with a modified module than a branch with a modified core component? Would it make any sense to create a proposal for extracting Input into a module?
Hoping this post catches the eyes of someone wiser in the ways of the engine than I!