Skip to content

Add v6 spec#2

Merged
black-sliver merged 1 commit intomasterfrom
v6
May 7, 2024
Merged

Add v6 spec#2
black-sliver merged 1 commit intomasterfrom
v6

Conversation

@black-sliver
Copy link
Owner

@black-sliver black-sliver commented Mar 3, 2024

Now that more games use custom APPatch (and we have proper inheritance) and now that APProcedurePatch is on the horizon, we should define procedure to mark the patch file as such. Note that compatible_version can and should stay at 5 for APDeltaPatch and Z5 patches for backwards compat during rollout.

This suggestion is slightly incompatible to the current APProcedurePatch PR in that it allows procedure to be absent.

If procedure is defined, and it is not [["apply_bsdiff4", ["delta.bsdiff4"]]], then compatible_version has to be set to 6 to properly error out when trying to use an outdated patcher.

The "custom" APPatch specifically uses the same "procedure" field as APProcedurePatch to make it fail if we were to try using "custom" in a APPP implementation.

If no procedure is defined, nor can it be detected as v5 DeltaPatch nor as v5 ZPF patch, it's actually an APContainer, not an APPath, i.e. there is no "apply" or "patch" functionality. Factorio mods are one example of this.

@beauxq
Copy link

beauxq commented Mar 3, 2024

I'm trying to understand the purpose of this, because it's still a little fuzzy for me.

Are you thinking of running the necessary python code on evermizer.com/apbpatch ?
Or is this just so you can give an error message like "This patch isn't supported" ?

@beauxq
Copy link

beauxq commented Mar 3, 2024

While if someone gives you a KH2 APContainer, you can instead give an error message like "This isn't a patch"
because it doesn't have the procedure defined?

@black-sliver
Copy link
Owner Author

This change serves multiple purposes:

  • if someone wants to implement, say, custom+zillion in their alternative Patcher, they can
  • if it's custom, but the alternative Patcher did not implement that specific game, then you get a proper error by default "Custom patch for {game} not supported"
  • if a world switches between custom and APPP or custom and APDelta, it's trivial to detect that Patch and AP are incompatible
  • if an APPP or a custom APPatch includes a file called "delta.bsdiff4" or "*.zpf", it would be impossible to detect compatibility issues, by bumping the compatible_version we fix that.
  • it is now possible to differentiate between APPatch and APContainer (i.e. "This is not a patch" and "This patch isn't supported" messages)

@black-sliver
Copy link
Owner Author

I do not plan on implementing Zillion in APBPatch, by the way. If we ever get a proper wasm target for python one day, it would be possible by providing a hook from JS that "installs" AP code on demand though.

@black-sliver
Copy link
Owner Author

AP released the procedure patch system and I think the description here is correct, so merging for future reference.

@black-sliver black-sliver changed the title Add v6 spec suggestion Add v6 spec May 7, 2024
@black-sliver black-sliver merged commit 488437d into master May 7, 2024
@black-sliver black-sliver deleted the v6 branch May 7, 2024 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants