** THIS WRITE UP IS A WIP. **
Some parts are not completed and will probably change.
I have managed to start dissecting the games code and have set up a development environment for creating mods. If you would like to work on your own mods, here is how you can do it!
** DISCLAIMER: **
The official stance is that it is not recommended to mod at this point - or at least it’s not supported yet if something goes wrong. As you noticed, it could currently break files, plus things will be changing so much with balancing and bug fixes, that mods will be out of date a lot and could break other things. So do so at your own risk!!
Requirements:
- Melon Loader *Make sure you have all of its requirements installed
- DnSpy
- .NET SDK 6.0 x64 version
- A legal copy of Big Ambitions (Of course)
If you plan on creating your own mods, I recommend you have a very good understanding of Unity. You should know the engine well enough to create complex games, since reverse engineering a games code is 10x harder than writing your own.
Step 1: Installing MelonLoader
To access any of the games code, or to load an external modifications, we will need a mod loader installed first. At first I attempted to use BepInEx as I have more experience using it. However, it seems that the combination of Unity 2021.3 + Il2CPP backend doesnt work well ATM.
So MelonLoader it is! Installing is fairly simple with their automated installer. Just follow the instructions in the wiki.
** IMPORTANT: **
The game is 64-bit so you MUST install that version of MelonLoader. The installer should automatically detect this.
Once it is installed you have to launch the game atleast once. You should see a new loading screen that looks like this.
** IMPORTANT: **
If you own the game on Steam DO NOT open the exe directly. Make sure you launch the game through Steam.
Once the game has loaded, if you open the games install directory you should see some new Folders (MelonLoader, Mods, UserData & UserLib) This means you have completed the MelonLoader installation
Step 2: Reading the games code
The first thing you must know is that this game uses the IL2CPP backend instead of Mono. I assume this is for the performance benefits of C++ (only the devs know for sure )
This is the reason we must first use MelonLoader before accessing the games code. With a typical Mono game, we can just read Assembly-CSharp.dll
in DnSpy. With IL2CPP there is no Assembly-CSharp.dll
to read from.
Once we have loaded the game with MelonLoader, A new Assembly-CSharp.dll
file will be created in
Big Ambitions\MelonLoader\Managed
Open this file in DnSpy. You can now admire all the hard work that has gone into coding this amazing game!
Much of what happens in the game is controlled by the GameManager
so that is a good place to start.
You will notice that most of the functions look the same. This is because we are not looking at the actual source code, but rather a decompiled translation of the compiled C++ code, that was translated from IL, which was compiled from the C# source code. (This is very simplified and probably incorrect )
I am not an expert in code reverse engineering, but I am trying my best to better translate the decompiled code. If anyone here has more experience in this, your help would be greatly appreciated!
For now, we can mostly infer what each function does from its name (The devs have done a great job of naming).
Next I will show you how to install the UnityExplorer
mod, which will allow us to inspect gameObjects right in the game, and execute code so we can test what each function does.
Step 3: Installing UnityExplorer
By using UnityExplorer, we can inspect GameObjects in a similar way to how you would use the built in Unity Editor.
You can download it from the GitHub. Make sure you get the MelonLoader 0.5 IL2CPP version.
Drag the files into your Big Ambitions
directory and launch the game.
After a few seconds you should see this UI appear in game.
I HIGHLY recommend you create a new save game for testing at this point, as there is a good chance you will start breaking things now.
There are some instructions on the GH page for how to use the mod. You will be able to see all GameObjects and inspect any scripts attached to them which will be very useful for creating mods. You can also use Hooks and the C# console to run code directly in the game!
** IMPORTANT: **
When entering a loading screen, you MUST disable any modded UIs (UnityExplorer default hotkey is f7). If the UI is enabled when entering a loading screen it will break the UI and you will no longer see it. I assume this comes from the loading optimizations.
** NOTE **
In some cases you may need additional dll files in \UserLibs
that are not included in the default build. To get these, you need to clone the UnityExplorer repo and build it yourself in Visual Studio. This may seem difficult but it is good practice for making your own mods (and you can use their code as an example for complex mods).
Step 4: Creating your first mod!
** COMING SOON **