Anniversary Edition/Framework: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(first stab at describing how XML patching works; unanswered questions are how the AEI handles conflicting patches and how exactly patched .onis get put back into the mix to be combined into .dats)
(→‎XML patching: think this is a final, accurate description of the patching process; some day we really need to make a flowchart for this whole process)
Line 10: Line 10:


==XML patching==
==XML patching==
To read about the purpose of XML patches, visit the page [[Making a mod package]]. Here, we'll simply describe the process by which they are installed. XML patching takes place <u>before</u> installation, because the .oni files need to be patched before they are combined back into .dats. Therefore, when about to begin installing the user's selected mods, the Installer looks for any patches (.oni-patch files) in those mods. For each file to be patched, the AEI then finds the highest-numbered package which has such a .oni file (in other words, patches have higher priority than any package does by number -- regardless of the number of the package containing said patch). If there is no copy of that .oni file in any selected mod, the AEI extracts the .oni from the vanilla .dat of the level named by the patch (like .onis, .oni-patch files are to be placed in the folder level''X''_Final, with ''X'' being the number of the level whose resources are added to or replaced). Once all the .oni files to be patched have been collected from mods and vanilla .dats, the patching instructions found in the .oni-patches are combined into one temporary file for performance reasons, and this file is passed to xmlTools. The .oni files having been patched, they are then combined along with the unpatched .onis from the selected mods into .dats, as described above.
To read about the purpose of XML patches, visit the page [[Making a mod package]]. Here, we'll simply describe the process by which they are installed. XML patching takes place at the beginning of each mod installation, because the .oni files need to be patched before they are combined back into .dats. Therefore, when about to begin installing the user's selected mods, the Installer looks for any patches (.oni-patch files) in those mods. The .oni-patches are named according to the file they modify, e.g. TRAMKONCOMbk_fw_kick.oni-patch, and placed in numbered folders such as level2_Final/, just like mods with .oni files.
 
For each file that is to be patched, the AEI looks for the highest-numbered package which has such a .oni file in the same level number; in other words, patches go on top of all .oni mods, thus they have higher precedence than any package does by number -- regardless of the number of the package containing said patch. If there is no copy of that .oni file in any selected mod, the AEI extracts the .oni from the vanilla .dat of the appropriate level (stored in AE/AEInstaller/vanilla/).
 
Once all the .oni files to be patched have been collected from either the other mods or vanilla .dats, the AEI makes a single temporary patch file which lists inside of it a series of commands to xmlTools to run each individual patch file on the .oni file named by that .oni-patch. This "master patch" is made for performance reasons and should not affect the modder who creates .oni-patches. Read the documentation for [[xmlTools]] to understand how the patch files are actually processed. The .oni files having been patched, their containing folder is then combined, along with the folders of unpatched .onis from the other selected mods, into .dats, as described in "Installation".


[[Category:Anniversary Edition]]
[[Category:Anniversary Edition]]

Revision as of 14:21, 7 April 2013

The Anniversary Edition Seven introduced a revised framework which installs from scratch, separate from any previous Editions. Following is a rundown of what the Installer is doing, from start to finish. To learn how to make your own mod package, which is required in order for the AE Installer to handle your mod properly, see Making a mod package. To understand the material below, you should first be familiar with Oni's .dat files on a general level, so OBD is recommended reading.

Initialization

When first running the Installer, this is a one-time process that uses OniSplit to break the .dat/.raw(/.sep) files in Oni's GDF and breaks them into their constituent resources, yielding thousands of .oni files. These files are stored in temporary folders, one for each level. Next, the Installer performs what is called globalization: in order to allow modders access to (nearly) all data in all levels, it moves the .onis from each game level's folder to level 0, discarding duplicates (for instance, instead of making all characters available globally, BWest would put the ONCCs in each level for the characters they needed, to save memory; this means that the same character data can occur many times throughout the game data). The exception to this globalization is each level's AKEV and all child resources, its title, fail and win screens, and its LSI. Finally, the Installer recombines those folders of .oni files into the .dat/.raw(/.sep) files for each level, in AE/AEInstaller/vanilla/. Note that no data has been modded yet, just reformatted.

Installation

After this, the user can choose some mods to install. When the Install button is clicked, the Installer starts off by deleting the existing .dat/.raw(/.sep) files in AE/GDF to start from a blank slate. It then iterates through each mod package you selected, and sends a command to OniSplit to combine the .dat for that level (in AEInstaller/vanilla/) with the .oni files from whichever packages have files meant for that level. The final .dat/.raw(/.sep) files are then created in AE/GDF.

When one package overlaps with another in some way, such as two packages that provide new textures for the same character, which one will take precedence? The answer is that the Installer goes in ascending order by package number. If five copies of the same .oni file are encountered one after another, only the last-encountered one will be used. Thus, a package numbered 11111 will override package 11110 wherever their files conflict, when they are both installed. Note that this is on a file-by-file basis, so package 11111 could be used intentionally to override only certain files in 11110, say, to improve or fix them. On the other hand, this might be an undesirable interaction. It's left as an exercise to the modders to be aware when there's an unwanted interaction and to mark their mod as being incompatible with the other one.

XML patching

To read about the purpose of XML patches, visit the page Making a mod package. Here, we'll simply describe the process by which they are installed. XML patching takes place at the beginning of each mod installation, because the .oni files need to be patched before they are combined back into .dats. Therefore, when about to begin installing the user's selected mods, the Installer looks for any patches (.oni-patch files) in those mods. The .oni-patches are named according to the file they modify, e.g. TRAMKONCOMbk_fw_kick.oni-patch, and placed in numbered folders such as level2_Final/, just like mods with .oni files.

For each file that is to be patched, the AEI looks for the highest-numbered package which has such a .oni file in the same level number; in other words, patches go on top of all .oni mods, thus they have higher precedence than any package does by number -- regardless of the number of the package containing said patch. If there is no copy of that .oni file in any selected mod, the AEI extracts the .oni from the vanilla .dat of the appropriate level (stored in AE/AEInstaller/vanilla/).

Once all the .oni files to be patched have been collected from either the other mods or vanilla .dats, the AEI makes a single temporary patch file which lists inside of it a series of commands to xmlTools to run each individual patch file on the .oni file named by that .oni-patch. This "master patch" is made for performance reasons and should not affect the modder who creates .oni-patches. Read the documentation for xmlTools to understand how the patch files are actually processed. The .oni files having been patched, their containing folder is then combined, along with the folders of unpatched .onis from the other selected mods, into .dats, as described in "Installation".