Open ShawkMusic opened 4 years ago
As far as I know, there was a similar idea regarding treating plugins (current addons) as nested Godot projects.
The complexity of resolving exact inheritance between such projects may not be worth it, but allowing to generate projects out of templates is a useful feature to have in my opinion.
For example, I could create a personal template for 3D FPS games (with my own settings) so whenever I want to make a 3D FPS game, I can easily just select the 3D FPS template project as a base and start working on the project.
This can be accomplished by uploading your template to the asset library. https://godotengine.org/asset-library/asset
Once uploaded, it can be instanced from the "Templates" tab in the Godot project manager.
Furthermore, I want to have changes I make to the base project also affect all the projects inheriting from it.
There is no simple way to solve this, any solution would be convoluted and confusing. Also, this is a very niche problem.
imo having predefined settings of projects could be really useful but project inheritance way could be not easy, especially for beginners.
I think it would be enough to have something like project templates: you could create a project, do some settings, then save it as a project template.
Then for example in Project manager you could select Project Templates tab then select a template and create new project from this template.
but project inheritance way could be not easy, especially for beginners.
Why? They could just not use it. Should we remove scene inheritance as well because it would be confusing for beginners?
I think it would be enough to have something like project templates: you could create a project, do some settings, then save it as a project template.
Then for example in Project manager you could select Project Templates tab then select a template and create new project from this template.
I mean, I guess we could do that instead but I really don't feel like the concept of project inheritance is as complicated as people in this thread are making it out to be. It would be exactly the same as how it works with scene inheritance, which the engine already has and any competent Godot developer understands, but with projects instead.
Project inheritance would be much more useful then templates because if I later decide to change something about the template, that change would automatically reflect on all the projects that inherit from it, without me needing to manually go through each project and change it.
Again, this is exactly how it already works with scene inheritance. This isn't anything groundbreaking.
One issue with project inheritance is that it will likely make teamwork more difficult. If you don't use a monorepo approach, other team members will have to a clone a bunch of Git repositories just to set up the project locally.
One issue with project inheritance is that it will likely make teamwork more difficult. If you don't use a monorepo approach, other team members will have to a clone a bunch of Git repositories just to set up the project locally.
That's a good point. I suppose you could add a button that would create an independent version of the project by making a copy of the project folder but with all the inherited files copied as new files as well (similar to how the "Make Local" button on Instanced scenes works), but at that point you could make the argument that adding that feature for that specific use case is a little bit too niche and not worth the time and effort of programming it in to the engine, which I would begrudgingly accept.
Regardless, I think this would still be pretty useful for people who work alone or for teams who are willing to go through the effort of setting the dependencies up.
It's not as complicated as it sounds. It's basically what we already have with scene inheritance but with projects.
I think no one disagrees that we should certainly and at the very least add personal project templates.
Are there any popular software that use this feature in core?
Describe the project you are working on: This applies to almost every project I've made
Describe the problem or limitation you are having in your project: I want to easily create new projects with pre-chosen elements (like screen resolution, project settings, some premade nodes, etc.) based off another project. For example, I could create a personal template for 3D FPS games (with my own settings) so whenever I want to make a 3D FPS game, I can easily just select the 3D FPS template project as a base and start working on the project. Furthermore, I want to have changes I make to the base project also affect all the projects inheriting from it. This can technically already be done now by duplicating the project folder in the OS file explorer and renaming it but it's somewhat clumsy and if I change something from the base project later, the changes won't be reflected on the new one, since it's just a copy and not truly inherited.
Describe the feature / enhancement and how it helps to overcome the problem or limitation: When creating a project, add an option to select another project that you want this one to inherit from. This would be like using
extends
on a script or creating an inherited scene, except instead of being between two different scripts or scenes, it would be between two projects. Now I'm not only able to get up and running with a new project faster, but I'm also able to easily make changes to multiple projects by just changing one. It's the same benefits as inherited scenes andextends
scripts.Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: This is an example of how different projects could inherit from others:
Project 1 -- Feature 1 -- Feature 2
Project 2 (inherits from Project 1) -- Feature 1 -- Feature 2 (modified) -- Feature 3
Project 3 (inherits from Project 2) -- Feature 1 -- Feature 2 (modified) -- Feature 3 -- **Feature 4
Project 4 (inherits from Project 2) -- Feature 1 -- Feature 2 (modified) -- Feature 3 (modified) -- Feature 5
If I later decide I want to change a feature (for example, the screen resolution settings or the node configuration) from Project 1, I would want it to reflect on all the projects inheriting from it. With this method, I can just change it and all the projects inheriting it will change along with it. As it is now, I would have to manually go through every project and change it, which is extremely inefficient.
If this enhancement will not be used often, can it be worked around with a few lines of script?: No
Is there a reason why this should be core and not an add-on in the asset library?: I'm pretty sure this isn't possible with add-ons. Besides, I feel like this is important enough to be useful to everyone, as it's a very fundamental feature that can be helpful to any kind of project.
Potential issues that could arrise -Sharing your project with someone else or sending it to another computer would require you to send all the parent projects as well. This could be fixed by adding a button to export your project as an independent version, which could duplicate all the parent assets as actual files instead of links. -Having files, assets and settings that come from other projects could get confusing This could be fixed by having the inherited assets be greyed out and having any parameters that get changed have a button appear next to it to set it back to being inherited.