[OLD-1] AGS engine Linux port

Started by BigMc, Sun 03/06/2012 19:04:20

Previous topic - Next topic

Nachtvlinder

Quote from: s_d on Tue 18/03/2014 05:32:28
Quote from: JanetC on Sat 08/02/2014 02:57:27
Quote from: scottchiefbaker on Fri 17/01/2014 19:17:04
Our other option is to have detailed build instructions for lots of different platforms, and WadjetEye can just provide the game data files. BYOE style.

Not for a commercial game - that would be fine for freeware. People already do that by buying the PC version and compiling the Linux runtime for their platform.

Janet, I'm working on a VM "appliance" that could be used to produce builds for the two architectures, with scripts to produce packaging (one "tar.gz" archive, one Mojosetup installer).  Some hand-massaging would be necessary of course as it would be producing generic builds, and Mojosetup installers need some customization (game name & file names, images, etc).  When it nears readiness, I'll share it with everyone.

There's one thing I really don't understand. Why are things done in such a complicated way? Why not use the package system?
The game author would only need to provide a package containing their game and make it dependent of ags. If they provide one rpm, one deb and one tar.gz, any Linux user could use it. The only thing needed for that would be setting up a few repositories for ags. I think you would need one for debian based systems. I'm not familiar with rpm, but I presume you could do the same for rpm. And anyone not using a mainstream distribution should have little problems compiling their own package.

I'm using Arch myself nowadays. And there it already works. :) This is the package for KQ1 for example:
https://aur.archlinux.org/packages/kq1vga/
It just downloads the original Windows files, adds an icon, a menu entry and uses ags to run the game.
May all go well for you,

Martin

BigMc

Quote from: Nachtvlinder on Sun 06/04/2014 11:32:03
There's one thing I really don't understand. Why are things done in such a complicated way? Why not use the package system?

Because AGS is currently not stable enough to rely on a binary that is controlled by someone else. If you do a commercial release of an AGS game it's good to have control over the engine to be able to fix bugs.

bgordebak

I would really like it if I could embed the engine into the resulting binary. On either Linux or Windows. That would make a standalone game executable.

If the engine wouldn't embed it, I'd like to be able to do something like:
Code: ags
cat ags game.exe > standalonegame


I don't know if it's too hard to implement though.

Crimson Wizard

#523
There were experimental Editor versions with "build for linux" support:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=50421.0

Frankly I haven't tested how it works, but I think it is generally possible.
IIRC you need to select build target in the Editor Preferences.

This
Code: bash

cat ags game.exe > standalonegame

won't work well, because the game data is seached by certain offsets inside big file. You would need to extract a stand-alone game data first, and append that to linux executable.

EDIT: fixed the link.

bgordebak

Thanks. Not a big issue.

Crimson Wizard

#525
Regarding cutting the game data from Windows exe, I explained how to do that manually here:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=46152.msg636445497#msg636445497
and here:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=44768.msg636469632#msg636469632

I guess someone will eventually add this feature to the Editor.

bgordebak

Quote from: Crimson Wizard on Fri 15/08/2014 11:06:56
There were experimental Editor versions with "build for linux" support:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=50421.0

I tried this and mostly works except small issues. It puts the game, 32-bit and 64-bit engines in a folder, and creates an executable script which runs the game according to the architecture. It can be a good way to deploy the game for linux.

Gord10

I have a question. I compiled my own version of AGS in Linux by make --directory=Engine. The ags engine file I obtained has very poor performance, sounds are jittered and framerate is low. I also tried Wine for Self, I could make it work flawless, so I know that it's not because my virtual machine is too low. Do I need to use debian/make_ags+libraries.sh for an engine with good performance? (I failed to compile by debian/make_ags+libraries.sh).
Games are art!
My horror game, Self

Crimson Wizard

Quote from: Gord10 on Sat 01/11/2014 19:36:11
I have a question. I compiled my own version of AGS in Linux by make --directory=Engine. The ags engine file I obtained has very poor performance, sounds are jittered and framerate is low. I also tried Wine for Self, I could make it work flawless, so I know that it's not because my virtual machine is too low.
I have the same on my Ubuntu virtual machine, but since no one real Linux user reported this, I was too lazy to investigate :tongue:.

BigMc

