r/linux • • Mar 01 '12

I believe that for Linux to really conquer private desktops, pretty much all that is left to do is to accomodate game developers.

Recently there was a thread about DirectX vs. OpenGL and if I remember correctly...Open GLs biggest flaw is its documentation whereas DirectX makes it very easy for developers.

I cannot see any other serious disadvantage of Linux which would keep people using windows (even though win7 is actually a decent OS)

Would you agree that a good Open GL documentation could make the great shift happen?

470 Upvotes

438 comments sorted by

View all comments

270

u/wadcann Mar 01 '12 edited Mar 02 '12

Linux is a huge pain for game developers, but it's not really a DX/OGL matter.

There are plenty of OGL docs out there, and I'm sure that you can find reasonable, up-to-date OGL stuff, just as you can find out-of-date DX docs.

OGL does make a developer query for a set of extensions and theoretically support some pretty arbitrary sets of extensions. DX says "You have to support all of extensions X, Y, and Z if you want to be DX version x compliant". OGL thus makes it easier for a card vendor to get a new feature out. DX makes it easier for a game developer to rely on a feature being present.

But as I said, I really don't think that those two APIs are the bulk of the issue with Linux games. I've posted about some of these concerns before.

For open-source volunteer games, I'd say that Linux does more-or-less okay. I can't think of many important open-source games that are out for Windows but not Linux.

However, when it comes to commercial, closed-source games, Windows wallops Linux. A few factors:

  • Linux has fewer than a tenth the number of potential game purchasers.
  • Linux binary compatibility is not very good. Source-level compatibility is pretty good, and there are always people willing to fix any source incompatibility that comes up. Keeping binaries running is a pain.
  • The many Linux distros make testing and supporting a game a pain. The distro maintainers and users aren't going to do it for you as they do for open-source free games.
  • Packaging systems vary and are often aimed more at one big distro-controlled open-source repo than third-party binary-only vendors.
  • Library licenses often are not super-friendly to closed-source apps.

While this isn't a closed/open issue, as others have mentioned, the state of 3d drivers is such that a game vendor can't really take a typical existing Windows game and just expect it to run on an arbitrary Linux box with a 3d card. I won't use closed drivers, so I use the open-source Radeon drivers. My mother might be fine with using the closed Nvidia drivers, but she doesn't know what an Nvidia GPU is; it can hardly be put on a reasonable system requirements list.

If Linux had a nice little environment that guaranteed binary compatibility, had a standard UI on it, had libraries that wouldn't create any objectionable issues for closed-source software, had a standard way to obtain and package binary-only software, had some more Joe Sixpack users (to drive up potential returns)...and maybe threw a little more frosting on the cake by letting the games run in a sandbox, so that the user wouldn't have to worry about games they install breaking things or not uninstalling cleanly, I suspect that Linux could do quite well as a closed-source game platform.

In fact, I know it could, because Android is doing exactly that on Linux today, and is doing quite well.

The question is a matter of finding someone who wants to go make a system that provides good backwards compatibility with binary-only software, sandboxes, is easy to use, has a single packaging system, and so forth...and it's not clear that anyone really wants to work on a system like that. I think that a lot of open-source developers on Linux are irked about dealing with closed-source elsewhere and don't really want to spend a long time trying to encourage closed-source development.

The down side of that, of course, is that nobody seems to have successfully made AAA-style games viable as open-source projects. Art and other assets are a huge sticking point. For some reason, the huge amount of effort that a lot of hackers have put in on other large, successful open-source projects doesn't seem to show up for games. Open-source developers usually want to work on things that they themselves can play and enjoy, and story-based games don't do that well (unlike heavily-procedural games like roguelikes). I like The Battle for Wesnoth, but it's no Crysis or whatever it is that the kids are playing these days.

