OpenRA / ra2

A Red Alert 2 mod for the OpenRA game engine
GNU General Public License v3.0
965 stars 158 forks source link

macOS game hangs with black screen #804

Closed taoeffect closed 1 year ago

taoeffect commented 1 year ago

Hi, I can't get this to work on macOS 12, M2.

Here's the output from compiling ra2/engine (the OpenRA engine, checked out to release-20210321):

-> % make RUNTIME=mono                                                
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.exe
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.exe
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Test -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Test.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.exe

And here's the output from compiling the mod:

-> % make
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.exe
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.exe
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Test -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Test.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.exe
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Mods.RA2 -> /Users/user/Games/C&C Red Alert/ra2/mods/ra2/OpenRA.Mods.RA2.dll

And here's the output from running the game:

-> % ./launch-game.sh
Platform is OSX
Engine version is release-20210321
Using SDL 2 with OpenGL (Modern) renderer
Desktop resolution: 2560x1440
No custom resolution provided, using desktop resolution
Using resolution: 2560x1440
Using window scale 2.00
^C^C./launch-game.sh: line 46:  1577 Killed: 9               mono --debug bin/OpenRA.exe Engine.EngineDir=".." Engine.LaunchPath="${TEMPLATE_LAUNCHER}" "Engine.ModSearchPaths=${MOD_SEARCH_PATHS}" Game.Mod="${MOD_ID}" "$@"

A window opens and goes fullscreen, all black, spinning beachball (macOS app hang indicator).

Any idea what I might be doing wrong? I did put the .mix files in ~/Library/Application Support/OpenRA/Content/ra2/ per the instructions.

penev92 commented 1 year ago

I know OpenRA can take obscenely long to load fonts on MacOS on first run and appear as a "hung" black window/screen in the mean time. My other guess would be that the now outdated engine may have issues with M2s, but that's just a wild guess.

taoeffect commented 1 year ago

So, I tested this further, and this seems to be an issue with the release-20210321 tag on OpenRA, because on bleed it instantly starts up. So I don't think this has anything to do with fonts...

However, I can't try ra2 mod with bleed :-\

taoeffect commented 1 year ago

Also, I should mention that the instructions in this mod's readme are a bit outdated, since make dependencies isn't a thing in either bleed or release-20210321

penev92 commented 1 year ago

Since bleed runs but release-20210321 doesn't, I'll quote my answer to the other issue that was reported here today:

Hello. I assume you're running the master branch, which is targeting .NET 4.7. If so it would probably not be worthwhile to try and investigate that. I have started updating the mod for the upcoming OpenRA release and you can find that here - https://github.com/penev92/ra2/tree/updateModTo202212-devtest. Try packaging that and tell me how that goes.

In your case I guess you can try and run that.

taoeffect commented 1 year ago

@penev92 ok, I set the engine to bleed branch, compiled it with make RUNTIME=mono, went up a directory into ra2 folder, then ran make all:

-> % make all         
/bin/sh: dotnet: command not found
Automatic engine management is disabled.
Please manually update the engine to version playtest-20230110.
Unable to continue without engine files
make: *** [engine] Error 1

So I updated engine/VERSION as it requested, and ran make all again:

-> % make all
/bin/sh: dotnet: command not found
Compiling in Release mode...
make[1]: dotnet: No such file or directory
make[1]: *** [all] Error 1
make: *** [engine] Error 2

How do I compile it? It was compiling before...

taoeffect commented 1 year ago

OK, so I looked through the changes in the Makefile and it seems the build instructions changed. So I tried with make RUNTIME=mono and it started making progress but then gave an error at the end:

-> % make RUNTIME=mono
/bin/sh: dotnet: command not found
Compiling in Release mode...
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.dll
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.dll
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.dll
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  Restored /Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj (in 707 ms).
  3 of 4 projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(213,31): error CS0539: 'Mirage.Docked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(222,31): error CS0539: 'Mirage.Undocked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(45,35): error CS0115: 'ExtendedTilesetSpecificSpriteSequenceLoader.CreateSequence(ModData, string, SpriteCache, string, string, MiniYaml)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(69,29): error CS0115: 'ExtendedTilesetSpecificSpriteSequence.GetSpriteSrc(ModData, string, string, string, string, Dictionary<string, MiniYaml>)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]

Perhaps I need to have ra2/engine pointed to a specific commit?

penev92 commented 1 year ago

The target engine in that branch is fine, no need to target a specific commit. I don't know enough about running on non-windows systems to help, but why are you struggling with Mono when you can use .net6? Do you have a new enough Mono? Shouldn't you be running make RUNTIME=mono all?

I do recommend using .NET 6 instead.

taoeffect commented 1 year ago

I'm using mono 6.12 (the latest?). I'll try with .NET 6 (I didn't know that existed for macOS, I thought the reason mono existed was because .NET wasn't a thing on mac).

The output of make RUNTIME=mono all is about the same, except the errors are in reverse order:

