-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 a project upgrade tool for Godot 4.0 #387
Comments
I love this idea but I think it should be a separate tool, not integrated to the editor. The main reason being that once 4.0 is a few months old, this feature would instantly be deprecated. We could still make the tool easy to find on the website, maybe a subsection of the "Download" page |
Well, I would say that it mainly depends on the impact of the feature on the editor. Meaning that if it's small enough and doesn't bother anyone we might just leave it in the editor/project manager. And that's what most software do, including Unity (don't know much about other game engines). That way, even if people start with 4.0 but want to import some 3.x demo project found online, it can be done seamlessly. But I'm not in charge of the engine development so it will be what is decided to be. Also, I'm willing to work on this when the 4.0 branch become a thing. |
I just realized that something similar was already (briefly) discussed by @reduz (godotengine/godot#30736, godotengine/godot#30736 (comment)). Considering this, do we need to keep this proposal open ? |
I think it can be closed once the "internal compatibility system" is added, no? |
A formal proposal is always good to keep, I think. As for this system, I thought it could be included in the breaking versions, but removed in the next version. So e.g. to upgrade from 3.2 to 4.0.1, you'd first need to import your project in 4.0. It requires some manual work, but is still less tedious than doing it yourself and we avoid uneccessary bloat. btw, bringing up Unity here is not very good example. Upgrading from x.0.1 to x.0.1a requires 2GB download and 15 minutes of importing. In Godot you can juggle between versions pretty seamlessly and the lightweightness is a good selling point we'd rather not loose. |
For anyone who want to try implement this, I prepared test project in Godot 3.4 with almost all available functions which for now after opening in Godot 4 shows ~1400 errors. It would be great if the number of errors would decrease to ~100-200 using this tool. |
@aaronfranke wrote a shell script to convert Godot 3.x projects to Godot 4.0: https://gist.github.com/aaronfranke/79b424226475d277d0035b7835b09c5f |
Is there any preconception how it should look like(I haven't heard anything about it lately and it's quite a serious topic)? |
@qarmin For the Bash script I wrote, it operates on all types of files (scenes, GDScript, C#, project.godot, .import, etc), and it operates on the entire repository at once. |
I'm curious what is the better option to upgrade project:
This is how it upgrade tool works in 2.1 branch |
For the reference, here's another conversion script developed by @lyuma and @fire: https://github.com/V-Sekai/gd3to4 |
I already submitted most of what I had in my script to be integrated into qarmin's pr godotengine/godot#51950 and so far qarmin has done really good work implementing most of the rules I had in my script. A couple properties are hard to integrate because they require type information to know (such as Also still missing some of the EditorPlugin type apis and importers, like _edit, _handles, _get_extensions etc. One of the other things missing might |
As discussed here (godotengine/godot-docs#4960), would it make sense to integrate documentation into the converter? Bear in mind that not only the projects need to be converted from 3 to 4, the developers need to as well. If we could have a string lookup generator closely coupled to the code conversion function that map each conversion to human readable format, we could generate a reST code out of the lookup table that we could drop into the Godot docs, e.g. in the form of a table "old code" --> "new code". I think this would be a very convenient way to get Godot 3 devs up to speed with changed syntax. |
An initial version of @qarmin's upgrade tool has been merged and is available in 4.0 alpha 10: godotengine/godot#51950 We can keep this proposal open for now to keep track of further improvements to make to this tool, especially sourced from the other existing conversion tools which may handle other stuff. |
First order of business, I couldn't see shader hints in that, and they're bound to break people's shaders. |
Some random conversions missing in the official converter that you can find in mine:
I'm actually surprised that the official converter already handles built-in scripts 🤔 Other things to consider:
|
Seems that Threads has changed quite a bit and now uses a Callable.bind, as such my threading library is broke on conversion. I am working on figuring out how the change works, then I will report back.
Into
Also seems that the following has changed/moved and still needs to be accounted for in the conversion:
was converted to
but should be
needs to be converted too:
But instead comes out as:
The most obvious issue here is that GDScriptFunctionState should be removed, so if the converter could at least point out each of these issues it will help the conversion go smoother. I will say that typing one line instead of the mandatory 3 lines before is much nicer.
Becomes
But should be
Also the new documentation still has an old example here
I also just found that I should run this tool first: https://github.com/Scony/godot-gdscript-toolkit A Warning to any using ResourceLoader, it has changed dramatically. Fixing the issues will take time for sure, but it is actually a smarter system. A majority of the conversion was done on Godot 4.0-beta4. I think the converter would benefit if it ensured everything was a single line, perhaps merging some code from GDScript Toolkit to make that happen. Edit/Update (27JAN): |
This was actually renamed to
Or just |
FYI I have added many more notes to my previous comment to help with the conversion process. |
@FeralBytes Could you open a pull request to update some of the renames performed by the project converter? The code is here: https://github.com/godotengine/godot/blob/master/editor/project_converter_3_to_4.cpp |
This proposal has been implemented by godotengine/godot#51950 |
Describe the project you are working on:
I mostly make games on the side for fun using Godot 3.x but I follow its development quite closely.
Describe the problem or limitation you are having in your project:
When Godot 4.0 is released I would like to easily be able to switch to the new version with my current 3.x projects.
But being a major release, some parts of the API will change, as outlined in this issue. This can make the transition phase a bit tedious if it has to be done manually.
Describe how this feature / enhancement will help you overcome this problem or limitation:
Since the mapping between the old names and the new ones is known the project imported can probably be modified to upgrade 3.x projects to be 4.0 compatible automatically. If some parts of the project cannot be upgraded automatically (e.g. removed feature) they should be clearly listed along with some guidelines on how to deal with these issues.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
It's a bit early for this, but I can make one once I know if it's theoretically possible to do it and what would be the best solution for it.
Describe implementation detail for your proposal (in code), if possible:
Again, too early
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It probably can't.
Is there a reason why this should be core and not an add-on in the asset library?:
So that current users can migrate to 4.0 as smoothly as possible. If it's separated from the editor, most people probably won't know about it and struggle to upgrade their projects.
The text was updated successfully, but these errors were encountered: