Adam's Lair Forum

game development and casual madness
It is currently 2017/04/25, 12:25

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 2016/11/11, 20:07 
Veteran Member
Veteran Member
User avatar

Joined: 2016/01/10, 10:56
Posts: 144
Location: Budapest
Role: Hobbyist
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 experience
I'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
  • The process does not close after quitting Duality. Although everything seems to be in order in the log ([Core] Msg: DualityApp terminated, etc.), mono does not close, thus the terminal instance you started Duality from have to be force closed. This problem rised with every project, every time, unless the audio backend was not loaded (because of the former issue). I suspect it has to do something with OpenAL.
  • The second unresolved issue rised only with MoonRogue, which has a online highscore system. It loaded the highscores all right, but logged an error message in the meanwhile. I'm not sure if this has to do anything with Duality, but I share the problem.
    Log:
    Code:
    [Core] ERR:   Can't resolve Member 'M:System.Net.Http.HttpClientHandler:GetRequestStreamCallback(System.IAsyncResult)' in object Id 545141794. Member not found.
    [Core] ERR:   Can't resolve Member 'M:System.Net.Http.HttpClientHandler:GetResponseCallback(System.IAsyncResult)' in object Id 2942661240. Member not found.
    [Core] ERR:   Can't resolve Member 'M:System.Net.Http.HttpClientHandler:StartRequest(System.Object)' in object Id 2192466486. Member not found.


Top
 Profile  
 
PostPosted: 2016/11/11, 20:25 
Forum Adept
Forum Adept

Joined: 2015/07/08, 16:41
Posts: 414
Role: Gamer
Hmm, it seems running Duality on Linux is much less painful than I originally thought. Mostly small kinks and bugs to work out, from the look of it.

Nice write-up, good work!

About shader compilation: it might be due to the Intel graphics device. I'm not sure about driver support on Linux, but Intel integrated GPUs aren't exactly known for having the best technology support overall. EDIT: Oh, you mentioned that. Never mind, carry on.


Top
 Profile  
 
PostPosted: 2016/11/12, 00:34 
Forum Adept
Forum Adept

Joined: 2014/12/13, 00:11
Posts: 397
Location: Brazil
Role: Gamer
When I also tested it in my crappy netbook (which is now a server), I got a few issues too.

  • Mouse kept stuck inside the game window, but it should be due to the window manager I was using at that time, which was i3.
  • DualStickSpaceShooter sample didn't run, don't know why, probably because my netbook is shitty.

_________________
I only know the basics of C#. I have no advanced knowledge.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group