Add support for ini file diff-mods. #3890
Comments
NoQ changed type from |
Per commented Do you have some example data? |
NoQ commented :oops: sorry didn't notice this message when i was on IRC. |
NoQ uploaded file Set viper body weight to 10000 |
NoQ uploaded file Sets cobra price to 10000 and machinegun model to rocket superfortress weapon model. Can be used together with test.wz without conflicting on body.ini |
NoQ uploaded file Modify several things in a single file: set mg to HOMING-indirect and long-range, set tmg to penetrating. Still doesn't conflict with test.wz and test2.wz. |
NoQ uploaded file |
vexed commented I am not sure about doing these mini mods / re:inis, on one hand, it does make mods much smaller, but on the other hand, just how the heck do we handle these things once we get multiple versions ? This same thorn is with the mod support we have now though. I would wait a bit longer to see how we finally decide on how to do mod support. |
Cyp commented Even if only allowing one mod, a delta probably has much more chance of being compatible with new versions of the game than just replacing whole files. (Haven't looked at the delta format to confirm this.) |
NoQ commented Here are complete contents of the mods uploaded above. test.wz: /diffs/test/stats/body.ini
test2.wz: /diffs/test2/stats/body.ini
/diffs/test2/stats/weapons.ini
test3.wz: /diffs/test3/stats/weapons.ini
As you see, any changes in the game data will not be reverted back when loading such mod; it is simply not mentioned inside it, resolving quite a lot of problems. Also, each such diff-mod stays inside its own PhysFS folder, never overwriting files of other diff-mods, so we can mod the same file twice without running into conflicts. Also, it's trivial to add a check and throw an error when two diff-mods overwrite the same paremeter in the same file; something like that is not possible with our traditional mods. |
NoQ commented One of the possible bad conditions may be when a weapon is removed from the game. If we load a diff-mod that modifies a weapon that no longer exists, then this weapon will appear again, with some completely weird default stats. Probably some work can be made to make sure that items with poorly initialized stats don't work, if at all they don't crash. |
Per changed status from |
Per changed resolution from `` to |
resolution_fixed
type_patch (an actual patch, not a request for one)
| by NoQA patch that allows making mods that don't substitute whole ini files with their versions of them, but only substitute certain parameters in certain sections, relying on the base game to fill in the rest.
It does so by merging an extra QMap<QString, QVariant> object into WzConfig containing all overridden properties with their values.
Part 1 (trivial):
https://github.com/haoNoQ/warzone2100/commit/61fc55c24866c5ef6e0a754d0f76fe546b33c054
Part 2:
https://github.com/haoNoQ/warzone2100/commit/9d8e2ccdbbde224897600a1958aa398778d1ed89
I didn't yet think about what happens if two ini diff mods both modify the same parameter in the same file, but it seems easy to add such collision detection.
Issue migrated from trac:3890 at 2022-04-16 10:49:15 -0700
The text was updated successfully, but these errors were encountered: