feat(ini): Implement optional INI lookup folders for all common game systems#1476
Conversation
|
Every target is failing because of Tools and Generals. |
|
What is the strategy if two files define the same thing (i.e. Armor)? Will the last loaded file overwrite previous defined fields? And if this is the case, how can we then ensure that when adding content (mods, extension, etc) that the changes are being applied in the correct order? |
|
Also what is the desired need for this? |
If the files have the same name, then the higher file will be loaded only. If the files do not have the same name, then what happens depends on the implementation details - for how it treats collisions - of every individual system. It is reasonable to explore finer control over this behavior but this change does not go this far.
The purpose of this change is to be able to build Mods, Patches and Addons without the need to cramp all definitions into a single file for any particular system. I mentioned 2 use cases in the opening description. |
I see the use cases, but a mod as an example could potentially break (or have side effects) if for some reason the original file is loaded last (or first based on the implementation). |
|
Creators should certainly not put Mod over Mod if they are incompatible. If we want refined load orders on System levels then this will require rework of every single system which I am not willing to do for this change because of the complexity. It is something that would need to be built slowly over time. The current implementation will work just fine with Single Product and simple Addons on top of Original Games. It is also entirely optional. Creators can use legacy INI files as is and not use folders. Note that Object INI files already used folders in the original game (see Data\INI\Object) so this entire concept is not new, but now can be used for all systems, and not just for Objects. |
2d3bcf4 to
06598b3
Compare
|
Compile errors in Zero Hour tools fixed. |
06598b3 to
561cd6c
Compare
c4ce297 to
561cd6c
Compare
|
Replay Check is somehow failing here... |
OmniBlade
left a comment
There was a problem hiding this comment.
Looks like there are issues with the Core stuff depending on changes in just one of the games INI.h? Otherwise I'm much happier with the feature now and will approve for when the build is fixed.
|
The Generals compile error is expected because it was not replicated in Generals, but the Replay Check fail is unexpected and I do not know why it happens. |
|
The CRC mismatch is caused by the new calls to |
|
The NameKeyGenerator is decoupled from FileSystem with #1516 |
…hat take a string and max length (#1476)
561cd6c to
9efd3c7
Compare
|
Replicated to Generals with conflicts Tested and worked. |
…systems (TheSuperHackers#1476) For example the game will now not only load Data\INI\Armor.ini but also all *.ini files in Data\INI\Armor
This change implements optional INI lookup folders for all common game systems. This allows to split System INI files into new INI files in the sub folders. It also allows Mods and Addons to selectively overwrite settings.
Loading Rules
Example 1:
Data\INI\Armor.iniloadsData\INI\Armor.iniand all *.ini files inData\INI\ArmorExample 2:
Data\INI\ArmorloadsData\INI\Armor.iniand all *.ini files inData\INI\ArmorExample 3:
Data\INI\Default\ArmorloadsData\INI\Default\Armor.iniand all *.ini files inData\INI\Default\ArmorIn Generals a special rules applies: INI files will also be searched in a "Generals" directory (and its subdirectories) to hide them from Zero Hour.Example 4:Data\INI\Armor.iniloadsData\INI\Armor.iniand all *.ini files inData\INI\ArmorandData\INI\Generals\ArmorSimple use case
This for example allows the Control Bar Pro Addon to create a file
Data\INI\GameData\ControlBarProGameData.iniwith the following content:Which would then set the full viewport when this Addon is loaded.
Complex use case
Mods and Patches can selectively write over all original INI files without the need to copy all base files. This allows for simpler and smaller INI distributions.
TODO