Start Here
Concord lets a mod change what a game does while the game is running. You don't edit the game files. You write a small C# patch, and Concord makes sure it runs at the right moment.
Say the game has a method like this:
public class ShopItem
{
public int GetPrice()
{
return 10;
}
}
A Concord patch can run before GetPrice(), run after it, change the return value, skip the original method entirely, or read and write private fields on the game object.
The goal is pretty simple: patching should feel like writing ordinary C# next to the game code you want to change. You shouldn't need to know anything about IL, dynamic methods, detours, or MonoMod.
Note
Concord is still being built. These docs describe the authoring API as designed. The lower-level emit and detour pieces exist today, but the easy Patcher API and source generator are still in progress. See Implementation Status for the full picture.
Who this is for
Mod authors who are new to Concord. C# developers who haven't written runtime patches before. Contributors who want to understand the internals after picking up the user-facing model.
This isn't a C# tutorial. It assumes you can read methods, classes, attributes, generics, and inheritance without trouble. The focus is on Concord's patching concepts.
The vocabulary
Patch: A C# method body that Concord inserts into a game method.
Target: The game method you want to patch.
Original: The game method before your patch changes it.
Injection: The patch method Concord inserts into the target.
Callback: The optional CallbackInfo parameter that lets a patch cancel the original method or change its return value.
Shadow: A field declaration in a patch template that stands in for a private field on the target type.
The short version
Most patches look something like this:
abstract class PricePatch : ShopItem
{
[Inject(nameof(GetPrice), At.Return)]
void AfterGetPrice(CallbackInfo<int> ci)
{
ci.ReturnValue += 5;
}
}
PricePatch is a patch for ShopItem. GetPrice is the game method being patched. At.Return means run after the game method has a return value. CallbackInfo<int> means the method returns an int and you might change that value. ci.ReturnValue += 5 adds 5 to whatever the game came up with.
Calls then behave as if the method had been written like this:
public int GetPrice()
{
int result = 10;
result += 5;
return result;
}
But Concord doesn't rewrite the source. It creates this behavior at runtime.
Next: Getting Started, then Your First Patch.