# InfraSpace Modding Tutorial: Changing existing parameters

**URL:** <https://forum.dionicsoftware.com/t/infraspace-modding-tutorial-changing-existing-parameters/3138>\
**Category:** IS Mods\
**Created:** [July 11, 2022, 1:32pm UTC](https://forum.dionicsoftware.com/t/infraspace-modding-tutorial-changing-existing-parameters/3138 "2022-07-11T13:32:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Null3rror](https://forum.dionicsoftware.com/user_avatar/forum.dionicsoftware.com/null3rror/32/2143_2.png) [@Null3rror](https://forum.dionicsoftware.com/u/Null3rror)\
**Post date:** [July 11, 2022, 1:32pm UTC](https://forum.dionicsoftware.com/t/infraspace-modding-tutorial-changing-existing-parameters/3138/1 "2022-07-11T13:32:08Z")

</div>

This short tutorial goes into depth on how to easily change the configurations in the games .json files, as done in the [“Making your first example mod” Tutorial](https://forum.dionicsoftware.com/t/infraspace-modding-tutorial-basic-overview-making-your-first-example-mod/3135/2). Go through that tutorial first.

At the time of writing, the following internal configuration files can be changed by using patches:

- `buildings.json` contains definitions for all kinds of nodes in the game including buildings and intersections
- `constructionCategories.json` contains definitions for the bottom menu from where you can select the different buildings to build
- `resources.json` contains definitions for all the resources that can be gathered or created in the game
- `roads.json` contains definitions for all the types of roads that can be placed
- `spaceshipModules.json` contains definitions for the spaceship repair modules and their requirements
- `techs.json` contains definition for the technology tree and the research requirements
- `localization.json` contains all the text translations in the game
- `gameConfig.json` all kinds of parameters that control gameplay, balancing, and more

For creating patches, it’s important to know the structure of these .json files. That’s why you can export them straight from the game. On the Mods screen you can see an “Export Config Files” that will create a folder on your desktop and put all relevant configuration files in there.

 ![image](https://forum.dionicsoftware.com/uploads/default/original/2X/8/893f501ebca3aeb27d24d320e7c0621eea1286c1.jpeg)

Also the ISModKit contains some example patches in the SaltMine example mod pasted here for your convenienve:

```auto
{
	 "replaceOperations": {
		  "buildings/basicFarm/productionLogic/productionDefinition/consumables": [
            {"resourceName": "salt", "amount": 1 }
          ],
          "constructionCategories/categories/9/children": [
            {"itemName": "recyclingCenter"},
            {"itemName": "soilEnrichmentFacility"},
            {"itemName": "targetingStation"},
            {"itemName": "infiniteProducer"},
            {"itemName": "infiniteConsumer"},
          ]
	},
	"removeOperations": [
          "buildings/largeSandMine",
          "constructionCategories/categories/4/children/1/children/2",
          "constructionCategories/categories/4/children/1/children/1"
	]
}

```

Find the up-to-date file [here](https://github.com/Ponzel/ISModKit/blob/master/ExampleMods/SaltMine/patchbuildings.json).

The patch file modifies the json files of the base game or the json files of any mods before giving them to the game to process. It was designed to be as self-explantory as possible:

- `replaceOperations` replaces values with whatever you put on the right side of the statement
- `removeOperations` remove complete elements. Often, this means that the game’s default values are used instead, for example if you delete `buildings/sandMine/productionLogic/productionDefinition/powerNeeded`, the game will just use a default value.
- However, if you delete complete objects, like `buildings/sandMine` or `resources/sulfur`, they will not be accessible in the game. This _can_ lead to bugs though.
- The first word of any path is always the file that’s being modified. The rest of the path navigates through the json structure.
- You don’t need to replace single values, feel free to replace full objects.
- You can access elements of a JSON array by indexing (0-based numbering). For example in the above code snippet we have `"constructionCategories/categories/9/children"` which means that we want to replace the children of the 9th category. If you look at constructionCategories.json you will see that the 9th element of categories JSON array is the miscellaneous category.
- While doing `removeOperations` with JSON arrays, make sure to remove array elements in reverse order. For example if you look at the example code snippet above, you can see that first the 2nd element is removed and then the 1st element is removed.
