NeighTools / UnityDoorstop

Doorstop -- run C# before Unity does!
GNU Lesser General Public License v2.1
454 stars 69 forks source link

Doorstop 4 debugger does not work on Bug Fables, but it works after upgrading Mono to MonoBleedingEdge #33

Closed aldelaro5 closed 6 months ago

aldelaro5 commented 2 years ago

This one is half a bug and half a question because I have a good suspicion of what is happening, but I would still like to have more clarifications if that is the case. Basically, I tried to debug the game assemblies without changing any runtime files using Doorstop 4 and the best I got was the game would invoke the crash handler as soon as I try to connect and the connection closes. I have not been able to maintain a connection until I used Unity's files to upgrade the runtime of the game to the newer one this version of Unity ships with which allowed me to debug seamlessly.

Bug Fables (steamdb: https://steamdb.info/app/1082710/ ) ships with Unity 2018.4.12f1 which means it should support the debugging feature the new Doorstop 4 advertise as the readme says it should work past Unity 2017. However, this game has an interesting quirk: it does not actually uses the new Mono (called MonoBleedingEdge) because the game was originally developed for Unity 5.5.4 which only offered the older .net 3.5 compatible Mono 2.x. The only reason the engine was upgraded was to add support for consoles, but due to the fear of anything breaking, Moonsprout Games decided to not upgrade to the new runtime despite the old one being deprecated in that version.

This has proven to be very difficult for me to deal with because after a bunch of tests and research, I found that the only way for me to debug the game assemblies while preserving the runtime is to either use a Windows vm (I primarily use Linux) to generate full pdb files (not protable ones) from recompiled sources JUST to convert them to mdb or to use the Unity's original tooling. The later in particular have not been working as well as simply using the Unity files to upgrade the game to MonoBleedingEdge which is not only more stable, but also more compatible. FYI, the reason I use recompiled sources over dnSpyEx is due to it being very inefficient to decompile large functions which this game has.

The reason I am bringing this up is because I am both reporting it as a bug and also wants clarifications on the matter. Does Doorstop 4 supports the older Mono Unity shipped with despite the fact the game is a version above 2017? If the answer is no, I might as well ask in general: am I better off to upgrade the runtime even if it risks altering the behavior of the game?

aldelaro5 commented 6 months ago

This is no longer relevant because I long figured out the issue so I'll close it.

In case it helps people: the issue is indeed that the documentation made a rough estimate that applies in most cases. However, what actually matters is the mono runtime used being the default from 2018.x and onward. Between 2018.1 and 2019.1, it was still possible to use the legacy runtime which doorstop's debugger doesn't support, but only a game that upgraded to such a version would still have this which is rare.