Skip to content

Getting Started ​

Welcome to the ADOFAI Mod development tutorial. This series will guide you step by step through building a Mod for A Dance of Fire and Ice (ADOFAI).

The series has 26 chapters organized into five stages:

StageChaptersWhat you get
☕ Prerequisites0C# basics crash course (for complete beginners)
🚀 Getting Started1–5Environment, how UMM works, your first Mod, debugging
🧩 Harmony6–16The full patch series (incl. Transpiler, Reverse Patch)
🛠️ Practice17–19Settings UI, locating target methods
🚢 Advanced & Publishing20–25Multi-loader, Mod API, CI/CD, guidelines

Before you begin, you should have the following background:

  1. Never learned C#? Read C# Basics Crash Course first — go through chapter 0
  2. Some experience with Git and GitHub

Environment Setup ​

1. Prepare the game ​

  • Purchase and install A Dance of Fire and Ice on Steam
  • Make sure the game launches correctly

2. Install UnityModManager ​

  1. Download UnityModManager (0.27.0 or newer)
  2. Run UMM and select ADOFAI in the game list
  3. Click Install to inject UMM into the game

3. Install development tools ​

  • Visual Studio 2019+ or JetBrains Rider
  • .NET Framework 4.8.1 Developer Pack
  • Harmony 2.3.3

4. Get the official template ​

The organization provides two Mod templates; this series uses the first one:

TemplateDescription
ADOFAIModTemplateBase template, the star of this series
ADOFAIMod.MultiLoaderAdvanced multi-loader template, see the advanced chapter

Clone and install the base template:

bash
git clone https://github.com/adofaiex/ADOFAIModTemplate.git
cd ADOFAIModTemplate

# Install as a local template (from the repo directory)
dotnet new install path\to\ADOFAIModTemplate
# Or install from the NuGet package
dotnet new install path\to\StArray.ADOFAIModTemplate.1.0.0.nupkg

5. Verify the environment ​

Create a test project from the template:

bash
dotnet new ADOFAIModTemplate --name MyFirstMod

If the generated project contains src/Main.cs, src/Settings.cs, and src/Patches.cs, your environment is ready.

Debugging Your Mod ​

  • UMM uses runtime injection; debugging requires launching the game itself
  • Enable / disable Mods in the UMM overlay (default Ctrl+F10)
  • Check the game log to confirm the Mod loaded successfully

Development Principles ​

Thank you for contributing to the ADOFAI ecosystem. Please follow these principles when developing Mods:

  • Test your features
  • Include good comments
  • Store persistent data in the Mod's local config directory so updates don't overwrite it
  • Handle errors gracefully — never let a single failure crash the whole Mod
  • If you're extending an existing Mod, prefer submitting a PR to the original project

Chapters ​

The full chapter list is below; reading in order is recommended:

#ChapterContent
0C# Basics Crash CourseCatch-up for beginners (optional)
1Getting StartedEnvironment setup, chapter map
2What is a ModWhat Mods can do, red lines
3Understanding UMMHow UMM works, Mod directory, ModEntry
4Minimal ExampleInfo.json + Main.cs, your first Mod
5Build, Deploy & DebugCompiling, hot reload, reading logs
6Harmony IntroductionOverview of the four patch types
7Prefix PatchesIntercepting methods, modifying parameters
8Postfix PatchesModifying return values, __state
9Finalizer PatchesException handling
10Magic Parameters__instance / __result / __state
11HarmonyPatch In DepthTarget syntax, priorities
12Patch LifecyclePatchAll / priorities
13Transpiler IntroductionWhat IL is
14Transpiler in PracticeCodeMatcher
15Manual PatchingDynamic patching
16Reverse PatchCalling game methods in reverse
17Settings SystemDefining and persisting settings
18Drawing the Settings UIIMGUI interface
19Locating Target MethodsdnSpy / ILSpy
20Advanced: Multi-Loader TemplateUMM / Melon / BepInEx / Doorstop
21Advanced: Mod APIThe Sarcary public API
22Packaging & PublishingReleases and publishing
23GitHub Actions CICI/CD, private lib repositories
24Mod Development GuidelinesRed lines and quality requirements
25FAQ & TroubleshootingFAQ

An organization that researches and expands the functions of ADOFAI