Cities: Skylines 2 Modding Documentation
I used ChatGPT to analyze and write documentation for .dll used to mod the game. Right now the file Game.dll is now complete, Colossal and PDX are next in line.
- Game.dll [All files have been analyzed by GPT]
Beginner’s guide
This is an absolute beginner’s guide to start modding Cities: Skylines II.
By the end of this tutorial, you’ll be able to make the game launch a terminal so you can start debugging your mod.
Currently, this guide is meant for those who want to use the most default setup possible, without changing much configuration.
A minimal setup (without Visual Studio) will be covered in a future section of this guide.
Table of Contents
Getting Started
To get started, open the game and go to:
Options → Modding → Automatic Install
This will install:
-
Unity
-
.NET SDKs
-
Node.js
These will be installed on your default system drive.
💡 If you prefer installing them elsewhere, you can do it manually—it’s not hard.
Unity License Setup
After Unity installs, the game might not automatically set up the required license.
To fix this:
-
Install Unity Hub: https://unity.com/unity-hub
-
Log in with a free Unity account.
-
Once your account and license are active, Unity should be recognized by the game.
For any missing or outdated details, check the official wiki:
🔗 https://cs2.paradoxwikis.com/Modding_Toolchain
Installing Visual Studio
Download Visual Studio:
👉 https://visualstudio.microsoft.com/
When installing, select these workloads:
-
✅ .NET Desktop Development (mandatory)
-
✅ Game Development with Unity (needed for debugging)
⚠️ The Cities: Skylines II Mod Project Template only appears after installing
.NET Desktop Development
.
Non-Default Game Installation Path
If your game is not installed in the default directory, you’ll need to update the path in Visual Studio.
Steps:
-
In Visual Studio:
Solution Explorer → [Your Mod Name] → Properties → Mod.props
-
Open the
Mod.props
file and update the paths as needed:
<SteamDefaultManagedPath>
C:\Program Files (x86)\Steam\steamapps\common\Cities Skylines II\Cities2_Data\Managed
</SteamDefaultManagedPath>
<XboxDefaultManagedPath>
F:\xbox\Cities - Skylines II - PC Edition\Content\Cities2_Data\Managed
</XboxDefaultManagedPath>
Save your changes and build your mod.
The default template will include an example Options Menu in-game.
Mod Entry Files
Two files act as the main entry points for your mod:
-
Mod.cs
– main code entry point -
Settings.cs
– in-game options menu logic
If you build successfully, your mod will load next time you launch the game.
⚠️ You might get a harmless Visual Studio error saying it failed to build a “Class Library” — you can safely ignore it if the
.dll
was created.
Debugging Build Errors
If you encounter errors related to missing .NET SDKs or dependencies, navigate to:
Cities - Skylines II - PC Edition\Content\Cities2_Data\Content\Game\.ModdingToolchain\ModPostProcessor
Open a terminal there and run:
.\ModPostProcessor.exe
This tool can give extra details about missing dependencies or other build issues.
Writing Your First Lines of Code
As with most programming tutorials, let’s start by printing “Hello World!” in your mod.
In your Mod.cs
file, add a ConsoleWindow
to the class:
using Game.Debug;
using System;
namespace mod
{
public class Mod : IMod
{
private ConsoleWindow console;
public static ILog log = LogManager.GetLogger($"{nameof(mod2)}.{nameof(Mod)}").SetShowsErrorsInUI(false);
private Setting m_Setting;
public static ProxyAction m_ButtonAction;
public static ProxyAction m_AxisAction;
public static ProxyAction m_VectorAction;
...
Next, initialize the console in the OnLoad(UpdateSystem updateSystem)
method:
console = new ConsoleWindow("Cities: Skylines II Debug Console", attachConsole: true);
Console.WriteLine("Hello World!");
Exploring Game APIs
There’s currently no official documentation for all modding classes and methods.
Until then, you can inspect them through Visual Studio’s Object Browser:
Solution Explorer → Dependencies → Assemblies → [Double-click any assembly]
You’ll see the disassembled structures, fields, and methods of each class.
More info:
Attaching the Unity Debugger
Attaching the Unity Debugger allows you to set breakpoints, inspect variables, and pause the game runtime.
Follow this official guide:
🔗 https://cs2.paradoxwikis.com/Debugging
Note
In some installations, the boot.config
file isn’t in Content\
but rather in:
Cities - Skylines II - PC Edition\Content\Cities2_Data
Search for it if necessary.
If done correctly, the game will show a small “Development Build” label in the bottom-right corner of the main menu.
Then in Visual Studio:
Debug → Attach Unity Debugger
Select the Cities: Skylines II process. You can now add breakpoints and inspect your mod live.
Launching the game with Developer Mode
To start the game with Developer Mode, the following wiki page should be enough.
In my case (using XBox Game pass), instead of creating a shortcut of the game executable I had to make from the launcher, and that was not the same listed in the wiki page but instead gamelaunchhelper.exe
inside Cities- Skylines II - PC Edition\Content
folder.
Also, not yet managed to use -uiDeveloperMode
.
Setting Up a UI Mod
🚧 Coming soon.
Minimal or Bare Configuration and Requirements
🚧 Also coming soon.