Easy Red 2

Easy Red 2

Not enough ratings
Gameplay Mods in Easy Red II
By Silverado Legion
Gameplay mods change or expand on core gameplay, not just adding additional vehicles or factions. Yes, it's possible!
   
Award
Favorite
Favorited
Unfavorite
NOTE:
Due to the most recent game update also updating to a new version of Unity, this no longer works. It may be some time before BepInEx 6 supports the new version. However, feel free to try bleeding edge builds of it.
DISCLAIMER
WARNING
Gameplay mods can often be in a legal gray area, and this is of concern due to there being no precedence for them in Easy Red II, even though they are common in hundreds of games.

Additionally, gameplay mods can be dangerous, with unintended consequences, or even malicious code, especially when gameplay modding is new to a game.

Tread carefully. Do not distribute any decompiled source code. Do not distribute game files. Only distribute you own mods. Only download mods from trusted sources (investigate source code if on GitHub). Publish your MOD'S source code on Github for the security of others.

ALL MODDING TOOLS USED ARE AVAILABLE ON GITHUB.
Visual Studio isn't, but that is safe, and there are open-source alternatives if desired.
Gameplay Modding
Gameplay mods change, remove, or even add core aspects of the gameplay of Easy Red II. These are mods made via (in the case of this game) C#, a programming language.

These mods can do almost anything. You can change how much damage you receive, you can change how vehicles work. You can add new kinds of weapons that were not previously possible. You could potentially even make a whole dynamic campaign if you wanted (given enough experience and work)! Basically anything is possible, and in a game like Easy Red II, this gives us unprecedented power, and can make this game live long after updates cease.

