Editor, Active player (459)
Joined: 2/11/2018
Posts: 240
Due to my interest in different platforms, I had a go at porting games from macOS to Linux, following ikuyo's guide for the most part. As described in that guide, the main reason for porting Mac games rather than Windows is that Mac versions tend to support OpenGL while Windows versions do not. I don't have a native Mac or Linux setup, which makes this process extra-fun. Most of my time has been spent with Deepest Sword. It was released in 2021 and is quite popular in RTA, and a segmented TAS video exists. More recent Unity games do not have quite the same file structure as the guide. They use MonoBleedingEdge (whatever that is). Similarly the file needed is instead libmonobdwgc-2.0.so. However the process should be about the same. ScreenSelector.so doesn't seem to be included. Eventually I ran into this error message from the Unity log:
[Subsystems] Discovering subsystems at path /mnt/c/Users/User/Downloads/unityporting/DeepestSword-v-0-1-5c-Mac - Copy/DeepestSword_Data/UnitySubsystems
Forcing GfxDevice: OpenGL Core
Forced GfxDevice 'OpenGL Core' was not built from editor, shaders will not be available

PlayerInitEngineGraphics: InitializeEngineGraphics failed
Failed to initialize player
Caught fatal signal - signo:11 code:1 errno:0 addr:(nil)
Obtained 11 stack frames.
#0  0x007fc3150d3520 in __sigaction
#1  0x007fc316336d06 in PhysicsModule::GetDefaultPhysicsSceneHandle() const
#2  0x007fc316263c1b in UnityScene::~UnityScene()
#3  0x007fc316260c7a in RuntimeSceneManager::~RuntimeSceneManager()
#4  0x007fc3162604d5 in StaticDestroyRuntimeSceneManager(void*)
#5  0x007fc315fa2aff in RegisterRuntimeInitializeAndCleanup::ExecuteCleanup()
#6  0x007fc316246d8a in RuntimeCleanup()
#7  0x007fc316424218 in PlayerMain(int, char**)
#8  0x007fc3150bad90 in __libc_init_first
#9  0x007fc3150bae40 in __libc_start_main
#10 0x00000000201029 in _start
I'm not sure what that would suggest except that OpenGL isn't supported. From testing by others this game does work with OpenGL in macOS from what I understand. I've tried several other games. I'm searching on itch.io with these filters. Not sure how to find games from a certain date. The best way I found was to search for old Ludum Dare competitions like this. Some games have a launcher, which will probably interfere with TASing even if they can successfully be ported: Eventually I found Shrinking Planet. It matches the guide much more closely and I was able to port it. It runs in libTAS at about 0.5 FPS. At this point I'm sceptical if macOS should even be its own platform. The integral game files seem independent of any OS. I'm not familiar with the graphics engine differences though. I think these more recent games using MonoBleedingEdge should be portable, but I don't know what else is required.
Judge, Moderator, Player (200)
Joined: 7/15/2021
Posts: 112
Location: United States
Randomno wrote:
Some games have a launcher, which will probably interfere with TASing even if they can successfully be ported:
libTAS will automatically bypass the launcher (by refusing to load ScreenSelector.so), so they should still work unless the porting process breaks libTAS's bypass.
Editor, Active player (459)
Joined: 2/11/2018
Posts: 240
I tried porting with AssetRipper, using Deepest Sword again. All I had to do after decompiling and opening in Unity was to install Unity UI package, and it built. It was fairly broken though. Had the idea to port the Windows version the "normal" way (btw, unify is really useful here) and then zombie it together with the recompiled version until it worked. I found that globalgamemanagers determines what rendering engine to use (DirectX, Vulkan, etc.). Replacing this file makes the game launch but with the classic broken-shaders pink screen. Replacing Resources/unity_builtin_extra fixes the graphics. However, text is still broken. This game uses TextMeshPro which the decompiler doesn't like, and I don't know how it works or how to deal with it. If anyone has more experience with Unity or wants to TAS a Unity game, I suggest trying this method and see what you can do. Of course, still need the ported game to work in libTAS. I don't know if there's any ways to make it more compatible when building.