#529
The engine is the same whether built as a Debian package or not. I also have jittered sound since a few months, but since I have a somewhat exotic sound card and nobody else reported it, and my initial attempts to investigate failed, ...

Edit: Oh you asked about debian/make_ags+libraries.sh... That engine would maybe have some different library versions but even if that works better, it should work with what you have.

Gord10

That's bad news. So I guess I should wait for that problem be resolved before I publish Linux version of Self, if that's a common problem. I really don't want to publish something works worse than Wine.
Games are art!
My horror game, Self

Gord10

Guys, I found something strange in Linux port. It doesn't read acsetup.cfg file for audio (and maybe for nothing else). I have set Digital Sound as No Digital Sound. But when I runned ags, there was still the jitterish sound.

Why is it important? Because in Wine, I get the jitterish sound with Default DirectSound Device, which is the default value. Everything turns normal when it's set as DirectSound (Hardware Mixer). Obviosuly, ags can't understand that we want to use DirectSound (Hardware Mixer). I think the performance problem will resolve if ags can read acsetup.cfg.
Games are art!
My horror game, Self

BigMc

I don't think so. Some things in acsetup.cfg only make sense on Windows so they're not read on Linux. DirectSound is a Windows thing. It has worked before, so some change in the sound code must have caused this bug.

Crimson Wizard

#533
There's no "DirectSound" on Linux... it's a Microsoft thing (a part of DirectX).

Linux port does NOT read the sound options set by winsetup. Instead, it reads following audio options from cfg:
"digiid" - an index of digital sound driver;
"midiid" - an index of midi sound driver;
You have to write these manually.

E: Strangely, this is not mentioned in the readme.md. OTOH we do not have that much explanation for the contents of acsetup.cfg at all :tongue:

The only values for digiid and midiid I know
0 - no sound
-1 - auto-detect

Others are defined in Allegro as:

DIGI_OSS - 1330860868
DIGI_ESD - 1163084868
DIGI_ARTS - 1095914579
DIGI_SGIAL = 1397180737
DIGI_ALSA = 1095521089
DIGI_JACK = 1245791051

MIDI_OSS - 1330860877
MIDI_ALSA = 1095584068

The only name I recognize there is ALSA :).

Quote from: BigMc on Tue 04/11/2014 22:27:38
It has worked before, so some change in the sound code must have caused this bug.
I believe multiple users build AGS from the latest commits, so if this was a general issue, it would be reported already.
As I told before, I have this problem on virtual machine with Ubuntu too, from the very beginning, but, as Linux is not my forte, I decided to ignore that for the time being.
I might look into this, since this causes trouble. But I would like to know too, if other people have these problems on Linux.

BigMc

#534
This is the most stupid thing I've ever seen to encode these Ids like that...

They are for ALSA: 1095521089
and OSSD: 1330860868

EDIT: Ok, you've also computed them in the meantime. ALSA and OSS digital are the only ones worth trying though. I think the others are disabled in Allegro by default nowadays.

EDIT2: I get jittered sound with both. I don't know if that actually causes the engine to use OSS though.

Crimson Wizard

#535
The "autodetect" on my Ubuntu selects ALSA.
I know that because I have an IO error message from ALSA lib every time I exit the game. :-\

UPD: For the sake of experiment, I downloaded a free Linux game called "Pingus". And the sound works well there...

BigMc

It should always be ALSA unless it was changed in the Allegro config file. But getting an ALSA message doesn't prove it's not using OSS: On Linux OSS uses ALSA nowadays. It's just an API that exist across Unixes as opposed to ALSA which is Linux only.

Crimson Wizard

This is so funny.

I ran with "no sound" once. Then run with "autodetect" again. And it worked! :shocked: No jittering, perfect sound.
E: Next time it has jittering again :(.
Something's fishy going on here.

BigMc

I just installed alex4 from the official repos. It uses allegro 4 and also has broken sound. Can you confirm that?

Gord10

Quote from: Crimson Wizard on Tue 04/11/2014 23:40:43
This is so funny.

I ran with "no sound" once. Then run with "autodetect" again. And it worked! :shocked: No jittering, perfect sound.
E: Next time it has jittering again :(.
Something's fishy going on here.
I have just tried that, it was jittering again.
Games are art!
My horror game, Self

SMF spam blocked by CleanTalk