# What is Patch Manager

The game stores most of its content as data. A part, a planet, a resource, a tech node, a mission are each described by a JSON asset that the game loads at startup. Patch Manager sits in the middle of that loading step. Before an asset reaches the game, Patch Manager hands it to every patch that wants it, lets each patch change it, and then passes the result on.

So a patch is not a mod in the usual sense. You are not writing game logic or hooking functions. You are saying "when the asset named `eva_kerbal` loads, set its crash tolerance to 30." The game then behaves as if that was always the value.

## Why this is nice

* **You change data, not code.** No compiling, no C#, no waiting on a build. You edit a text file and relaunch.
* **You only describe the difference.** You do not ship a whole copy of a part. You ship the one field you want changed, so your patch keeps working when the base part changes around it.
* **Many patches stack.** Your patch, the base game's patches, and other mods' patches all run against the same asset in a defined order. Two mods can both touch the same part without either shipping a forked copy.

## What you can do

* **Edit existing content.** Change a number, swap a texture path, add an item to a list, remove one. Most patches are this.
* **Add new content.** Queue a brand new asset: a new resource, a new moon, a new mission step. See [Creating assets](/doc/creating-assets-9bPpsuBU3M).
* **Add or remove the building blocks inside an asset.** Give a part a module it did not have, add a fuel container, or add a variant.
* **Whatever you dream of** For example: randomize the inclination of the planets, the placement of parts in the tech tree, make all engines consume "magic smoke" as a fuel type.

## What a patch looks like

Here is a complete patch. It targets one planet and sets one field:

```lua
PM.Planets:Patch("MunDustColor")
          :Named("Mun")
          :Do(function(body)
              body.MineDustColor = { x = 1.0, y = 0.99, z = 0.87, w = 1.0 }
          end)
```

Read it as a sentence: on `PM.Planets`, register a patch called `MunDustColor`, run it only against the body named `Mun`, and when it runs, set the dust color. The `:Named` call decides which assets the patch touches, and the `:Do` at the end is the change itself.

The next page explains how the game organizes the content you are patching (assets, addresses, and labels). After that you set up your editor and write a patch like this from scratch.