RayCarrot / RayCarrot.RCP.Metro

Rayman Control Panel (4.0.0 and above)
https://raym.app/rcp
MIT License
106 stars 5 forks source link

Patcher changes proposal #21

Closed RayCarrot closed 6 months ago

RayCarrot commented 1 year ago

In an upcoming update I'm preparing to do some major changes to how the Patcher works in RCP, detailed below.

Patches are now .zip files

Currently game patches (.gp files) use a proprietary file format made specifically for these patches. Although this did allow the files to be more optimized, it also comes with the drawbacks of them not being usable by any other programs. Users can't easily inspect their contents, anti-malware can't easily scan it and making minor changes to patches, such as fixing a typo, becomes a hassle.

The proposal here is to change .gp files to .gpz files. These will internally be .zip files and can thus be opened in File Explorer by changing the extensions, or in a program such as 7-Zip through its context menu. Patches will require the manifest.jsonc file in the root directory to describe its contents.

The contents of a .gpz file The contents of a .gpz file

Removing the Patch Creator

With patches now being standardized .zip files it removes the need for a custom patch creator tool. The current creator tool is also a bit cumbersome to use and doesn't offer a good overview of the changes you've done. It's also prone to confusion with how archives are handled.

The proposal here is to remove the Patch Creator in RCP. Patches will instead by manually created by users. This will require documentation on how they work, which could be added to the GitHub wiki. The option to create a patch will still be present in RCP, but will instead open up a window with info on how to create a patch and options such as these:

Example of a patch manifest Example of a patch manifest

Migration

One of the difficulties in changing the format is how to migrate to it. The proposal for patch files is this:

The patch library will also need to be migrated. This will most likely happen automatically as the user updates RCP, or with a button in the Patcher game panel.

The current structure of the patch library The current structure of the patch library

Full GameBanana integration

Currently RCP offers some patches to be downloaded directly through the app. These are either made by me or other members of the community, but with the requirement that they should only be for fixing or improving the game. More subjective changes, such as custom skins, are thus not allowed.

The proposal is to change this so that RCP fetches a list of patches uploaded to GameBanana for the game and allows those to be downloaded. This allows any member in the community to create their own patches and have them show up in RCP, something which will hopefully incentivize more patches to be made. It also allows more fun patches, such as custom skins, to be available. The plan is this:

Delta patches

One of the main limitations with the patcher right now is that entire files have to be replaced. This makes patches that modify larger files, such as executables, less than ideal. For example, multiple executable patches can not be combined in the current stage as one would override the other. This makes it harder to combine common executable patches such as widescreen patches, no-cd patches etc.

The proposal is to support delta patches. These modify a part of a file rather than replacing the entire file. These will most likely be created through a tool in RCP where the user can upload the original and modified versions of a file, resulting in a delta file being output.

Versioning

Another limitation of the patcher is game versioning. Some examples of patches which are difficult to make:

The proposal is to allow a patch to be able to target multiple versions. I'm not yet sure how I want to structure it, but the idea is to have a list of "versions" in the json manifest. When you add the files they then get added in a folder such as files/{id}/... where the id is the version id. The version is then either automatically determined by a set of requirements (such as checking if a file exists, the file size or something similar) or perhaps it'd be easier to simply have a drop-down in the patcher window for the user to select the version themselves (would make more sense for things such as widescreen patches where the user then selects their aspect ratio).