-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Implement a patch system. #64712
Implement a patch system. #64712
Conversation
Here was my notes when I looked at the updating the game problem. https://docs.google.com/document/d/1wU-q23wSeXnnXkJKdiFAScvChCA82dTcZe5y46_KxKs/edit?usp=sharing Hope it is useful for future work. |
7b7def6
to
8efe374
Compare
d62eb5f
to
32e4a10
Compare
Note: If encrypted PCKs (exported with "Encrypt Index" option) are used in the "Patches" tab, then a custom build of the editor is required. Otherwise, Godot will not be able to load these PCKs to check the changes. |
One question: is there a way to use this functionality from code? I'd love to be able to export differential PCKs from a custom editor interface. Anyway, this is what I was looking for! |
It can't be used from GDScript, if that's what you're mean. |
Hello! What's the status on this pr? I'm curious about when it would be merged because it would be nice to have for my project. |
4.2 is currently in feature freeze, and this PR needs to be rebased before it can be merged. It also needs a review and testing from users who need this feature, to make sure it works as expected. |
ZIP-packs do not store file hashes, so all files included in the archive are considered modified. godot/core/io/file_access_zip.cpp Lines 196 to 198 in 658e97c
|
Ah. That seems like a fairly big gotcha. I suppose it could be made clear in the documentation somewhere, but wouldn't it make more sense then to just disallow ZIP packs from being listed among the patches altogether, or at least until hashes can be added to them in some way (if it all possible)? |
For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
Just remove the *.zip filter. But there will be no warning if the user ignores the filter and selects the zip file.
I have an implementation with separate statuses. This seems to require discussion before adding these changes to this PR. |
Yeah, I personally think this is fine, although there should ideally be some accompanying documentation that explains why this is the case as well. It is now however somewhat strange that you're allowed to export a ZIP pack as a patch, but not actually add it to the list of patches. There may perhaps be some argument for disallowing ZIP packs to even be exported as patches, although I'm not sure through what mechanism that would be done.
I think this is a lot better than the asterisks. I would still perhaps opt for just a complementary array of paths rather than this ints-as-booleans status array though. In fact, seeing as how the vast majority of patches that will ever be added will stay enabled, flipping it around and storing it as something like a Here's what that would look like: mihe/godot@ The only gotcha with this is of course that a patch can't be listed multiple times in the list of patches, but that strikes me as potentially problematic either way. EDIT: In case it's not clear from the diff alone, here's what the separate statuses would store as (with one patch disabled): patches=PackedStringArray("my_game.pck", "my_first_patch.pck", "my_second_patch.pck")
patch_statuses=PackedInt32Array(1, 0, 1) ... versus my suggestion: patches=PackedStringArray("my_game.pck", "my_first_patch.pck", "my_second_patch.pck")
disabled_patches=PackedStringArray("my_first_patch.pck") |
Does the hash of GDScript files change when an export is made? When I export a main .pck, set it as a patch, and then export a patch as a .zip file and look inside there's a .gdc file inside even though I made no changes to the code. Specifically I'm using the Compatibility renderer and the script in the .zip seems to be the script used by my main scene. When I switched to Forward+ there was another script in the .zip that I made to test the only main scene theory. |
Yes when |
Ah I see, that makes sense. Hopefully this gets merged soon as they are starting to tease the feature freeze and I don't really want to wait for another 6 months. |
The feature freeze is already in effect. |
Oh, so it is. Guess I missed that. Is there any chance they'll still merge this anyway as it's been on the list for quite some time now? |
No, but this is on the roadmap for 4.4, and should be merged early in that dev cycle to get ample testing. We're already aware of potential follow-up changes that would be needed to really have a solid system for patches and DLCs, covering all the different use cases (adding, removing, replacing files, etc.). In the meantime of course, this PR is up-to-date with the |
In the interest of hopefully getting this PR merged shortly, I've gone ahead and rebased it against latest There have apparently been some changes to I also threw in some other minor changes that I personally feel should be made, especially with the new patch methods now being exposed as part of the stable API. In total the changes (compared to PoqXert/godot@5b17ac4) are as follows:
I also stumbled upon a bug, where GDScript files exported as binary tokens (compressed or otherwise) would often be exported as part of any patch PCK despite the files not having changed. This turned out to be because of random memory being written as part of the Anyway, feel free to grab the rebased branch as a whole or cherrypick the pieces you feel are appropriate. So long as this gets rebased and merged in some fashion we can work out the kinks afterwards I guess. Given that the issue of the enabled/disabled statuses seems to have been resolved I don't really have any more feedback to give here, and would be happy to give this PR my approval once it's been rebased (whatever that's worth). |
@PoqXert Any chance you'll be able to do the rebase within the next few days? |
I can't do this until next weekend. If you want to continue working on this feature earlier, you can open a new PR and close this one. |
Great, thank you! I'll go ahead and do exactly that. Expect to see a superseding PR shortly. I'll be sure to add the appropriate co-author attribution and all that stuff of course. |
See #97118. |
Thanks a lot for the contribution nonetheless! |
This PR adds
Export As Patch
setting for exporting PCK/ZIP.When enabled, godot compare exported files and files in packs specified in the
Patches
tab. And exports only new/changed files.Adds
--export-patch
option.Proposal: godotengine/godot-proposals#146