Master of Orion

Master of Orion

Unofficial Code Patch Steam Workshop
Lasercar Mar 8, 2023 @ 12:07am
Tips for starting/working on a unofficial code patch for another game?
Hi WhatIsSol,

I would like to fix many of the issues that still plague urban empire. It's been abandoned by the developers (kinda like MOO) but it still has many bugs (and performance issues).

It's also a unity game, so the code is a dotpeek away. But anyway, as per the topic title, I was wondering if you could provide me with any tips as to how I'd go about starting one and working on it.
< >
Showing 1-2 of 2 comments
WhatIsSol  [developer] Mar 8, 2023 @ 8:52pm 
The tools i used to create this are in the readme:

:::: 1.8: How this patch was created I do all my edits of the DLL in CIL using the tools ildasm (decompile) and ilasm (compile). All available from MS Visual Studio (free version) or the Windows SDK. For editing the CIL I just use notepad++ For SWF editing I use the JPEXS Free Flash Decompiler and I edit the p-code directly

For visualizing the code in its more or less native mode I use ILSpy. I also heavily use Kdiff. But I hand edit the CIL. As I used to write Assembly code using the DOS debugger I have no issues with that but I know it is not for everyone.

They also kind of oddly baked in the different platforms into the main MOO assembly. So I basically edit one copy of the game, GOG Windows and after I'm happy, I manually merge it into the other versions of the game.

This merge process is kind of tedious and is were I introduce a fair amount of platform problems. Some are not merge issues per say but that the developers of MOO have different assets in the different platforms.

I have also edited ATOM RPG - Neutron mod for that I used a third party open source library called Harmony "A library for patching, replacing and decorating .NET and Mono methods during runtime." For more information please see the following URLs: https://www.patreon.com/pardeike and https://github.com/pardeike/Harmony

That approach has a lot going for it as instead of including the entire assembly you only need to include the few changes you made. It also allows it in some cases to run in multiple platforms - like GOG and Steam without having to do any manual merging of code which is a big plus. It even will sometimes survive a game companies patch. Depending upon what they changed your mod could still work as is.

Depending on your changes you are planning Harmony is really nice. It also plays nicer with say if other people want to mod the same game, since as long as everyone is using the same version of Harmony and you are not trying to modify the same routines, multiple mods can work together.

Harmony does have some limitations on what it can do - so it may or may not be suitable for your project needs. But it is a cool library and is worth a look.
Ragnaman Aug 20, 2023 @ 6:09am 
I use DnSpy, only complaint is that it can crash and lie about out of memory, but this happens if you try to do a crazy large search before it has initialised all the files.
Other than that its a great tool for cracking open Unity games.
< >
Showing 1-2 of 2 comments
Per page: 1530 50