Hi all, some of you may know me, some of you may not but I am the creator of a little mod called Blue Prince Archipelago. If you haven't it's a very expansive mod related to a multi-game Randomizer, Archipelago, for Blue Prince that I have been working on for just under a year. So I feel quite qualified to write this guide.
Forewarning this guide expects a basic understanding of Unity and C#. If you don't understand either there are plenty of resources around to learn with.
Part 1: Choosing a Modloader
There are 2 primary modloaders that work for unity games BepInEx and MelonLoader, both have pros and cons.
MelonLoader:
- Unity Explorer works a little more cleanly in MelonLoader.
- Easier install for users.
- Is used by most of the community.
- Stores more logs by default than BepInEx
BepInEx:
- Works with the GamePass version of the game (I could not get it to work with ML).
- Has more detailed and easy to find documentation than MelonLoader.
- Has more logging options than MelonLoader.
- Works on Mac/Linux platforms via wine/proton (ML probably does too, I just haven't tested it in detail.)
If you are just making a basic mod and are aiming to be compatible with most of the other mods in the community, then MelonLoader should be your modloader of choice.
If you do want to support GamePass you will need to use BepInEx for now. Don't worry though it is possible to switch to MelonLoader later on. Both Modloaders handle a lot of things in a similar way.
You can also support both like I do with my mod, but since that requires a more advanced project setup I would recommend reaching out to me directly for directions and an explanation on how to do so.
So having chosen a Modloader what's next?
Part 2: Setting up a Dev environment.
First you will need a few tools. You will either need an IDE for C# or access to dotnet command line tools and some form of text editor.
Personally I use Visual Studio 2026 Community but you can make other IDEs like Visual Studio Code work if they have an extension for C#.
Next you will need to install ModLoader or BepInEx on your copy of the game.
For Melonloader install the latest version from here: https://github.com/LavaGang/MelonLoader/releases/latest
Then open up the exe, find your Prince Installation or Select Blue Prince from the list that pops up and it will automatically install.
For BepInEx you will need to download a Bleeding Edge Build because the game uses a build setting called IL2CPP which I will get into later. You can find those here:
https://builds.bepinex.dev/projects/bepinex_be
You will specifically need a IL2CPP x64 build. The file should be called something like this: BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.755+3fab71a.zip
Next extract the contents of the zip then put it in the root Blue Prince Installation folder. If you did it right there should be a "winhttp.dll" in the root of your folder among other files.
After you have installed either launch the game from Steam/Gamepass. Do not run the .exe directly.
It will take a while on the first run but this importantly creates files that you will need to reference in later steps.
Next up you will want to download a mod for Blue Prince called unity explorer. You can use either of these:
You specifically need to download the IL2CPP CoreCLR version for your specific ModLoader.
This mod is essential in exploring the game's structure and is great for assisting in reverse engineering how things work in the game.
I also highly recommend installing or building yourself a copy of FSMExpress.
It's a tool for exploring FSMs created by a library called PlayMaker. This same FSM library is used in Hollow Knight and SilkSong and while this tool was intended for those games, it works great in Blue Prince.
Next up actually setting up your mod. For BepInEx I highly advise following their instructions here: https://docs.bepinex.dev/articles/dev_guide/plugin_tutorial/index.html
For MelonLoader I again would follow their instructions for this part: https://melonwiki.xyz/#/modders/quickstart
Once you have made your basic plugin you are good to start building your mod however there are a few things you have to handle differently due to being in an IL2CPP environment.
Part 3: Dealing with IL2CPP
So what is IL2CPP and why is it a big deal? IL2CPP stands for Intermediate Language to C++. Essentially major parts of the game's code are translated to machine code then into C++. This can come with performance benefits, but it also is very effective at obfuscating the code of the game. In the process of this IL2CPP translation they also strip some functionality in Unity that the game doesn't use.
So in an IL2CPP game Modloaders also help you connect to the code and also help allow you to interact with game functions as if it were a normal unity game with some notable exceptions.
Any time you want to create a Unity MonoBehaviour you need to make sure it's registered with IL2CPP. In both MelonLoader and BepInEx you can do so as follows:
ClassInjector.RegisterTypeInIl2Cpp<CustomMonoBehaviourNameHere>();
Additionally you can't use interfaces as normal. To use an interface you have to pass it to this registration like so:
ClassInjector.RegisterTypeInIl2Cpp<CustomMonoBehaviourNameHere>(
new RegisterTypeOptions()
{
Interfaces = new Il2CppInterfaceCollection([typeof(IInteface1), typeof(IInterface2)])
}
);
I recommend registering your classes in the Plugin's Load() Event. If you want you can also add a game object to hold your custom MonoBehaviour as follows:
ModObject = new GameObject("ModObjectNameHere");
GameObject.DontDestroyOnLoad(ModObject);
ModObject.hideFlags = HideFlags.HideAndDontSave
ModObject.AddComponent<CustomMonoBehaviourNameHere>();
Sometimes methods will require IL2CPP versions of objects as their parameters in those cases you simply need to use Il2CppType.Of<Type>() where Type is the type you need the IL2CPP version of.
For coroutines BepInEx can call coroutines almost exactly like base unity from a MonoBehaviour except you need to provide and IL2CPP version of an IEnumerator. Simply call IEnumerator.WrapToIl2Cpp() to convert it.
In MelonLoader you just call MelonCoroutines.Start(YourCoroutineHere) instead.
Loading custom assets for your mod from a Unity Bundle is harder than expected in Blue Prince since the usual method to do so is stripped by IL2CPP.
So I ended up utilizing other non-stripped methods to achieve a similar effect:
You can see my solution here: https://github.com/Yascob99/BluePrinceArchipelago/blob/09922b44bf2d3334097c721db350e9cff8625572/src/Utils/Utils.cs#L94
Now I did mention that the Game obfuscated so how do you look at the source code? Well thanks to an error on the game dev's part they accidentally shipped the non-obfuscated code of the game with 1 particular Mac Patch. You can find that version here: https://steamdb.info/depot/1569582/manifests/
Specifically you want the manifest from 16 September 2026 – 08:00:41 UTC Select Steam Console as your copy format then click the copy button on the right side of the correct manifest. It will prompt you to open up the steam console.
When it pops up paste your clipboard in the bottom textbox. It will take a while but when it's done it will let you know where you can find your files.
In there you will find a BLUE PRINCE_BackUpThisFolder_ButDontShipItWithYourGame folder and inside that you will find a Managed folder. Those dlls are what you are after. You can view their decompiled code in a program like ILSpy or DnSpy. This is great for deconstructing how the game works.
Part 4: Finding a Starting Point
Depending on what about the game you want to mod you may need a variety of different things. The best way to find what you need is to explore the game with Unity Explorer. Search things up with the search, explore and see how things change as you interact with objects while playing the game.
Once you have figure out something you think is important you need to now figure out if it is in fact important. There are a few ways you can do this.
The usual way of doing so is finding a method to hook via a Harmony Patch. Harmony has great documentation you can find here: https://harmony.pardeike.net/v2/articles/intro.html
But if you want to see Harmony in action you can take a look at some of my harmony methods here: https://github.com/Yascob99/BluePrinceArchipelago/blob/main/src/Patches/HarmonyPatches.cs
Make sure you actually apply the Harmony Patch like I do here with my class of ItemPatches:
Plugin.Harmony.PatchAll(typeof(ItemPatches));
Harmony patches are really versatile and allow you to run code just before, or just after a method runs. You can also prevent the original code from running and can do so conditionally. It offers even more features that I won't get into here but just know it's a very powerful and versatile tool.
Next up we have FSMs. If a GameObject has an PlayMakerFSM component it has scripting that is handled through an FSM. To mess with it it's important you understand how FSMs work in Blue Prince.
You can view the FSM in a visual way with FSM express which can help you understand what that script is doing. It will take some time to learn the syntax, but it's basically drag and drop code.
Part 5: PlayMakerFSMs
In each FSM there are a few important parts.
States: FsmStates are the states in a finite state machine. You can think of them as similar to something like the states of something like a light switch. A light switch has 2 states On and Off. How this library differs each state has actions associated with it and some states are merely used to logically separate the code. The only states that the FSM will stop in are the ones that wait for events. States are connected by Transitions.
Actions: FsmStateActions are basically little blocks of code that perform an action. There are a ton of premade actions. Some of them can trigger transitions if certain conditions are met.
Transitions: Transitions come in two types: Local and Global. Global transitions can be called from outside of the FSM and act as the form of communication between FSMs. They can also be invoked via code. Each FSM has a list of global transitions which they contain as well as the associated FSMEvent in that Transition. Local transitions are just the connections between states inside the FSM. There is one special local transition: "FINISHED". this transition happens whenever all actions in an FSM have run. All local transitions are stored in their starting state and each of those transitions have a variable which stores the state the transition leads to.
Events: FSMEvents store the information for how an event should be invoked, it includes information on the target of the event (Self, GameObject, FSM, BroadcastAll, etc...) and any other information that event needs to function. Typically you will see them invoked by the "SendEvent" FsmStateAction in an FSM.
As for how to reverse engineer states, I use a combination of UnityExplorer and Visual Studio to figure out what variables are important in an actions.
To construct an action I first find a similar one in FSMexpress and note any particular variables of interest. I then find that same Action in Unity explorer to see the actual data that's stored in game. Then I finally use visual studio to deduce the variables I have access to.
Take this BoolTest action for example here is the me creating a new one
StateName.AddLastAction(
new BoolTest() {
boolVariable = isDraftForced,
isFalse = FsmEvent.GetFsmEvent("Continue Draft"),
isTrue = FsmEvent.GetFsmEvent("Force Draft"),
everyFrame = false
}
);
I would advise finding the Action in IlSpy/DnSpy to find the exact name of it's related variables.
Additionally I have created a library for making FSMs easier to interact with based on a similar one that exists for Hollow Knight. You can find that here: https://github.com/Yascob99/BluePrinceArchipelago/blob/main/src/Utils/FSMUtils.cs
You are more than welcome to reuse my code/methods for your projects as both mine and the original are MIT License. I do plan on making this into a standalone library eventually so you can use it as a dependency for your own mods, but I haven't gotten around to that quite yet.
It contains a ton of helper functions that make modifying and interacting with FSMs a lot more bearable.
You can find examples of how I do so here:
https://github.com/Yascob99/BluePrinceArchipelago/blob/main/src/Patches/FSMPatches.cs
Wrapping up
There's a ton more I could write on the topic, but I don't want to overwhelm with information overload all at once. That said, if you have questions or just want advice on where to start looking or how to do do something mod related I would be happy to answer any questions you may have. If you get stuck somewhere let me know and I'd be happy to help with that as well.
I took my mod on as a project to help me learn C# as an experienced hobby programmer and I think you can do the same if you want to.
I will also note that I did not use any AI in the Creation of my mod and I at the very least recommend that if you do opt to use AI that you at least understand what and why it is doing what it's doing. This game has a ton of silly spelling mistakes and a lot of inconsistencies and inefficiencies due to it's indie nature. AI can do amazing things, but I almost guarantee that you will run into issues you can't solve unless you know enough about the game to know where the issue might lie.
Thanks for reading, and Happy Modding!