-> % make RUNTIME=mono all
/bin/sh: dotnet: command not found
Compiling in Release mode...
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.dll
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.dll
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.dll
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  Determining projects to restore...
  All projects are up-to-date for restore.
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  It was not possible to find any installed .NET Core SDKs
  Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
      https://aka.ms/dotnet-download
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(69,29): error CS0115: 'ExtendedTilesetSpecificSpriteSequence.GetSpriteSrc(ModData, string, string, string, string, Dictionary<string, MiniYaml>)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(45,35): error CS0115: 'ExtendedTilesetSpecificSpriteSequenceLoader.CreateSequence(ModData, string, SpriteCache, string, string, MiniYaml)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(213,31): error CS0539: 'Mirage.Docked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(222,31): error CS0539: 'Mirage.Undocked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
taoeffect commented 1 year ago

I get the same error with .NET 6:

-> % make all
Compiling in Release mode...
  Determining projects to restore...
  All projects are up-to-date for restore.
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.dll
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:02.05
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(45,35): error CS0115: 'ExtendedTilesetSpecificSpriteSequenceLoader.CreateSequence(ModData, string, SpriteCache, string, string, MiniYaml)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(69,29): error CS0115: 'ExtendedTilesetSpecificSpriteSequence.GetSpriteSrc(ModData, string, string, string, string, Dictionary<string, MiniYaml>)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(213,31): error CS0539: 'Mirage.Docked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(222,31): error CS0539: 'Mirage.Undocked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]

Build FAILED.

/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(45,35): error CS0115: 'ExtendedTilesetSpecificSpriteSequenceLoader.CreateSequence(ModData, string, SpriteCache, string, string, MiniYaml)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Graphics/ExtendedTilesetSpecificSpriteSequenceLoader.cs(69,29): error CS0115: 'ExtendedTilesetSpecificSpriteSequence.GetSpriteSrc(ModData, string, string, string, string, Dictionary<string, MiniYaml>)': no suitable method found to override [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(213,31): error CS0539: 'Mirage.Docked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/Traits/Mirage.cs(222,31): error CS0539: 'Mirage.Undocked()' in explicit interface declaration is not found among members of the interface that can be implemented [/Users/user/Games/C&C Red Alert/ra2/OpenRA.Mods.RA2/OpenRA.Mods.RA2.csproj]
    0 Warning(s)
    4 Error(s)

Time Elapsed 00:00:00.62
penev92 commented 1 year ago

Those error messages tell me you are targetting OpenRA's bleed branch instead of the playtest that I had referenced or at least the prep-2211 branch that will become the upcoming release.

taoeffect commented 1 year ago

The target engine in that branch is fine, no need to target a specific commit.

I thought ☝️ meant I was targeting the right engine, must have misunderstood!

There's no branch called playtest in the engine, but there is prep-2211, and that worked!

-> % make all
Compiling in Release mode...
  Determining projects to restore...
  All projects are up-to-date for restore.
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Launcher -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.dll
  OpenRA.Server -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Server.dll
  OpenRA.Platforms.Default -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Platforms.Default.dll
  OpenRA.Utility -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Utility.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.D2k -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.D2k.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.67
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  OpenRA.Game -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Game.dll
  OpenRA.Mods.Common -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Common.dll
  OpenRA.Mods.Cnc -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.Cnc.dll
  OpenRA.Mods.RA2 -> /Users/user/Games/C&C Red Alert/ra2/engine/bin/OpenRA.Mods.RA2.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.61

Alright! Progress! 😄

This still wasn't enough to get it to run, as next I got:

-> % ./launch-game.sh 
Platform is OSX (Arm64)
Engine version is playtest-20230110
Runtime: .NET CLR 6.0.13
Renderer initialization failed. Check graphics.log for details.
Renderer initialization failed. Check graphics.log for details.
Exception of type `System.InvalidOperationException`: Failed to initialize platform-integration library. Check graphics.log for details.
   at OpenRA.Game.Initialize(Arguments args) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Game.cs:line 361
   at OpenRA.Game.InitializeAndRun(String[] args) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Game.cs:line 304
   at OpenRA.Launcher.Program.Main(String[] args) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Launcher/Program.cs:line 32

graphics.log had this:

