Context Properties


The work on decision mod parsing has started. I had to do a few redesigns to my original test mod on account of some of the constraints I found while working on event modding, but nothing too major. I began the implementation by working on context properties. These are attributes which can be added to a decision (and later, to other moddable elements) to define, well... properties that can be reused within the context of that same element. Just to give an example, here are three properties that I plan to use as part of the clan split decision.

      "properties": [
        {
          "id": "can_prevent_split",
          "type": "condition_set",
          "conditions": [
            "target.preferences.authority >= (-target.leader.charisma * 0.4)",
            "target.preferences.cohesion >= 0.2",
            "target.administrative_load <= (0.6 + (target.leader.wisdom * 0.3))"
          ]
        },
        {
          "id": "new_influence",
          "type": "random_range",
          "min": "lerp(target.influence, 0, (0.25 * (2 - target.leader.charisma)))",
          "max": "lerp(target.influence, 0, (0.1 * (2 - target.leader.charisma)))"
        },
        {
          "id": "new_authority_preference",
          "type": "random_range",
          "min": "lerp(target.preferences.authority, 0, (0.2 * (1.5 - target.leader.charisma)))",
          "max": "lerp(target.preferences.authority, 0, (0.1 * (1.5 - target.leader.charisma)))"
        }
      ]

The first property, can_prevent_split, is a set of conditions which can be used to test if a faction can prevent a split from happening within itself. Since this set of conditions is used multiple times within the mod definition, it's better if they were to be defined and evaluated just once per triggered decision. The other two properties, new_influence and new_authority_preference, are ranges that, when evaluated, return a random value inside the range defined by their respective min and max attributes. These type of properties are to be mostly used to define the output of decision choices. A decision choice doesn't necessarily need to return a random value, but they can be used  to add some noise and prevent a player from being assured the exact outcome of a decision. For now, condition sets and random ranges are going to be the only property types which will be implemented, but I hope to add more property types in the future.

Next weekend I will finish the implementation of these properties and continue the work on decision mods. As I mentioned before, things will progress a bit slower than usual since I still have to deal with other real-life priorities during this month, but I still hope to be done with decisions near the end of March.

Get Worlds - History Simulator

Leave a comment

Log in with itch.io to leave a comment.