Author Topic: AGS engine Linux port  (Read 115581 times)

Re: AGS engine Linux port
« Reply #660 on: 25 May 2018, 23:11 »
until latest 3.4.0 the engine does run well under Wine. Since 3.4.1, the engine doesn't run well under Wine- sometimes it crashes and require you to kill it (you can use xkill) - but the Linux build should run. It's available in the release of the Editor. If you use Ubuntu, building either the latest stable engine or the sdl2 port (still in development) should be easy. I've been thinking about packaging it as snap, if you think it's useful, let me know.

Edit: I started by going after the editor first, once it works, I will give a shot at the engine. github repo for ags-editor snap here.

github repo for ags-engine snap here

all snaps are still in development, but once they are solved, people with Debian derivatives will be able to snap install ahs-editor and snap install ags .
« Last Edit: 28 May 2018, 03:39 by eri0o »

thedaemon

  • artist
Re: AGS engine Linux port
« Reply #661 on: 29 May 2018, 17:38 »
I tried the Snap you built but was unable to get it to run, after reading the code I found out it was just using Wine and was pointless for me to use since I already am using AGS with Wine. I was hoping it was the native Linux port.

Why is there not a pre-built Linux build? Why do I have to compile it myself? Just curious, I will try to compile and share a package with others since there isn't a package. Cheers.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Linux port
« Reply #662 on: 29 May 2018, 18:04 »
Why is there not a pre-built Linux build? Why do I have to compile it myself? Just curious, I will try to compile and share a package with others since there isn't a package. Cheers.

There is a package we make for the Editor to be able to deploy Linux builds of the game automatically. Such package is linked in every release thread, for example this: http://www.adventuregamestudio.co.uk/releases/finals/AGS-3.4.1-P2/AGS.3.4.1.13.Editor.Linux.Pack.zip
It may also be used to run any game. There is no guarantee that it runs on every Linux system, of course, but it should run on "common" ones, such as Ubuntu and Debian.

Alternatively, we could attach such package to the release tag in the repository, under better name (to make it clear what it is), it's just that no one asked us to do so, at least in my memory.

I've been told before, that in Linux community there should be a program "package maintainer" who makes and updates package for particular Linux system, and who is not necessarily a part of core development team.
For instance, I know that github user rofl0r is making AGS engine packages for "Sabotage Linix" system. On his request I am adding an archive with related source code for each stable release, which may be seen here for example: https://github.com/adventuregamestudio/ags/releases/tag/v.3.4.1.13
« Last Edit: 29 May 2018, 18:07 by Crimson Wizard »

thedaemon

  • artist
Re: AGS engine Linux port
« Reply #663 on: 29 May 2018, 19:52 »
Thank you for your reply. I will look into maintaining a Debian package.

From my understanding of your reply, and lack of access to Linux right now(I will check in a few hours), there is no native build of the Editor for Linux, just an export package for the editor to build for Linux?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Linux port
« Reply #664 on: 29 May 2018, 20:07 »
From my understanding of your reply, and lack of access to Linux right now(I will check in a few hours), there is no native build of the Editor for Linux, just an export package for the editor to build for Linux?

Right, there is no native build for the Editor. It is written in C#, which means to run on Linux it has to be ported to Mono (or rewritten completely, for what is worth).
There is an issue ticket opened regarding former: https://github.com/adventuregamestudio/ags/issues/442
« Last Edit: 29 May 2018, 20:09 by Crimson Wizard »

thedaemon

  • artist
Re: AGS engine Linux port
« Reply #665 on: 29 May 2018, 21:23 »
Thanks again for your timely reply. Above and beyond :)
I don't have the skill to port to another language at this time.. but subscribed to the thread.
I will continue to run via Wine. So far 3.41 has ran flawlessly this way!

Re: AGS engine Linux port
« Reply #666 on: 30 May 2018, 01:05 »
wait, both snaps are work in progress! I think I wasn't clear when I wrote. I am currently having some trouble with lxd on my computer (which I need to snap wine in a reproducible manner), once I finish this, there will be a release (in Github->Release) and also on the snap store. But yes, it's the same as wine, the idea was just to make it easier to install. I just post work in progress with the hope that someone will find/solve the problem for me :-D.

thedaemon

  • artist
Re: AGS engine Linux port
« Reply #667 on: 30 May 2018, 02:11 »
I did spend a good 30 minutes trying to fix it. It was not running the extension installations. It also worked half way with sudo and the other half with my user. I think it conflicts with user permissions because the files are installed with root? I'll try again later.

Radiant

  • AGS Baker
  • Mittens Knight
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
Re: AGS engine Linux port
« Reply #668 on: 18 Jul 2018, 18:43 »
A player reports garbled sound on the Linux build, with the following system specs:

OS: Ubuntu 18.04
CPU: Intel(R) Core(TM) i7-7700 @ 3.60GHz
RAM: 32 GB
GPU: GeForce GTX 1060 6GB
NVIDIA driver: 396.24.02
Sound: I'm using the HDMI port from the graphics card: GP 106 High Definition Audio Controller

Does this sound familiar to anyone? Can someone give me an idea what could fix this please?

Re: AGS engine Linux port
« Reply #669 on: 18 Jul 2018, 20:54 »

Re: AGS engine Linux port
« Reply #670 on: 20 Sep 2018, 06:17 »
I'm new to AGS. Just bought Lamplight City which uses it last week. I was disappointed with the performance running fullscreen; it sounds like I've run into what you guys call the "scaling problem"?