Desura tried to solve a few of these (though my gosh, that thing has an astonishingly flaky client). At least the packaging/distribution issue, partly. If you don't mind tying your purchases to Ubuntu, there's also the Ubuntu Software Center. EDIT: Sincere apologies to the Gameolith folks for excluding their own Linux packaging/purchasing/distribution system; this was not intentional.

So your real problem is either (1) getting a bunch of developers to make a closed-source-friendly environment on Linux (other than Android, which I assume you don't want), or (2) figuring out how to make AAA-class game development work with open source, either via (2a) making open source games commercially-viable or (2b) figuring out how to get groups of volunteers successfully doing AAA-class games.

40

u/chippey Mar 02 '12

I think you're doing a bit of a disservice making it seem like Linux is some hostile place for commercial software development. It's much more just a market thing (imo) than Linux being anti-commercial software. In my field (vfx) there are quite a lot of commercial software that's out on Linux, some of which are from pretty large developers which are very, very corporate (i.e.: Autodesk).

Off the top of my head, here's a sample of closed commercial software that does great on Linux: Maya, Houdini, Softimage, PFTrack, Boujou, 3DEqualizer, Flame, Flint, Inferno, Smoke, Conform, Baselight, FilmMaster, DaVinci, Hiero, RV, Framecycler, Nuke, Naiad, Massive, Katana, Mari, Mudbox, PRMan, 3Delight, AIR, Arnold, VRay, MentalRay, Maxwell, Deadline, Qube, and many more. Pretty much all of them link to many different open source libraries, and have no problem doing so.

So I think that your assertion that developing commercial software for Linux is so hostile is rather false. (Some of these packages have very old versions which will still run on today's distribution without any binary incompatibilities. Some external libraries may mismatch and need to be sorted out, yes, but the binaries themselves are still perfectly runnable).

At the end, I think it's mostly just that the gamer market share for Linux games is so tiny compared to the other game markets that's the reason big aren't made to run on Linux.

13

u/wadcann Mar 02 '12

And there are still binaries that do run without problems (or limited problems; sound is probably an issue for almost all old games). I think that all of Illwinter's old releases still run, for example β€” Conquest of Elysium II, Dominions: Priests, Prophets and Pretenders, Dominions II: The Ascension Wars, and Dominions 3: The Awakening.

However, the second link I provided was to a thread on Reddit from three weeks ago where I sat down and tried to run most of the old Linux binary-only games I had sitting around. A large number of games simply did not work. And while I can get some running (and have written libraries to patch problems with the binaries, and provided people online with instructions to get around other issues) most users are not going to reasonably get these running.

I'm not saying that all old Windows games run on Windows today, but the success rate is generally pretty darn good compared to Linux-native binaries.

I'll concede that the dominant issue may very easily be the size of the market.

6

u/[deleted] Mar 02 '12

I'm not saying that all old Windows games run on Windows today, but the success rate is generally pretty darn good compared to Linux-native binaries.

Define "old". Any software using any kind of 16-bit interface (even if the binary itself was compiled for 32-bit Windows) will fail on all versions of amd64 Windows. DOS games generally don't work on NT-based Windows (and if they do, there's no sound! (-:). On the other hand it's possible to run Windows 1.0 programs in 32-bit NT-based Windows, given that you rewrite the header so it looks like it is a Windows 2.0 binary, but if the program is trying to use anything but the most basic GDI it will also fail. You'll usually have some luck with Windows 3.* (assuming the game doesn't try to use DOS, which is unlikely), and more with Windows 95 games, providing they don't install some shitty VxD DRM and once again don't use any 16-bit interface.

On Linux, you can run ancient (native) binaries without modification if you enable a.out support in the kernel (I guess most distros will still have it enabled), and if sound is a problem, usually turning on OSS emulation in ALSA should do the trick (unless you have a new-ish HD audio card with no MIDI and the game is using MIDI for music). As for Windows binaries on Linux, Wine does a pretty good job emulating Windows 2.0/3.* (and, again, if you rewrite the header - 1.0), and you can still use all 16-bit interfaces even on amd64, so I guess for the oldest Windows games Linux with Wine might even do better than Windows 7 (or even XP), and obviously if you're running a 64-bit system. For pure DOS games you have DOSBox (or qemu+real DOS), though that's also available for Windows.

Also, things like LD_PRELOAD and LD_LIBRARY_PATH are very useful in getting older (dynamically linked) binaries to run, assuming - in the worst case - you can get your hands on the ancient library versions they were compiled against. Often newer versions of libraries will work, especially if it's the same major version number and the library still has the same ABI/API. I remember I was trying to get some old dictionary (ported to Linux by Loki (!)) to work and it was having trouble finding libc (I'm on amd64), but it was nothing a very simple wrapper script couldn't fix. I must read your post from three weeks ago and see how far I can get those to run.

As a side note, I tried a little experiment. I've found some disks of Windows 2.0 lying around and tried running some of the included apps on Windows 7 and Wine on Linux (32-bit Windows to make it easier, 64-bit Linux). None of the included apps even started on Windows 7, apart from one which crashed as soon as I moved my mouse over its window. On Linux, I set Windows version to 2.0 and, to my surprise, most of the apps worked (some would crash at some point, some wouldn't start).

I guess I might just be experienced with getting old software to run on new computers, I guess I could even work a job porting old software to new systems.

→ More replies (2)

3

u/chippey Mar 02 '12

I admit that I had not looked at the second link to the other reddit thread until now. I was going on my own experience running old software, most of which don't bother with sound at all. (It does seem that a some of the issues you were running into were library incompatibilities, not binary incompatibilities (which is not to say they get to be incredibly frustrating to deal with (libXp, looking at you)), they can at least mostly be solved with various (sometimes very time consuming) workarounds (which thankfully once are sorted out, can usually be automated with a shell script, and/or modified env/fs).).

Completely agreed though that most users are not going to go through that all to get ancient software running, unless someone gives them a simple packaged and ready-to-go work around. (That's awesome that you actually wrote some libraries to get some old games to run!)

(Here ends my abuse of parentheses; no I've never programmed in LISP :p ).

→ More replies (6)

20

u/redalastor Mar 02 '12

Linux is a huge pain for game developers, but it's not really a DX/OGL matter.

Quite right. As John Carmack pointed out, it's going to be abstracted under a game engine anyway.

0

u/[deleted] Mar 02 '12

[deleted] β€” view deleted comment

2

u/jabjoe Mar 03 '12

Yep. A lot of what is being said is by people without a clue about how games are made.

5

u/l00pee Mar 02 '12

What about a mini game os that runs in its own vm? I think the hardware has caught up to the overhead. If you could package the gaming platform for all oses you could install the same version of the game everywhere. We should write an open source, high performance gaming platform, which abstracts away most of the issues you mentioned to the host os. Game devs would certainly embrace a write once, run anywhere system if it was fast and solid.

13

u/tapo Mar 02 '12

This is more or less Native Client, which is enabled in Chrome/Chromium and can run games like Bastion cross-platform. It's BSD licensed.

2

u/wadcann Mar 02 '12

I have a kinda anti-Google bias here (otherwise, I'd use Android without a problem). I don't like worrying about what data is being gathered and sent back to home base, and gathering and monetizing data is Google's meat-and-potatoes. I've always avoided Chromium for this reason...I wouldn't mind paying a surcharge on commercial apps that use Google's software to fund that development, but I hate wondering what data exactly Google is gathering about me.

→ More replies (3)

9

u/wadcann Mar 02 '12

What about a mini game os that runs in its own vm?

Well, it worked for Flash, at any rate.

7

u/contriver Mar 02 '12

Except its 'vm' was horribly insecure and has a long history of running horribly on linux.

Your point is still quite valid though, that and being a ubiquitous video player made flash crushingly dominant.

4

u/[deleted] Mar 02 '12

Like Java? :-)

→ More replies (6)

3

u/jimethn Mar 02 '12

For some reason, the huge amount of effort that a lot of hackers have put in on other large, successful open-source projects doesn't seem to show up for games.

If I had to guess, I'd say that once someone has invested enough time to be capable of this, they're over games for the most part. Or to put it another way, the kind of person who develops this capability isn't the kind of person who spends a lot of time playing games.

2

u/wadcann Mar 02 '12

once someone has invested enough time to be capable of this, they're over games for the most part

ESR is a The Battle for Wesnoth contributor, though I certainly have wondered whether maybe playing games is an alternative to hacking on code.

4

u/rubygeek Mar 02 '12

Linux binary compatibility is not very good. Source-level compatibility is pretty good, and there are always people willing to fix any source incompatibility that comes up. Keeping binaries running is a pain.

This is not really true. Distribute binaries statically compiler against everything other than possibly glibc, and things will generally keep working.

I still have Loki ports from about a decade ago running on my machine.

Binary compatibility is not very good if you rely on non-standard components. If you do a little bit of research, it's soon pretty clear what API's you can trust.

→ More replies (1)

2

u/datenwolf Mar 02 '12

Linux binary compatibility is not very good. Source-level compatibility is pretty good, and there are always people willing to fix any source incompatibility that comes up. Keeping binaries running is a pain

This is simply not true. It's perfectly possible to build a binary for a given architecture only once and it will run on all distributions. This is how Blender is distributed:

Blender for Linux x86_32 http://www.blender.org/dl/http://download.blender.org/release/Blender2.62/blender-2.62-linux-glibc27-i686.tar.bz2

Blender for Linux x86_64 http://www.blender.org/dl/http://download.blender.org/release/Blender2.62/blender-2.62-linux-glibc27-x86_64.tar.bz2

9

u/wadcann Mar 02 '12 edited Mar 02 '12

This is simply not true. It's perfectly possible to build a binary for a given architecture only once and it will run on all distributions.

I was talking about over time, though distribution fragmentation is also an issue. But, okay, if you want to use Blender as an example, let's see how Blender compatibility has done over the years. I'll download the nine-year-old 1.73 release and try it on Debian squeeze x86_64. This is blender1.73_Linux_i386_libc5-static:

$ ./blender
zsh: no such file or directory: ./blender
$ strace ./blender
execve("./blender", ["./blender"], [/* 52 vars */]) = -1 ENOENT (No such file or directory)
dup(2)                                  = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f62d19dd000
lseek(3, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
close(3)                                = 0
munmap(0x7f62d19dd000, 4096)            = 0
exit_group(1)                           = ?
$ ldd blender
        linux-gate.so.1 =>  (0xf77b0000)
        libdl.so.1 => not found
        libc.so.5 => not found

To be fair, this version clearly wasn't fully-statically-linked, and the dynamic loader changed, plus that libc became obsolete...

Your real argument is, I would guess, that one can statically-link everything and avoid lib problems. That addresses missing libs, sure. It also:

  • Means that if the binary is using any LGPL-licensed libs (common; this includes things like GTK+) that the distributor must also make available the .o files used to build the binary. That leaks a lot of symbol data, and likely is something that a lot of closed-source developers don't want to provide.
  • Does not deal with all compatibility issues. Look in the link I provided where I run a bunch of older commercial Linux game binaries. Plenty of the static binaries simply do not work for one reason or another.

9

u/datenwolf Mar 02 '12 edited Mar 02 '12

There's no need to do this by linking statically. You can as well ship your particular version of the required .so files and use relative linkage paths for this. That way you also avoid any problems with the LGPL

Let me address a few of the issues you mentioned in that other post:

  • Rewrites of the graphics infrastructure (e.g. RandR, KMS)

This should not affect any end user program. RandR is mostly of concern for window managers and has no influence on binary compatibility.

KMS changes the way graphics subsystems work, but things like the client side of X11 are unaffected by it.

  • Complete replacement of init subsystem (e.g. upstart, systemd)

This does again not affect end user programs.

  • Complete replacement of audio subsystem (e.g. PulseAudio)

PulseAudio is a Linux propriatary mess and should die as soon as possible. It's a misguided approach on a problem that's better solved in the driver architecture, not through some audio daemon.

And I'm working hard on a real solution for this problem. I think, like so often, every subsystem needs to go through a few technological iterations, until it's good.

  • Complete replacement of hardware abstraction layer (e.g. deprecation of HAL)

Does not affect end user programs.

  • New messaging system (e.g. dbus)

You can use dbus, but you're not forced into using it… yet.

  • Extensive changes to user-level permissions handling (e.g. policykit, consolekit)

ConsoleKit has been deprecated.

PolicyKit is a solution in search for a problem IMHO. The issues addressed by PolicyKit, and also by ConsoleKit should in fact be dealt with kernel name space containers. PolicyKit and moreover ConsoleKit assume a cooperative security model, which simply doesn't work. It's trivial to break ConsoleKit through service denial to other users. BTDT (been there demonstrated that).

First thing I do after setting up a Linux box: Getting rid of ConsoleKit and PolicyKit, they do more harm than good.

  • Extensive UI changes (e.g. Unity, Gnome3)

Does not affect end user programs, after all those boil down to being the window manager to the programs.

  • Eventual move from X to Wayland

Hopefully not, because Wayland is a technology outdated on arrival. X11 needs to be replaced eventually, I agree with that. But I'd prefer something along the ideas of Display PostScript/PDF, though a little bit slimmed down though.

  • Migration from ext3 to ext4 (and later btrfs)

Does not affect any program. A program uses the POSIX file system interface and simply does not care about the used file system.

  • Possible filesystem hierarchy changes (e.g. /usr move)

Yes, this could cause some trouble. However I ask: Why would we actually change the hierarchy? It works very well and also makes sense, even if the naming would be reinterpreted:

/lib - system level libraries
/bin - programs everything and everybody uses
/sbin - super bin: Programs required by the system for privileged operations

/usr - stuff used by user initiated actions
/usr/bin - programs used by users
/usr/sbin - programs used by (privileged) superusers
/usr/lib - libraries used by user-used programs
/usr/share - data used by user-used processes

/var - system wide variadic data
/var/run - runtime data of a specific system wide processes 
/var/lib - persistent data of system wide processes
/var/log - logfiles
/var/spool - message and job queue spools
/var/tmp - temp storage for system wide processes

/etc - Everything To Configure (if you don't like et cetera)

/tmp - temp storage for users

/opt - optional packages installed through system package manager
/opt/bin
/opt/lib
/opt/share

/local - stuff outside the control of package management
→ More replies (25)
→ More replies (1)

2

u/[deleted] Mar 02 '12

I'm a big fan of Zero-K, an OSS game based on the OSS TA-like engine Spring. The game requires some nasty compilation tricks to maintain sync (like very specific floating-point handling) so keeping support on various Linux distros is a constant struggle.

Also, Ubuntu's release cycle means that deploying as a PPA is prettymuch mandatory.

On Windows? one binary, and an internal auto-updater. That's it.

That and the ZK's lobby program is made in C#. Even avoiding WPF, Mono's Windows.Forms implementation is a nightmare of layout failures, and Mono has no WPF support.

There's also a C++-based lobby, but using C++ for an application that doesn't need C++ performance (the lobby, not the game itself) is a headache.

The irony is that most of the Spring engine development itself is done on Linux.

2

u/agenthex Mar 03 '12

I think Linux will gain traction with commercial game developers when they realize that they can develop their content piecemeal and provide not only engines for Mac/PC as well as POSIX and various window managers but the ability to include a bootable version of your game makes operating system obsolescence a non-issue to enjoy their publication.

TL;DR - can't play that game because the OS is proprietary and out of date? Linux-based games could include their own bootable OS to run the game on a livecd.

→ More replies (28)