File Loading Order
As you may have spotted within the previous section, the Kit supports four different types of "structural" file. The information that can be placed in these files is identical, so this begs the question of why there are four types. The reason is that HL loads files in a specific sequence and all the material in one set of files must build on the previous set.
You can think of it as layers, where each new layer relies upon the layers beneath to be correct. During loading, each new layer of data files requires that certain information it references already be in place and verified. For example, tag groups that are used must be defined prior their use, else an error is reported.
In order to keep your data files more manageable, you'll likely want to keep them small and focused. Having a few huge files is perfectly acceptable, but we recommend against that approach and have structured the example data files accordingly. However, maintaining a variety of smaller structural files means that you'll be carving the information up across different files, and that can result in references across files that aren't defined.
Using tag groups as an example again, you might define a tag group in one file and then reference it in another. The problem is that you need to make sure that the file in which the tag is defined is always loaded before the file in which it is referenced. The only way to do this reliably is for HL to support different structural file extensions and load those files in a specific sequence. This way, you can put the tag groups in one file that you know will be loaded first and the references in other files that you know will be loaded afterward.
You can have lots of different structural pieces in a complex set of data files. And there are a variety of requirements regarding what information must be defined before it is used. Consequently, in order to handle complex situations, there are a four different structural files. Putting all together with the other data file types, there are a total of six layers of files and they are loaded in the sequence specified below.
- Definition file (definition.def)
- Structure files with the ".1st" file extension
- Structure files with the ".core" file extension
- Structure files with the ".str" file extension
- Structure files with the ".aug" file extension
- Data files with the ".dat" file extension