Anyway, this inspired me to try and get AGS' OpenGL renderer working on Linux. I don't have previous OpenGL experience but was able to crib from enough tutorials to get it working in windowed mode.

Code is at https://github.com/toojays/ags/tree/ags3+linux-opengl , see the commit message at https://github.com/toojays/ags/commit/4ae20e7317241fe3b1435ccd0652956dfca38c88 for more detail.

I've only tested it with one game (Lamplight City) on one system (Ubuntu 18.04, Intel graphics) so far. Fullscreen mode isn't working yet. Somewhere in AGS the system tries to resolve the game's 640x400 against my PC's 1920x1080 and comes up with 1728x1080 (game res * 2.7). I fail to set this as a fullscreen mode and AGS falls back to windowed mode. I guess the driver is supposed to realize the system won't do 1728x1080 and ask the windowing system for 1920x1080? Does anyone know?

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: AGS engine Linux port
« Reply #671 on: 20 Sep 2018, 10:32 »
Anyway, this inspired me to try and get AGS' OpenGL renderer working on Linux. I don't have previous OpenGL experience but was able to crib from enough tutorials to get it working in windowed mode.

Code is at https://github.com/toojays/ags/tree/ags3+linux-opengl , see the commit message at https://github.com/toojays/ags/commit/4ae20e7317241fe3b1435ccd0652956dfca38c88 for more detail.

I've only tested it with one game (Lamplight City) on one system (Ubuntu 18.04, Intel graphics) so far. Fullscreen mode isn't working yet. Somewhere in AGS the system tries to resolve the game's 640x400 against my PC's 1920x1080 and comes up with 1728x1080 (game res * 2.7). I fail to set this as a fullscreen mode and AGS falls back to windowed mode. I guess the driver is supposed to realize the system won't do 1728x1080 and ask the windowing system for 1920x1080? Does anyone know?

Hello, toojays. It's really nice to see someone tried doing this. I kept hoping to look into this myself but never found a moment to research the OpenGL working on Linux (also, there was ongoing Nick Sonneveld's SDL port attempt, but it seems to get delayed again).

Can't answer to the fullscreen problem right away, this is something to investigate. I may mention one thing though (and also the main reason that was stopping me). Since OpenGL does not support "dedicated fullscreen mode" on Windows I had to emulate fullscreen mode (probably this is how everyone do this) by switching desktop resolution. This is not done in ali3dogl.cpp itself, but in the "platform driver" class. You may find calls to "platform->EnterFullscreenMode", "platform->AdjustWindowStyleForFullscreen" and "platform->ExitFullscreenMode" in OpenGL renderer. The implementation for Windows is located in acplwin.cpp. But I honestly do not know if we should follow same procedure for Linux or not (also don't know X11 very well, I wrote literally couple of functions using it before).

Am I right that you are using "glew" library, that helps to bind function pointers to dynamically loaded OpenGL object? OpenGL renderer was originally written in such a way that on Windows we manually getting function addresses, and that would be actually a nice thing to get glew used on Windows eventually too (not sure why I never tried, maybe was worried to break something that was already working).

I have a proposal, since this forum thread is too long already and contains all kinds of various discussions, could we continue on github instead, by opening an issue ticket in our repository? I believe that would be more convenient especially since you already have account and some code in progress there.
« Last Edit: 20 Sep 2018, 10:42 by Crimson Wizard »

Re: AGS engine Linux port
« Reply #672 on: 20 Sep 2018, 11:26 »
Hello, toojays. It's really nice to see someone tried doing this. I kept hoping to look into this myself but never found a moment to research the OpenGL working on Linux (also, there was ongoing Nick Sonneveld's SDL port attempt, but it seems to get delayed again).

Can't answer to the fullscreen problem right away, this is something to investigate. I may mention one thing though (and also the main reason that was stopping me). Since OpenGL does not support "dedicated fullscreen mode" on Windows I had to emulate fullscreen mode (probably this is how everyone do this) by switching desktop resolution. This is not done in ali3dogl.cpp itself, but in the "platform driver" class. You may find calls to "platform->EnterFullscreenMode", "platform->AdjustWindowStyleForFullscreen" and "platform->ExitFullscreenMode" in OpenGL renderer. The implementation for Windows is located in acplwin.cpp. But I honestly do not know if we should follow same procedure for Linux or not (also don't know X11 very well, I wrote literally couple of functions using it before).

Am I right that you are using "glew" library, that helps to bind function pointers to dynamically loaded OpenGL object? OpenGL renderer was originally written in such a way that on Windows we manually getting function addresses, and that would be actually a nice thing to get glew used on Windows eventually too (not sure why I never tried, maybe was worried to break something that was already working).

I have a proposal, since this forum thread is too long already and contains all kinds of various discussions, could we continue on github instead, by opening an issue ticket in our repository? I believe that would be more convenient especially since you already have account and some code in progress there.

Thanks for your response about how you did fullscreen on Windows, I'll do some investigation along those lines.

Yes, I used GLEW. It was a bit annoying to figure out how to get it working, because I didn't see any official documentation saying that you need to set a current GL context before you initialize GLEW. But once you get it set up, it sure is nicer than having an explicit lookup for every single call you want to make.

I've opened https://github.com/adventuregamestudio/ags/issues/510 to continue discussion of OpenGL on Linux.