The next section covers installation of BepInEx 6 (the required mod loader) and my example gameplay mod.
Installing the Loader and Mods
What is BepInEx 6?
BepInEx is a really common mod loader for Unity games. However, you are probably only familiar with BepInEx 5. Due to technical details (use of Il2CPP instead of mono, don't worry if you don't know what that means) in how ER2 was made (since it wasn't developed with gameplay mods in mind), BepInEx 5 will not work. BepInEx 6 is the latest version, but is still in development. However, it does work with ER2, and gives us the features we need both to develop gameplay mods and create cool features.

Installing BepInEx 6
You MUST use BepInEx 6.0, NOT 5.4 (or any other 5.x version)
Installation is rather simple. If you would prefer, an official installation guide for BepInEx 6 is available with platform specific details.[docs.bepinex.dev] DOWNLOAD THE IL2CPP x64 VERSION
  1. - Go to the Latest BepInEx 6 pre-release[github.com]
  2. - Scroll down until you see "Assets", and click on the triangle.
  3. - Download the ZIP according to your platform. Should also contain "IL2CPP" and "x64".
  4. - Extract the contents of the ZIP into your game folder (ie. where "steamapps\common\Easy Red 2" is located on your computer)
  5. - If you are on Windows, you are done! Run the game once before adding mods, and let BepInEx load completely. It will load much faster after this first time.
  6. - If you are on MacOS or Linux, additional steps are required. I recommend reading the Official Guide[docs.bepinex.dev] for these extra details. Simply select the button for your platform.

Using BepInEx 6
Mod installation is much simpler. Before we begin, download a mod, [https://github.com/Silverado-Legion/ER2_Fire_Coaxial_Spacebar/releases/tag/v1.0.0]such as my sample mod[/url], which lets you fire the coaxial without switching to it, by firing while holding the spacebar.

  1. - Download the mod
  2. - Extract the mod into BepinEx's plugin folder (Easy Red 2\BepInEx\plugins)
  3. - Done! Simply launch the game.
List of All Mods
This section is a work in progress, and short because there are not yet many mods.
  • Spacebar Fire Coaxial
    This mod allows you to fire the Coaxial gun on vehicles by pressing fire while holding the spacebar.
    GitHub[github.com]
    Last Updated: May 16th, 2025

  • Disable Damage
    This mod turns damage off for all NPCs. Does not apply to vehicles, emplacements, buildings, etc. Does not disable bleeding (though you won't take damage), or some damage effects (grayscale, damage indicators).
    GitHub[github.com]
    Last Updated: May 15th, 2025
Developing Gameplay Mods
This is the legally gray area, due to there being no precedence for gameplay mods in this game. However, this section will cover how to develop gameplay mods. Do note that a more advanced, official BepInEx plugin development[docs.bepinex.dev] guide is also available.

Developing mods for a game like Easy Red II is more difficult than some other Unity games. It has no Mono version, so only IL2CPP is available (that is, the C# is turned into C++), which makes it harder. Previously, on BepInEx 5, there was some IL2CPP support, but it was limited, and didn't even work for this game. However, with BepInEx 6 and HarmonyX's new support for IL2CPP,

NOTICE: KNOWLEDGE OF C# PROGRAMMING IS ASSUMED. SOME ADVANCED CONCEPTS MAY BE USED.
If you do not know how to program in C#, there are countless courses for it, from the free courses found at W3 Schools and Microsoft's website for .NET, to YouTube, and many other free sources. Though it seems like a scary programming language, it is much easier to learn than you would expect. If you are new to programming, start with JavaScript, as that will help get the basic syntax down, then move onto C#.

I will also give a general rundown on how to write a Harmony patch in a later section.

Getting Started
There are several tools we will be using. Of course, BepInEx 6 must be installed, but there are other tools just as important:
  • - Visual Studio (or alternatives, such as VS Code, Rider, and open-source IDEs)
  • - DnSpyEx[github.com] (basically required for writing Harmony patches)
  • - .NET Standard 2.1 (used by the project template, compatible with Standard 2.0)
  • - Unity Explorer[github.com] (optional, useful for testing and debugging. Note that an unofficial continuation is linked, the original is discontinued.)
NOTICE: If you use Unity Explorer, you MUST use the IL2CPP.CoreCLR version!
Note: Unity is not required. The Unity-Mono plugin for DnSpyEx is not required (or even useful) for making mods for this game.

Creating a Mod
Before we begin, you should download the BepInEx templates. They are not required, but will make things easier:
  • - Open PowerShell, Bash, or other preferred terminal.
  • - Paste this command: dotnet new install BepInEx.Templates::2.0.0-be.4 --nuget-source https://nuget.bepinex.dev/v3/index.json
  • - Finished! Templates will be available in Visual Studio and Jetbrains Rider, or you can create a project from the terminal.

Now, with that out of the way, let's begin:
  1. - There are two options for creating a project:
    Create a BepInEx 6 IL2CPP project in VS or Rider, or:
    Run these commands in your terminal:
    dotnet new bep6plugin_unity_il2cpp -n MyFirstMod
    dotnet restore MyFirstMod

  2. - Now with your project created, double click on Plugin.cs in the editor, and you should see something as in the image.
    Initial Setup
  3. - Next, we need some essentials. Since BepInEx themselves have not created a NuGet package for this game, we will need to manually reference the game. From this point on, it is assumed you are using Visual Studio, though it's very similar in Rider (I may add a section for doing all of this in Rider in the near future, we will see). You should have run the game with BepInEx 6 at least once before now.

  4. - Right click on Dependencies in the Solution Explorer.
  5. - Click on "Add Project Reference".
  6. - Click on "Browse..." on the bottom right.
  7. - Navigate to the game's folder.
  8. - Navigate into BepinEx > interop
  9. - Select Assembly-CSharp.dll", and click Ok. You now have the game referenced!

  10. - With that complete, now we can add HarmonyX.
  11. - Click on "Project" on the top right.
  12. - Click on "Manage NuGet Packages..."
  13. - Click on "Browse".
  14. - Search "HarmonyX"
  15. - Select the package called "HarmonyX" by "BepInEx"
  16. - Click on install. It is now added!

    Writing Code
  17. - Now we can add code!
  18. - Add some space above "Log = base.Log;"
  19. - Add the code as shown in the image. This tells Harmony that we have patches, and we'd like it if they were all applied on load. You may notice a red squiggly line (present in the image too). That is the next step.
  20. - Hover the cursor on the text with the red line.
  21. - Press Alt + Enter after the error appears to automatically add the "Using" statement.

  22. - Now you can get to work!
Patching the Game with Harmony
Using dnSpyEx
Note: Highly recommend you read the wiki for Harmony 2[harmony.pardeike.net], covers everything you need to know in more detail. You should also understand Reflections.
  1. - Now that's done as well! Let's make a Harmony patch.
  2. - There are several kinds of patches. The most you will be concerned with most of the time are Prefixes and Postfixes. There are also others such as Transpilers, but these are more complex, but very powerful.

  3. - Now, open dnSpy. If you wish to patch something, you must understand what you are patching!
  4. - Click "File", and then "Open".
  5. - Navigate to the same DLL as before, the CSharp-Assembly.dll, select it, and press "Open".
  6. - Scroll down the panel on the left until you see "CSharp-Assembly", and click the triangle next to it, as well as the triangle next to "CSharp-Assembly.dll".
  7. - Now you can see a bunch of yellow lines. These are namespaces within the dll. Most you can ignore, except for ones that start with "CorvoStudio", among others. Additionally, the "-" has other classes you will want to look at, most of what you will likely be patching will be in there.

  8. - Now that we are here, we can open, say "Corvostudio.EasyRed2.Characters", then open "SoldierIdentityManager", and see a it's constructors, it's methods, it's fields, and so on.
  9. - Note: Since we are seeing not just detranspiled IL code, but that was decompiled from C++ code, although names of namespaces, classes, methods, and fields remains correct, the actual code and variables inside these does not match what was actually written exactly, though it will transpile to the same IL code. This makes it harder, but not impossible to read.
  10. - Perhaps just look around these. Now, if you don't plan to do anything with these, no need to study them right now, but get familiar with dnSpy.

Making the Harmony Patch
  1. - Let's actually understand Harmony now. Look at this image of the patch in my mod:
  2. - Let's break it down. First, we created a class called "Patches" (called that since I only have one in this case. If you are going to have quite many, you should have a few classes across different files for the different classes or namespaces you are patching, for organization). This class has the attribute of "[HarmonyPatch]", which is necessary for Harmony to see it.

  3. - Next, we have a private static method called "DamagePatch", which is of return type bool. It also takes one parameter: A reference to a float variable, and this reference is called dam. This is a parameter that Harmony will fill in from the method we are patching, and it will fill them in the same order as in the original method. Now, the type that we return as for this patch, a prefix, is always either bool (recommended) or void (some use cases).

  4. - The method has two attributes. The first is "[PreFix]", which indicates to Harmony that we want to run this before the method itself runs, and perhaps even override it (return false to override, return true to allow the method to run). The second is more complex: "[HarmonyPatch(typeof(Creature), "Damage")]". This tells Harmony that we want to patch the method "Damage"--we use quotes because (usually) it's private--in the "typeof(Creature)" (that is the parent class of things such as soldiers).
  5. - That's the basic rundown! Now you don't have to use a try-catch statement, but you should (almost) always have a fallback condition in case something goes wrong. In that case, don't directly change parameters unless you need to, and if something goes wrong, return true, so that you fall back to vanilla implementation.

Additional Harmony Information
There are some other things you will want to know about patches as well.
Common Tags
  • - If you need to know the exact instance the instance is apart of, "this" won't work. Add a parameter like this: "ref <type here> __instance". Replace <type here> with the type of the instance. Harmony will recognize this variable name, and effectively put "this" there so you have access to it.
  • - Similarly, with postfixes, if you need the result of the method (before anything uses it), you can do: "ref <type here> __result".
There are other tags such as these, I recommend reading the guide linked above for more information.

Postfixes
Similar to prefixes, but they run after the target method instead. They are always of the void return type. Typically, these are used for making changes to the results of other methods, and they cannot override the method. Do note that they can potentially be slower than prefixes if not used for the correct situation.

Transpilers
One of the most powerful types of patches, just because it lets you actually change the IL code of other methods at RUNTIME. However, this makes them complex, but you can understand it with some help, and just breaking down examples into digestible pieces. I don't have an example of one in Easy Red II right now, but I have done this several times in the mod Burning Empires for Mount and Blade 2.
Thanks
Thank you for reading this guide. It's the first time I've written a guide like this (though I have written programming guides before, just not on Steam). It's also the first of it's kind for this game as far as I can tell, and I hope that it leads to a revolution in modding for this game, a revolution that will keep it alive forever, just like gameplay mods in games like Minecraft and MB2: Bannerlord have kept those games alive, and indeed made them such incredible games that many feel they must have, even if just for the mods.

BE CAREFUL! Since gameplay mods are new to this game, this is the WILD WEST! It will take time for there both to be good mods, and for there to be an active and safe community for modding.
Update: State of Gameplay Modding
Since this is so new, there is very little that is understood about how the game works, or how to do certain things. I previously mentioned that BepInEx decompiled the game, but this is incorrect. Instead, it smartly converts the game into C# methods that match the original that simply invoke a pointer to the actual method, to allow HarmonyX to work. This means that we have no real info on how anything works, and it is difficult to figure out. It will take time before anything crazy is possible, as the info just isn't there, and I am currently the only one working on this.

What Needs to Be Done
  • - Create a mod with utilities and an API to make mod development easier.
  • - Better understand how the game works.
13 Comments
Silverado Legion  [author] 12 Jul @ 4:47pm 
Oh ok, a bleeding edge build. Nice to hear that the team is working on supporting the latest Unity versions.
TeusPLAY 11 Jul @ 2:51pm 
I used this version: BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.738
Silverado Legion  [author] 11 Jul @ 7:54am 
What version of BepinEx are you using?
TeusPLAY 11 Jul @ 7:05am 
Yesterday i checked and all ai wasn't taking any damage with your mod. It is working XD
Silverado Legion  [author] 10 Jul @ 7:59pm 
I have a reduced damage mod that I don’t think I released which works only for the player. Is this still working though? It didn’t work last I tried cause a recent update updated unity versions. I’ll have to check it BepinEx 6 was updated.
TeusPLAY 10 Jul @ 2:52pm 
Awesome guide. Thank you. Can you make a version of the "Disable damage" that only the player takes no damage in the future?
Silverado Legion  [author] 15 Jun @ 10:19am 
Or we can hope that eventually we get a mono version of the game
Silverado Legion  [author] 15 Jun @ 10:19am 
I'm not certain. However they probably use Il2CppObjectBase because Easy Red II was compiled in Unity's IL2CPP mode, which means that the C# was compiled into C++, which was then compiled into assembly, so we can't really see how anything in the game works (without Ghidra, of course, but that will be some serious work and even then we can't distribute what we learned to help others who can't do that). Likely what you need to do is include separate Unity DLLs that were compiled as Mono in your mod.
zawmbie 14 Jun @ 9:23pm 
Do you know how to get unstripped DLLs working in ER2? I'm trying to use Unity methods that are supposed to use 2D arrays, but instead they use Il2CppObjectBase which I can't work with. I tried referencing the DLLs in the unity-libs folder, but then it complains about missing methods when testing in game.
Silverado Legion  [author] 9 Jun @ 8:14am 
It should work with the 6.0 pre-releases but yeah those should work too