System.DllNotFoundException: Unable to load shared library 'SDL2' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libSDL2, 0x0001): tried: 'libSDL2' (no such file), '/usr/local/lib/libSDL2' (no such file), '/usr/lib/libSDL2' (no such file), '/Users/user/Games/C&C Red Alert/ra2/engine/libSDL2' (no such file)
   at SDL2.SDL.SDL_Init(UInt32 flags)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.CanCreateGLWindow(GLProfile profile, List`1 errorLog) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 548
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.<>c__DisplayClass49_0.<.ctor>b__0(GLProfile profile) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 156
   at System.Linq.Enumerable.WhereListIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow..ctor(Size requestEffectiveWindowSize, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile requestProfile, Boolean enableLegacyGL) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 155
   at OpenRA.Platforms.Default.DefaultPlatform.CreateWindow(Size size, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile profile, Boolean enableLegacyGL) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/DefaultPlatform.cs:line 21
   at OpenRA.Renderer..ctor(IPlatform platform, GraphicSettings graphicSettings) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Renderer.cs:line 79
   at OpenRA.Game.Initialize(Arguments args) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Game.cs:line 382
System.DllNotFoundException: Unable to load shared library 'SDL2' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libSDL2, 0x0001): tried: 'libSDL2' (no such file), '/usr/local/lib/libSDL2' (no such file), '/usr/lib/libSDL2' (no such file), '/Users/user/Games/C&C Red Alert/ra2/engine/libSDL2' (no such file)
   at SDL2.SDL.SDL_Init(UInt32 flags)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.CanCreateGLWindow(GLProfile profile, List`1 errorLog) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 548
   at OpenRA.Platforms.Default.Sdl2PlatformWindow.<>c__DisplayClass49_0.<.ctor>b__0(GLProfile profile) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 156
   at System.Linq.Enumerable.WhereListIterator`1.ToArray()
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at OpenRA.Platforms.Default.Sdl2PlatformWindow..ctor(Size requestEffectiveWindowSize, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile requestProfile, Boolean enableLegacyGL) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs:line 155
   at OpenRA.Platforms.Default.DefaultPlatform.CreateWindow(Size size, WindowMode windowMode, Single scaleModifier, Int32 batchSize, Int32 videoDisplay, GLProfile profile, Boolean enableLegacyGL) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Platforms.Default/DefaultPlatform.cs:line 21
   at OpenRA.Renderer..ctor(IPlatform platform, GraphicSettings graphicSettings) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Renderer.cs:line 79
   at OpenRA.Game.Initialize(Arguments args) in /Users/user/Games/C&C Red Alert/ra2/engine/OpenRA.Game/Game.cs:line 382

So then I stumbled upon this issue: https://github.com/OpenRA/OpenRA/issues/19805

So I manually linked SDL (ln -s /opt/homebrew/Cellar/sdl2/2.26.2/lib/libSDL2-2.0.0.dylib /usr/local/lib/libSDL2.dylib), and linked the other libraries too (except for lua), and started the game - it loaded!

I started playing it, and it got to this point where I ran out of money and the miner was unloading, but it didn't finish unloading what it mined, it just sat there:

Screen Shot 2023-01-26 at 1 24 05 PM

So I thought maybe this is because I didn't link lua (even though I saw no errors). So I linked lua, and tried again. Same thing happened. Also I noticed that attack-move didn't work on dogs.

I am very confused as to why the manual linking is necessary on macOS, because before the engine built and loaded fine for the other mods (no manual linking was needed). But now manual linking is needed! Even with just the engine (not the ra2 mod). So that might be caused by switching to .NET...

All dependencies were installed via homebrew btw (standard way of installing them on macOS).

So, to summarize:

And finally, here's the output from running ra2's launch-game script:

-> % ./launch-game.sh 
Platform is OSX (Arm64)
Engine version is playtest-20230110
Runtime: .NET CLR 6.0.13
Using SDL 2 with OpenGL (Modern) renderer
Desktop resolution: 2560x1440
No custom resolution provided, using desktop resolution
Using resolution: 2560x1440
Using window scale 2.00
OpenGL renderer: Apple M2
OpenGL version: 4.1 Metal - 76.3
Using default sound device
Internal mods:
    ra2: Red Alert 2 ({DEV_VERSION})
    cnc: Tiberian Dawn ({DEV_VERSION})
    d2k: Dune 2000 ({DEV_VERSION})
    all: All mods ({DEV_VERSION})
    ra: Red Alert ({DEV_VERSION})
    modcontent: Mod Content Manager ({DEV_VERSION})
    ts: Tiberian Sun ({DEV_VERSION})
External mods:
    ra2-{DEV_VERSION}: Red Alert 2 ({DEV_VERSION})
    ts-{DEV_VERSION}: Tiberian Sun ({DEV_VERSION})
Loading mod: ra2
UNSUPPORTED (log once): POSSIBLE ISSUE: unit 1 GLD_TEXTURE_INDEX_2D is unloadable and bound to sampler type (Float) - using zero texture because texture unloadable
penev92 commented 1 year ago

@taoeffect can you join us on Discord?

taoeffect commented 1 year ago

@penev92 sure! I'm currently muted for 10 min as a new user.

BTW - I just tried compiling again with mono using make RUNTIME=mono all - it worked!

Turns out the problem was I needed to have prep-2211 checked out, and then it builds with both .NET and mono - and even better, with mono, there is no manual linking necessary. I opened a related issue to this in OpenRA: https://github.com/OpenRA/OpenRA/issues/20641

taoeffect commented 1 year ago

Thanks for your help figuring this out @penev92!