This topic is intended to gather the experiences, bugs and workarounds about "porting" Duality games to Linux. The word porting is in quotation marks, because to a point, Duality projects just run on Linux machines. Because of these issues are often hardware or distribution dependent, please provide the details regards your system. This topic is not about compiling the source, or using Dualitor on Linux, that's a much more difficult task, yet to be accomplished.
There's already
GitHub issue on the topic. However, in my opinion, it's aimed more at the Duality Core developers, rather then the users, who just want their games to run on multiple platforms. Many stuff stated here can be probably applied to OS X as well, but I don't have a Mac and could not test it.
How to run a game on Linux?Because of Duality Core is based on PCLs (Portable Class Libraries), it "just" runs using the open source implementation of .Net:
mono. More information about Duality being portable can be found
here. So export the project on Windows, as you usually do, move it to the Linux machine, on which mono is installed. Then run the game by typing
mono DualityLauncher.exe in the terminal.
Personal experienceI've tested multiple games on my machine, which is a
Quote:
distro: Linux Mint Cinnamon 18 64 bit
mono runtime: Mono JIT compiler version 4.6.1 (Stable 4.6.1.5/ef43c15 Wed Oct 12 09:10:37 UTC 2016)
hardware: i5 5200U, Intel HD graphics 5500
The projects were two of my games, and the UI plugin demonstration project by SirePi. Performance issues only rised with my tilemap jam entry, I don't know if it's due to the excessive shader work used in it, or due to the poor graphics driver support on this OS. Or it's just the hardware, intel HD graphics is not the most powerful solution I've ever heard of.
On the other hand, I encountered 4 problems, 2 of which I could solve, and the other two being somewhat lightweight. The following two lists contains them. If we (the community) gather more experience with that, these lists should expand.
Resolved issues- Custom shaders won't compile. It throws an error message, and objects with that shader doesn't display correctly. The error message is something like this:
Code:
[Core] ERR: Error loading Shader Data\Tileset\Shader\psy_frag:
BackendException: Fragment Compiler error:
0:21(43): error: could not implicitly convert operands to arithmetic operator
0:21(22): error: no matching function for call to `texture2D(sampler2D, error)'; candidates are:
0:21(22): error: vec4 texture2D(sampler2D, vec2)
0:21(22): error: vec4 texture2D(sampler2D, vec2)
0:21(22): error: vec4 texture2D(sampler2D, vec2, float)
0:21(22): error: type mismatch
0:33(68): error: could not implicitly convert operands to arithmetic operator
0:33(23): error: no matching function for call to `mix(vec3, vec3, error)'; candidates are:
0:33(23): error: float mix(float, float, float)
0:33(23): error: vec3 mix(vec3, vec3, float)
0:33(23): error: float mix(float, float, float)
0:33(23): error: vec2 mix(vec2, vec2, float)
0:33(23): error: vec3 mix(vec3, vec3, float)
0:33(23): error: vec4 mix(vec4, vec4, float)
0:33(23): error: vec2 mix(vec2, vec2, vec2)
0:33(23): error: vec3 mix(vec3, vec3, vec3)
0:33(23): error: vec4 mix(vec4, vec4, vec4)
0:33(17): error: cannot construct `vec4' from a non-numeric data type
CallStack:
at Duality.Backend.DefaultOpenTK.NativeShaderPart.Duality.Backend.INativeShaderPart.LoadSource (System.String sourceCode, Duality.Resources.ShaderType type) [0x00078] in <bedf93fa4a6e43ddab3010b087c4ddbc>:0
at Duality.Resources.AbstractShader.Compile () [0x00042] in <e6f0eed97a4541d0a3a8be117f1253a7>:0
[Core] ERR: Error loading ShaderProgram Data\Tileset\Shader\Psy_ShaderProg:
BackendException: Linker error:
error: linking with uncompiled shader
Resolution: It's because my system does not support GLSL above version 1.3. Placing #pragma version 130 in the beginning of every custom shader file should resolve this. - Audio backend won't load. Log:
Code:
[Core] ERR: Failed: DllNotFoundException: openal32.dll
CallStack:
at OpenTK.Audio.AudioContext.CreateContext (System.String device, System.Int32 freq, System.Int32 refresh, System.Boolean sync, System.Boolean enableEfx, OpenTK.Audio.AudioContext+MaxAuxiliarySends efxAuxiliarySends) [0x00007] in <f5bb11938a8f4ed288c4c7c2109e4782>:0
at OpenTK.Audio.AudioContext..ctor (System.String device, System.Int32 freq, System.Int32 refresh, System.Boolean sync, System.Boolean enableEfx, OpenTK.Audio.AudioContext+MaxAuxiliarySends efxMaxAuxSends) [0x00006] in <f5bb11938a8f4ed288c4c7c2109e4782>:0
at OpenTK.Audio.AudioContext..ctor () [0x00000] in <f5bb11938a8f4ed288c4c7c2109e4782>:0
at Duality.Backend.DefaultOpenTK.AudioBackend.Duality.Backend.IDualityBackend.Init () [0x0005f] in <bedf93fa4a6e43ddab3010b087c4ddbc>:0
at Duality.DualityApp.InitBackend[T] (T& target, System.Func`2[T,TResult] typeFinder) [0x0028b] in <e6f0eed97a4541d0a3a8be117f1253a7>:0
Resolution: Don't delete any .dll.config files. OpenTK.dll.config should not be missing from your export.
Unresolved issues