Skip to content

FindFile

Nightinggale edited this page Sep 14, 2018 · 6 revisions

REMOVED IN B19

FindFile was designed to compensate for a performance killing design flaw in vanilla B18 and A17. Vanilla B19 had a rewrite to get rid of the design flaw. This not only renders FindFile impossible to implement, it also removes the slow performance, which FindFile should compensate for. In fact FindFile only compensated for the patching slowdown while B19's redesign improves both patching and the overhead unreachable by FindFile, meaning B19 is even faster than B18 with perfectly set up FindFile.

In short: FindFile is dead and the vanilla replacement is better.


What it does

FindFile is an operation, which can be used to tell which file to patch.


Why you want to use this

The main reason for using this is game startup time. By far the slowest part of patching is doing XPATH searches, meaning simply put, you can estimate the time spend patching to be the number of XPATH searches. The vanilla approach works, but since it doesn't know which file to patch, it will use one XPATH search on each file to figure out where it is supposed to patch. FindFile can skip "wrong" files without using an XPATH search and with hundreds of files in vanilla alone, FindFile allows your patch file to be hundreds if not thousands of times faster.


Tags

Tag Mandatory Type Description
patchName no string Name of patch for log/profiling
modName no string Name of the mod you want to patch
file no string Name of the file you want to patch, without path

Pass condition

file needs to match the name of the current file and modName needs to match the name of the owner of that file. If test or modName is not included, that part is skipped, allowing patching all files of a certain name or all files in a certain mod. This can be useful in more complex patch file setup. Skipping both is allowed, but pointless as it pass all files.


Example

<li Class="ModCheck.FindFile">
    <patchName>Modifying room stats</patchName>
    <modName>Core</modName>
    <file>RoomStats.xml</file>
</li>
Clone this wiki locally