Creating a Roguelands Unity Project - SuperKael/Gadget-Core GitHub Wiki
There are many reasons why you may wish to create a Roguelands Unity Project. Perhaps you wish to create AssetBundles, or maybe you just want to look at how the Unity assets and scenes are constructed. Either way, this page will explain how to create one.
Required Tools/Programs: Windows OS, Unity 2017.3.0, and uTinyRipper. Optionally, if you want to add code-completeness to the project, you also need: dnSpy and Visual Studio 2019 or higher (Recommended) or 2017 (Minimum)
- First, open uTinyRipper. You will be presented with a window with the text "Drag & Drop files/folders here".
- Open the 'Roguelands' folder, the one containing 'Roguelands_Data'.
- Drag 'Roguelands_Data' into the uTinyRipper window. If you are unable to do so, make sure you are NOT running uTinyRipper as administrator.
- After a moment, it should say "Files has been loaded", with a button labeled 'Export'. Press 'Export', and choose a destination directory (Personally, I recommend 'Documents' or a subfolder within, such as 'Roguelands Modding'). Keep in mind that it will place the extracted Unity files into a subfolder (that uTinyRipper will create) of wherever you select.
- Now, the actual data extraction will be performed by uTinyRipper. Be patient, this can take a long time. Once complete, open the folder you told it to export to.
- Select the folder named 'globalgamemanagers' (Which was created by uTinyRipper) and rename it to 'Roguelands'.
- In Unity, tell it to open/add an existing project, and put it to the 'Roguelands' folder that you just renamed. It may or may not need a while to process the files into a project.
Alright, so now you have a skeleton Roguelands project. However, there is one type of file uTinyRipper can't extract: Code. As such, this Roguelands project, although functional in the editor, will do absolutely nothing if you click play. If you wish to achieve (partial) code functionality, follow the coming steps. Otherwise, you can be done here.
- Open the Roguelands/Roguelands_Data/Managed folder inside your game installation.
- Open Assembly-CSharp.dll in dnSpy.
- Select 'File' -> 'Export to Project...'. For 'Folder', point it to the Assets/Scripts folder in your Roguelands Unity Project. For 'Version', select 'VS2017'. Make sure 'Language' is set to 'C#'. Then press 'Export'.
- Repeat steps 9 and 10 for Assembly-UnityScript.dll in the Managed folder.
- Then, open the Assets/Scripts/Assembly-CSharp folder, and move the 'PlayerPrefs.cs' file into the 'PreviewLabs' folder. Replace the existing file as you do so. This is necessary due to an inconsistency between the behavior of uTinyRipper and dnSpy.
- Now, you really should be done, except dnSpy's code continues to be imperfect so you must also delete the Assets/Scripts/Assembly-CSharp/Properties folder.
- There are two more files that need to be fixed: Assembly-CSharp/WormEgg.cs, and Assembly-UnityScript/Vignetting.cs. However, these require careful modification, so open them in Visual Studio.
- For WormEgg.cs, find the '
IEnumerator Blink()
' method, and replace the erroring "goto IL_D2;
" line with "yield break;
" - For Vignetting.cs, find the '
void OnRenderImage(RenderTexture source, RenderTexture destination)
' method, and replace the erroring "bool flag = (Mathf.Abs(this.blur) > (float)0) ?? (Mathf.Abs(this.intensity) > (float)0);
" line with "bool flag = (Mathf.Abs(this.blur) > (float)0) || (Mathf.Abs(this.intensity) > (float)0);
".
And now you're totally done! dnSpy's decompiled code has been added to your project, and as such it is now partially functional. It's important to keep in mind that, although the project is now code-complete, dnSpy is imperfect. As such, although the game will run and have partial functionality, it will still be severely broken. As such, don't expect to be able to just play the game in the Unity editor - that being said, it is more than good enough for testing and creating AssetBundles.