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

Add the ability to create inherited projects #1360

Open
Tracked by #15
ShawkMusic opened this issue Aug 13, 2020 · 7 comments
Open
Tracked by #15

Add the ability to create inherited projects #1360

ShawkMusic opened this issue Aug 13, 2020 · 7 comments

Comments

@ShawkMusic
Copy link

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 and extends 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.

@Xrayez
Copy link
Contributor

Xrayez commented Aug 13, 2020

#65 shares similar problem (on the scene level), but I think the general problem is exactly this proposal. Current template projects are not so useful in Godot currently (more like a collection of projects)...

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.

@aaronfranke
Copy link
Member

aaronfranke commented Aug 15, 2020

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.

@me2beats
Copy link

me2beats commented Sep 9, 2020

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.

@ShawkMusic
Copy link
Author

ShawkMusic commented Nov 4, 2020

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.

@Calinou
Copy link
Member

Calinou commented Nov 4, 2020

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.

@ShawkMusic
Copy link
Author

ShawkMusic commented Apr 11, 2021

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.

@me2beats
Copy link

Are there any popular software that use this feature in core?

@Calinou Calinou changed the title Ability to make inherited projects Add the ability to create inherited projects Sep 24, 2021
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

5 participants