Slashdot Mirror


Loki Publishes "Programming Linux Games"

An anonymous reader sent in this tidbit - Loki Software has recently released Programming Linux Games, a book about Linux game development. It covers SDL, several audio APIs, and the Linux framebuffer console. The publisher has more info. (If someone wants to review this, email Hemos.)

33 of 75 comments (clear)

  1. Loki became cumbersome. by Anonymous Coward · · Score: 2
    Is there some reason most all of Loki's games (at least last time I checked) only work at 16 pixel depth? This caused me enough of a headache that I finally stopped bothering. Am I missing something obvious? What do other people running at a higher pixel depth do to cope with these games? Dual XF86config files?

    This is most definitely not a troll; I love the Loki crowd and wish I could support them more.

    1. Re:Loki became cumbersome. by nathanh · · Score: 2
      Now if I'm not mistaken DRI only works in 16 bit color,

      You are mistaken. The depth support depends on the card and the driver.

    2. Re:Loki became cumbersome. by treke · · Score: 3

      They don't require 16 bit depth. I run at 24 bit and have no problem with CivCTP, Tribes 2, SOF, UT, Quake 3, Smac's Demo, or HG2. Now if I'm not mistaken DRI only works in 16 bit color, so if you use DRI and not Nvidia's drivers you have to run in 16 bit to get 3d accleration. That's definitly not something Loki did.

    3. Re:Loki became cumbersome. by treke · · Score: 3

      Your right, it is card specific. G450s, Rage 128, and Radeons can now function in 32 bit mode.

    4. Re:Loki became cumbersome. by grammar+fascist · · Score: 2

      Now if I'm not mistaken DRI only works in 16 bit color...

      Either you or I - I've run Quake III on 32-bit color on an XFree86/DRI/Radeon combo. (As a fun aside - it was faster than Windows on the same box with the same configuration! Go team!) I've never heard of that limitation. If you've seen it, it may just be some cards. I have no idea.

      --
      I got my Linux laptop at System76.
  2. uhh by Micah · · Score: 3

    there already is.

    ---

  3. Helping the competition? by Eccles · · Score: 3

    The paranoid amongst us might wonder if the book is deliberately obfuscated to keep out the competition. More reasonably, though, it's in Loki's best interest to expand the number of Linux games available and thus make it more attractive to the potential consumer, as well as system builders.

    --
    Ooh, a sarcasm detector. Oh, that's a real useful invention.
    1. Re:Helping the competition? by Mongoose · · Score: 2

      we all love you in #loki oc

      *paws at oc's face

    2. Re:Helping the competition? by HomerJ · · Score: 2

      yeah, I'll order my copy......maybe :-)

    3. Re:Helping the competition? by nullset · · Score: 2

      congrats :)

      and thanks for putting up w/ all my SDL questions :)

      Seriously, this book is a great reference. I've been using it to get the basics of graphics programming with SDL (and in general) and it's helped tremendously.

      --buddy

    4. Re:Helping the competition? by donglekey · · Score: 3

      I have talked to alot of the guys that work on SDL and use it at #SDL on irc.openprojects.net and I can say that they are some of the nicest bunch of people that I have met online. They are helpful and respectful of every new person and doing something disruptive like that is surely beyond them. Thanks Sam!

    5. Re:Helping the competition? by OverCode@work · · Score: 5

      No. I wrote this book. It is not deliberately obfuscated. But by all means have a look and decide that for yourself.

      -John

  4. Re:thank god! by FleaPlus · · Score: 2

    Or perhaps an XBill 3D (written using OpenGL, of course) where you're equipped with a sniper rifle and have to pick off all the little Bills from a distance. Now -that- would be fun.

  5. Re:No, the real reason is: there is no market. by SurfsUp · · Score: 2
    There are simply not enough people who will BUY (that's right, pay for the software) the linux games, since almost everyone and his brother uses windows to run games. Because developing a game takes a lot of money, when there is no market, it's not a very wise thing to do.

    Just remember that a short time ago there was no market for Linux, now the source code alone is worth a billion dollars. The key to everything we do is doing it for love, fame and pride of craftsmanship, not money. That applies to games as well. Look at Counterstrike to see where the future is. Sure, there will always be a place for big media in the gaming world, but the bottom line is, we don't give a shit, we're going to develop all the games we want ourselves. The smartest thing EA could do is jump in now so the open game projects don't grow as fast as they're growing. But they're not smart, and I for one prefer it this way.
    --

    --
    Life's a bitch but somebody's gotta do it.
  6. Re:selling the *nix community short? by toofast · · Score: 2

    Besides, running a game, nevermind the entire OS, would be sloooooooooow as hell...

    And I do agree that supporting games, and apps as well, on Linux must be a support nightmare.

  7. Re:I've been waiting... by jonathan_ingram · · Score: 5
    On a slightly different tack, you might be interested in PyGame, a portable game programming framework for Python which wraps SDL. Of course, there are bindings for other languages as well (just look at the SDL Homepage), but PyGame is very well implemented. Here is a example of what a very simple demonstration app looks like in PyGame. One of the best applications/games using PyGame so far is Solarwolf, a remake of an old Atari 2600 game (hmm... looks like the site is down at the moment, though).

    One of the best ways to pick up game usage tips is to look at source code. One guy who's coded loads of SDL games (in C) can be found here. In particular - check out Circus Linux - it's a lot of fun :).

  8. Re:selling the *nix community short? by ikekrull · · Score: 5

    The biggest problems with getting games onto linux are:

    a) Developers are mostly much more familiar with Windows, leading them to adopt Windows-specific techniques, making porting difficult and/or expensive.

    and

    b) There is no 'Standard' under Linux for audio/video/input handling.

    Loki is attempting to solve both those problems by

    a) releasing documentation e.g. this book that enables programmers to become familiar with game-development techniques on Linux

    and

    b) releasing a cross-platform library (SDL) that handles these functions, and is looking like the most promising 'Standard' gaming API for Linux.

    I don't see how this is a 'free ride' for anyone, since ideas represented in code, regardless of who they are written by can be easily protected using various licenses, most notably the GPL, which prevents companies from 'stealing' anything.

    And how the hell you arrive at the conclusion that writing documentation is somehow 'the wrong thing to do' is completely beyond me.

    The reason many gaming companies don't support Linux is the same reason they don't support BSD. In terms of the gaming market, nobody buys Linux games.

    Is that any reason not to write games for Linux?

    Linux never would have made any ground in any sector of computing if this attitude prevailed - 'No companies are doing it, so theres no point trying.'

    If a Linux port of a Windows game can be produced for close-to-zero cost, or if Linux can be used as a development environment (can you say 'Playstation 2'?), then delivering games for Linux becomes easier and more attractive, and having good games available leads gamers to consider Linux as their primary OS.

    Linux has only just become a platform capable of supporting modern games, and outshines every other *NIX variant in this respect.

    It is only natural that books like this should be produced, and i can't think of a better group of people to produce them than Loki.

    --
    I gots ta ding a ding dang my dang a long ling long
  9. selling the *nix community short? by joq · · Score: 2


    I'm not a Linux user (BSD baby) nor am I heavy on games, but isn't writing a book on Linux gaming sort of selling the Linux community short? Hear this out if you will.

    If it's such a great thing to do, why haven't other gaming companies focused on creating an offspin development team focusing solely on creating Linux games? Could it be they think of Linux as still a `hobbyish' operating system not worthy of creating games for?

    Its certainly a nice gesture but as stated if it's such a hot thing for a company to take up (gaming under Linux) why aren't many moving to push for stronger development. Is it just easier for companies to have Joe Bloe coder from Utah (no offense to developers) to create something for free they could capitalize on, as opposed to (dare I say this) looking into other alternatives aside from Windows.

    Maybe I worded this poorly, but I see this as a free ride for gaming companies who could easily turn around and use ideas from those who read this book, and perhaps steal ideas from personal web pages and notes, get rich while they release a minimal amount of games for the *nix community.

    Well congrats to the authors by all means since anything to *nix is a good thing in my eyes. Oh well back to "Tampering with Nature -- John Stoessel"

    1. Re:selling the *nix community short? by garett_spencley · · Score: 3
      If it's such a great thing to do, why haven't other gaming companies focused on creating an offspin development team focusing solely on creating Linux games? Could it be they think of Linux as still a `hobbyish' operating system not worthy of creating games for?

      Right now it's a catch 22. Companies aren't going to put their money into Linux gaming until they see that there is a market worth investing in. They won't see that there is a market until there is a good portion of Linux games and the companies making them are making a nice profit.

      Evenutally things will catch on as Loki starts turning a profit and other gaming companies see that. It was also a good idea to port other copmany's games to Linux instead of making them for scratch because that's a way to actually show companies that their games can make a profit on Linux.

      Also, to get more on topic, this book is another step in the right direction because it will give companies a resource that their programmers can use to make the games. But more generaly it will help to encourage game development on Linux in general which is also a Good Thing (TM).

      --
      Garett Spencley

    2. Re:selling the *nix community short? by vogel · · Score: 3

      The main reason companies are afraid to release Linux ports is because they are scared of the support nightmare. It's a bitch to set up your system for gaming.

      This has to change if you want the Linux gaming market to succeed. Of course you also have to buy Linux versions of games to prove to publishers that there actually is a market that is worth the trouble supporting.

      - Daniel Vogel, Programmer, Epic Games Inc.

    3. Re:selling the *nix community short? by OverCode@work · · Score: 5

      I think you're over-analyzing it a bit. :)

      I don't know what Loki's motives for commissioning this were, but I can tell you mine: I wanted to learn this stuff myself. One of the best ways to learn something is to write it out for someone else. In the process of writing PLG, I became a serious SDL user, learned the quirks of OSS, reverse engineered ESD (that's what you have to do when there's no @#$%ing documentation :), and taught myself framebuffer console programming, as well as a bit about video signals, etc.

      So I think it's reasonable to say I know a bit about the mechanics of Linux game programming now. Now maybe someone else can benefit. Maybe it'll sell a million copies, make DirectX obsolete, and get a penguin logo painted on every street corner. But probably not. That's not why I wrote it.

      Or maybe some Linux-using 12 year old will pick it up and get into game programming. It would make my day to know that.

      -John

  10. thank god! by mr_gerbik · · Score: 2

    Now maybe someone will create an xbill 2!

  11. No, the real reason is: there is no market. by Otis_INF · · Score: 2

    There are simply not enough people who will BUY (that's right, pay for the software) the linux games, since almost everyone and his brother uses windows to run games. Because developing a game takes a lot of money, when there is no market, it's not a very wise thing to do.
    --

    --
    Never underestimate the relief of true separation of Religion and State.
  12. Re:Old Man Rant by istartedi · · Score: 3

    Fingers? You had fingers?

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  13. To game or not to game? There is NO question. by kfg · · Score: 2

    I would take one exception to this.

    People really DO need games. Need.

    Ever watch otters on snow slides? Cats with a ball of yarn?

    The archeological records are full of games, as far back as we can trace, and presumably much farther.

    To game is human. . . and weasel, why not penguin?

    KFG

  14. Re:Old Man Rant by Spoing · · Score: 2
    Yeah, and back in your time there weren't any linux games either.

    Ah, the wonders of C and standards: Everything *nix/Linux is a Linux/*nix program (or damn close to it!).

    You were saying about 'checkmate'? :)

    On a serious note, SDL is a hell of an effort and a welcome addition to making cross-platform programs much more likely. A really big and honest THANK YOU to Sam Langa and the other SDL, OpenAL, ... coders out there. MUCH APPRECIATED.

    1. BTW...anyone have a link to the source for Star War? Rouge, C. Caves, etc. are easy to find but this one has illuded me this morning.
    --
    A firewall can not protect you from yourself. Turn off what you do not need. Do not use the firewall to do your work.
  15. Not quite the first book in the genre by TechyImmigrant · · Score: 2

    I have in my possession an original copy of the wonderful tome "Apple graphics and arcade game design" by Jeffrey Stanton, circa 1982. Apple as in Apple ][.

    This covers such advanced topics as:

    Programming Apple Hi-Res graphics from BASIC and machine language.
    Raster Graphics and bit mapping
    Moving things around the screen
    Simulating gravity.
    Doing cunning things with 6502 assembler to make things run faster.

    As a pre-teen getting to grips with the innards of Apples, this one proved a lot easier to read than anything by Rodney Zaks.

    Perhaps if everyone was required to write their first game in 6502 assembler on an Apple ][, they might acquire a better outlook on life. Or maybe just a headache.

    --
    I should use this sig to advertise my book ISBN-13 : 978-1501515132.
  16. Re:When we getting a window's emulator? by _ganja_ · · Score: 2
    In that case have a look at www.transgaming.com

    It's not perfect yet but it's certainly getting there, certainly something to watch for the future.

    --

    A journey of a thousand miles starts with a brutal anal raping at airport security

  17. Re:2d acceleration by OverCode@work · · Score: 2

    Some of the best SDL acceleration is actually under the framebuffer console with a Matrox or 3Dfx card. SDL talks to the card directly then.

    -John

  18. Re:OpenAL development by 11223 · · Score: 2

    I just bought a new game that uses OpenAL.

  19. Shake your google, kid by wrinkledshirt · · Score: 5
    Start here... SDL site

    Here's the SDL doc project.

    Here's an article comparing X-based programming to SDL-based programming.

    You can use OpenGL techniques in SDL, so here's some OpenGL stuff for you...

    This NeHe page comes complete with a version of the infamous Gears ported to SDL.

    Finally, if you really want to start getting the best out of it, you'd better get on hardware acceleration. Either switch to one of the latest commercial distributions (RH 7.1 and Mandrake 8.0 do 3d out of the box), or use the source, luke.

    --

    --------
    Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

  20. Games are not of trivial importance by Linus+Thorvalds · · Score: 2

    I'm glad game companies are pushing Linux as a gaming platform more and more.

    There are two major factors that must contribute in order for Linux - that is the kernel, not the GNU userland that surrounds it - to succeed:

    Games. We need games. People need games. Well, they don't really need them, but games are a major factor for the success of a platform. Just like Philip's Video 2000 and Betamax bit the dust because there was no porn available on it and there was on VHS, Linux has a comparable situation. Since porn is 'cross platform' :) this isn't a problem, but games are. After porn, games are the most prominent factor to success (see my latest book, page 87).

    Loki shows that it knows what will be fital to Linux success, and I'm glad they contribute to it (no, I don't have any Loki shares :) Furthermore, I can only encourage more companies to follow their example, and enjoy every minute of it.

    The only thing that worries me is Microsoft's recent statements about the GPL. The fact that .NET (whatever it's worth) gets ported to FreeBSD, but not to Linux, only because of these silly and irrelevant licensing issues, is a setback for our community. I think we will survive, but we must take notice learn from it.

    Then, at the end of the day, we will have grown.

  21. Old Man Rant by JBowz15 · · Score: 3

    You kids have it too easy these days...

    Back in my day we didn't have these fansy "books" that taught us how to program linux games. We were real men, who coded real code from scratch, for computers which were not real because they hadn't been invented yet by Al Gore. And we liked it! Bah!