-
-
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
Create a migration scheme for Godot Engine resources #5945
Comments
I agree that this feature is needed, my current situation is different, but I'm migrating in the following way for now.
Even when I was using Unity, most of the time to do such migrations, I had to create two different types of “old” and “new” properties, migrate them to the new ones, and then replace the “new” ones with the “old” ones again after a period of time. |
The current Godot Engine contributor consensus is to avoid creating a migration database and work on forward-compatible properties as needed. I still favour the migration database approach. What is a forward-compatible property? A forward-compatible property is a pattern where we create a boolean property whose existing behaviour happens when the property is false. The new behaviour occurs when the boolean is true. So when a new instance is created, it uses the new behaviour while the old behaviour is kept when the boolean property is false. |
I'm not sure I'm qualified to comment here, but if the workaround is to simply handle the old/current behavior with just one bool property, I wonder if we'd have the following issue :
So I'm thinking, as you suggested in your suggestion, to import the existing resource into an intangible instance called MissingResource and resolve its contents. I'm also curious how other people (especially add-on and core engine developers) deal with migrations in these situations, I've only been writing Godot for a short time, so I'm afraid that I may not even realize that there is a much better way to deal with these migration issues. |
Both MissingResource and MissingNode already exist. https://docs.godotengine.org/en/stable/classes/class_missingresource. https://docs.godotengine.org/en/stable/classes/class_missingnode.html Although the team has yet to agree to this proposal of creating a change-by-change migration, it is the best solution, as far as I know. This proposal is in limbo. |
Describe the project you are working on
We are making a 3d social vr online game.
Describe the problem or limitation you are having in your project
We want to keep distributed scenes updated and migrate to the latest as soon as possible. This solves making it easier to upgrade godot engine scenes and scanning for security problems.
@SaracenOne was worried about code improvements when we do a possible compatibility breakage like in godotengine/godot#65312 where an enumeration had an entry removed and then a new entry was added in the same spot.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
We want to use the original resource. Extract the mapping of property name to Variant. Run the migration by taking Map<StringName, Variant>, the two pairs of versions, and migrations. Save the properties into a MissingResource. On load the MissingResource will convert to a resource.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Reference:
Contributors:
If this enhancement will not be used often, can it be worked around with a few lines of script?
We need to store the migration in the engine.
Is there a reason why this should be core and not an add-on in the asset library?
The engine developers need to create a migration for any compatibility breaking changes.
The text was updated successfully, but these errors were encountered: