I would like to consider the issue of creating modifications to larger mods.
For example, I would like to add some additional ammunition types to existing weapons in the XCF, as well as to add a player class, and adjust some armors. Conceptually, the problem is relatively simple: it requires that some data nodes be inserted into the existing configuration node tree, and in some cases collections in existing paths would need to be appended to. While these particular modifications do not require deletions, it would in general be desirable to have these capabilities available.
Now, it is entirely not clear how to implement these changes. The primary issue is as follows. Let's consider an approach of copying the entire .rul files from the parent mod and editing them. If the files in the parent mod change, then new instances in the child mods need to be generated. This at the very least requires dependency on specific parent version, as well as introducing additional maintenance and release hurdle. Even worse, the dependency on what set of modules is being loaded would be introduced. That is, if other mods make changes to the same files, then the changes should be made against versions in these mods. Not only this complicates the maintenance, but also makes modding much less flexible. In particular, it would be quite challenging to have two mods with each adding an individual weapon.
The question is, how to solve this problem.
First, I would like to understand what is the exact semantics associated with adding new ruleset definitions in child mods? Is this semantics dependent on the names of the files? Is it only dependent on the total contents of all YAML definitions in all of the files (and thus the file name are actually irrelevant)?
I would like to consider several approaches, and to get clarifications.
First, is patching the files from the parent mode directly. This requires ability to depend on exact version, and introduces issues with flexibility.
A partial solution to the previous issue would be to have a single mod contain several instances that would apply based on what parent mods versions are installed.
Another approach is to enable some form of patching of definition trees. There are some extensions to YAML that allow that. Approaches not based on these YAML extensions could be considered. Specifically, a set of commands along the lines of
DELETE /armors/type:STR_GRAVMODULE_ARMOR_UC/
DELETE /armors/type:STR_ALIEN_BRAIN_ARMOR/
INSERT /items/type:STR_SMALL_LAUNCHER/compatibleAmmo/ /mymod/items/type:STR_SMALL_LAUNCHER/compatibleAmmo/
could be issued in mods.
I noticed that currently, it seems that there are provisions for issuing a delete directives. I wonder, how could insertions be made in a sound fashion? I think, a sound approach may be to utilize an existing YAML feature of tags, and to have the definitions in mods be tagged accordingly. That is, if currenly a default action is to REPLACE, a special tag could indicate that the action should be to MERGE instead.
I wonder, if the latter approach is implemented already? If so, I would appreciate some documentation reference.
In terms of engine semantics, I would like to consider an approach based on interpretation of configuration within the existing parsing semantics.
So, currently, there's an ability to add list nodes like
- delete: STR_LASER_PISTOL
- delete: STR_LASER_RIFLE
- delete: STR_HEAVY_LASER
- delete: SILACOID_WEAPON
- delete: ZOMBIE_WEAPON
- delete: REAPER_WEAPON
- delete: CHRYSSALID_WEAPON
I would like to have the ability to define in addition to that something like
- type: STR_SMALL_LAUNCHER
compatibleAmmo:
- insert: STR_MEGA_BOMB
- insert: STR_GIGA_BOMB
in one mod and also
- type: STR_SMALL_LAUNCHER
compatibleAmmo:
- insert: STR_GIANT_BOMB
- insert: STR_ULTRA_BOMB
in another mod. A final result should be the following configuration:
{ { type : "STR_SMALL_LAUNCHER" ,
compatibleAmmo: [ "STR_STUN_BOMB" , "STR_ELERIUM_BOMB" , "STR_EMP_BOMB",
"STR_MEGA_BOMB", "STR_GIGA_BOMB", "STR_GIANT_BOMB", "STR_ULTRA_BOMB" ] },
# ...
}