rfht / fnaify

Run FNA/XNA games on OpenBSD - DEPRECATED! Check out the successor: https://github.com/IndieRunner/IndieRunner
https://www.PlayOnBSD.com
ISC License
36 stars 2 forks source link

Mojoshader ClassicUO Client Ultima Online #33

Open ChefDeLaSauce opened 4 years ago

ChefDeLaSauce commented 4 years ago

Trying to run a program that supposedly is an XNA app, the ClassicUO launcher (Ultima Online). I was able to nab all the dependencies, but it requires the mojoshader library, and unfortunately I am having trouble finding this library on FreeBSD 12.1. I tried compiling the library from source, but I can't get past an objc missing library.

Curious if anyone has solved mojoshader related problems on FreeBSD. I see that OpenBSD has a port, so I was hoping to maybe... port over the port :D.

ChefDeLaSauce commented 4 years ago

I was able to compile the mojoshader library. Fnaify runs and sets up the exe! However, when I try to run I get this error that I did not expect to see:

`SDL2 was not found! Do you have fnalibs? 21:01:27 | Error | System.TypeInitializationException: The type initializer for 'Microsoft.Xna.Framework.FNAPlatform' threw an exception. ---> System.DllNotFoundException: libs/lib64/libSDL2-2.0.so at Microsoft.Xna.Framework.SDL2_FNAPlatform.ProgramInit (Microsoft.Xna.Framework.LaunchParameters args) [0x0001b] in :0 at Microsoft.Xna.Framework.FNAPlatform..cctor () [0x003f3] in :0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr) at Microsoft.Xna.Framework.Game..ctor () [0x000cd] in :0 at ClassicUO.GameController..ctor () [0x00018] in :0 at ClassicUO.Client.Run () [0x0000a] in :0 at ClassicUO.Bootstrap.Main (System.String[] args) [0x001b2] in :0 exception inside UnhandledException handler: RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Microsoft.Xna.Framework.FNAPlatform' threw an exception. ---> System.DllNotFoundException: libs/lib64/libSDL2-2.0.so at Microsoft.Xna.Framework.SDL2_FNAPlatform.ProgramInit (Microsoft.Xna.Framework.LaunchParameters args) [0x0001b] in :0 at Microsoft.Xna.Framework.FNAPlatform..cctor () [0x003f3] in :0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr) at Microsoft.Xna.Framework.Game..ctor () [0x000cd] in :0 at ClassicUO.GameController..ctor () [0x00018] in :0 at ClassicUO.Client.Run () [0x0000a] in :0 at ClassicUO.Bootstrap.Main (System.String[] args) [0x001b2] in :0`

Why is it having trouble finding SDL2? I most certainly have it installed.

rfht commented 4 years ago

you may want to look at OpenBSD port for mojoshader for inspiration https://github.com/openbsd/ports/tree/master/graphics/mojoshader

It looks like your program is looking for SDL2 in a subdirectory: libs/lib64/libSDL2-2.0.so

You could try the following:

ChefDeLaSauce commented 4 years ago

OK, that worked, but now I am getting an error with my libmojoshader.so.

To fix the SDL issue, I created a sym link in the libs/lib64 folder as libSDL2-2.0.so -> /usr/local/lib/libSDL2.so

In the libs/lib64 folder I have my compiled libmojoshader.so file.

In the launcher, I added a library path to be explicit, although this might be unnecessary.

LD_LIBRARY_PATH=/usr/local/lib:/home/brian/games/classicuo/libs/lib64

When I try to launch now, I get:

| Error | System.DllNotFoundException: libs/lib64/libmojoshader.so at (wrapper managed-to-native) MojoShader.INTERNAL_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,intptr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,intptr) at MojoShader.MOJOSHADER_glBestProfile (MojoShader+MOJOSHADER_glGetProcAddress lookup, System.IntPtr lookup_d, MojoShader+MOJOSHADER_malloc m, MojoShader+MOJOSHADER_free f, System.IntPtr malloc_d) [0x00000] in :0 at Microsoft.Xna.Framework.Graphics.OpenGLDevice..ctor (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x00326] in :0 at Microsoft.Xna.Framework.SDL2_FNAPlatform.CreateGLDevice (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00100] in :0 at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x000a4] in :0 at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x000d5] in :0 at Microsoft.Xna.Framework.Game.DoInitialize () [0x0002e] in :0 at Microsoft.Xna.Framework.Game.Run () [0x0000e] in :0 at ClassicUO.Client.Run () [0x00034] in :0 at ClassicUO.Bootstrap.Main (System.String[] args) [0x001b2] in :0 exception inside UnhandledException handler: RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.

[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libs/lib64/libmojoshader.so at (wrapper managed-to-native) MojoShader.INTERNAL_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,intptr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,intptr) at MojoShader.MOJOSHADER_glBestProfile (MojoShader+MOJOSHADER_glGetProcAddress lookup, System.IntPtr lookup_d, MojoShader+MOJOSHADER_malloc m, MojoShader+MOJOSHADER_free f, System.IntPtr malloc_d) [0x00000] in :0 at Microsoft.Xna.Framework.Graphics.OpenGLDevice..ctor (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x00326] in :0 at Microsoft.Xna.Framework.SDL2_FNAPlatform.CreateGLDevice (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00100] in :0 at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x000a4] in :0 at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x000d5] in :0 at Microsoft.Xna.Framework.Game.DoInitialize () [0x0002e] in :0 at Microsoft.Xna.Framework.Game.Run () [0x0000e] in :0 at ClassicUO.Client.Run () [0x00034] in :0 at ClassicUO.Bootstrap.Main (System.String[] args) [0x001b2] in :0

System.DllNotFoundException: libs/lib64/libmojoshader.so is confusing me, because it has been placed directly where it should be found.

rfht commented 4 years ago

Is there any *.config file in the game's directory? Try removing those and see what happens.