HgPatch is an all-in-one patch format for games made in GameMaker. It currently has experimental support for importing and replacing code, sprites, masks, audio, fonts, backgrounds, textures, rooms, sounds, and objects. However, it is rather temperamental in its current state, so it's very important that you understand how to use it and make preparations in case it malfunctions.
To use HgPatcher, all you need to do is to execute the script files as scripts in UndertaleModTool. Two scripts are provided: HgExport.csx, for creating patches, and HgPatcher.csx, for applying patches. To use the former, make a backup of your vanilla game and mod, execute the script, select your vanilla data.win, modded data.win, and output directory, and set configuration parameters. To apply a patch, back up your vanilla game data, open the data.win for the data.win file you wish to patch, run the HgPatcher.csx script, and select the patch directory you wish to apply. After the script finishes, you still have to save the patched copy to disc with UndertaleModTool before changes will appear in-game.
+Ease of application
+User Friendly
+Streamlines the patch creation process
+No code needs to be written to patch your content into a game
+Distribute patches with lower risk of copyright infringement
+Less dependent on game version - effects are the same even if the data.win changes!
-May not make efficient use of computing resources
-Patching process cannot be reversed easily
-Does not support special sprite types (I.E. Splines and SWFs)
-Edge cases may result in errors
-Applying multiple mods is likely to cause errors
It is recommended that you copy your mod folder and make a patch from the copy, rather than the original, as there may be defects in patch creation that could alter data in your work.
The patch is a simple folder in windows, containing several subfolders for different types of content and a patch.cfg
file. If you aren't using one of your content folders (e.g. your mod has no sprites), DO NOT delete your unused files.
This may cause issues.
This is your patch configuration file, which determines what methods are used when importing your assets.
This must be at the root of the patch folder.
Optional files in some asset folders used to alter parameters for assets.
Exists primarily for sprites, paths, fonts, sounds, backgrounds, and more.
Currently audio patch creation for games with audio groups in separate files requires that the data.win be in the same folder as the audiogroup.dat files, both for patch creation and patch application. This means that for patch creation, it is best to have your mod and the original, vanilla game exist in separate directories, with all other files duplicated, so that the patch creator can correctly compare audio. This is also advised because future patcher versions are planned to find differences in other files automatically.
Currently, there is no supported way to add new audio groups.
File names are very important, and are how the script knows where to put all the stuff you import without a separate
file telling it. This can be very powerful, but it's also important to know how you need to format your file names.
File naming rules will follow some basic conventions, and will be similar if not identical to those generated by
exporting files in UndertaleModTool (which HgPatch is based upon).
Sprite filenames follow the format _.png
For example, spr_kris_d_0.png would be a valid sprite. Note that the frame number begins at 0, and not at 1.
Masks should follow the same format as sprites
Other file names are simply the name of the asset, plus the extension.
Currently, HgPatcher does not track asset or content deletions in many cases. Thus, the patch creator and patch applier have no way to remove assets from a game, only ways to add and alter them. This is planned as a future feature.
Right now you may experience issues with code accuracy. Currently, code is decompiled and exported as GML. However, decompiling this GML during patch creation and recompiling it later at patch application may produce inaccuracies. It is planned to include an assembly fallback option if if it is detected that the GML decompilation/recompilation will result in something other than the original code entry.
Asset order is not tracked currently, so changing asset order (as well as the aforementioned case of asset removals) may cause errors due to GameMaker's indexed assets.
There is not yet a way to change files with the patch other than the data.win and any associated audio group files.
Rooms and GameObjects are copied in their entirety, regardless of how much data has actually changed.