Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Loki Publishes "Programming Linux Games" 75

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.)
This discussion has been archived. No new comments can be posted.

Loki Publishes "Programming Linux Games"

Comments Filter:
  • by Anonymous Coward
    Yeah, and back in your time there weren't any linux games either.

    Checkmate.
  • by Anonymous Coward
    Ok, we all know that Nvidia's linux drivers are almost on par with windows drivers when it comes to 3d, but how does X compare to windows when it comes to 2d acceleration?

    I occasionally lurk on the SDL message board and have noticed that when people have queried SDL about hardware acceleration under X it doesn't always match up with what windows is saying. Does X just need some more work on 2d acceleration, or because Nvidia has closed-source drivers the X developers don't have enough register-level info to expose more 2d acceleration?

  • by Anonymous Coward
    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.

    It's not quite that simple, at least for existing mass market developers. Deciding to target Linux is not like deciding to target another platform, say Macintosh. Dual-boot and effective Win32/DirectX emulation greatly diminish the theoretical Linux market. If a Linux user can buy a Win32 game and run it there is little motivation for a linux version. The developer needs the linux version to generate new sales, basically what they have to work with are the folks who would never buy the Win32 version.

    Now Linux does have more potential for startups. The startup would exist in a less competitive market, and with a little bit of stroking the patriotism of the market could be leveraged. Again I'll go to Macintosh for an example, Bungie. They released Mac only games for a while, and leveraged this very loyal base to expand and grow. Leveraging a niche game market has proven to be an effective strategy to get into the larger mass market. And if the niche grows that is even better, you were there on the ground floor.
  • by Anonymous Coward
    The biggest problems with getting games onto linux are:

    You forgot about the fact that the market for Linux games is only a few thousand units for a popular title.
  • by Anonymous Coward
    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.

  • by Micah ( 278 ) on Friday June 29, 2001 @06:43PM (#118723) Homepage Journal
    there already is [xbill.org].

    ---
  • by Eccles ( 932 ) on Friday June 29, 2001 @06:05PM (#118724) Journal
    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.
  • 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.

  • Ditto that! I ordered the book as soon as I saw there was a link to it.
  • Exactly. What about people with newer cards that aren't supported yet by X? What about the refresh rate hell that is X setup? Some of this is simply that Linux distros don't have the clout that M$ has. I mean, who releases hardware and doesn't think about whether or not it works in Windows? Now, how many hardware vendors even know what Linux is? A few; but it isn't enough to ensure reliable performance.
  • In that case, looks like I'm going to have to learn how to program with OpenGL.

    (^o^)
  • 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.
  • we all love you in #loki oc

    *paws at oc's face
  • yeah, I'll order my copy......maybe :-)
  • 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.
    --

  • You don't need dual XF86Config Files.. Just start another copy of X up.
    I have some games (windows games run through wine or vmware) that require 8 bit mode. (Yuck) And to play them I just run
    xinit /usr/bin/X11/xterm -- :2 -depth 8
    that will start another copy of X in 8 Bpp. then I type twm (start up a simple window manager)
    and run my game.
    then I just exit the xterm and go back to my other X.. Yeah it's not easy but it can be done. I read somewhere (i believe) that supposedly there is some bit depth changing stuff in X/DRI or at least being worked on.. Can anyone verify this? This would Definitly be a "Good Thing (tm)" for linux/unix.
  • I see that there's a section on developing on OpenAL. That seems like the way to go, but I was wondering if that whole initiative is dead in the water. There has been no news on that front for quite some time. Now that my graphical capabilities are up to snuff (thanks, Nvidia), I'm really starting to miss 3D sound.
  • 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.

  • As someone who tried writing a game for windows, it's hard for without a big budget to pay experience people. Every little book will help... especially when Linux is trying to get into the consumer market. many people use windows just for the games, and this might help get some games on linux. Kenny
  • by jonathan_ingram ( 30440 ) on Friday June 29, 2001 @10:16PM (#118737) Homepage
    On a slightly different tack, you might be interested in PyGame [pygame.org], 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 [libsdl.org]), but PyGame is very well implemented. Here [seul.org] 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 [zopesite.com], 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 [newbreedsoftware.com]. In particular - check out Circus Linux [newbreedsoftware.com] - it's a lot of fun :).

  • Wrong, if done properly. Just make gaming more like the Amiga was and ship a skeleton OS with the game.

    Ship the game on a bootable CD with the required distribution/setup on the disc. The CD would either run the game like that (using a swap partition if possible) or 'install' to a partition.

    Imagine games with completely clean installs and de-installs. Linux is pretty much THE world class embedded OS , why not treat it like one?
  • I once talked to a Jehovah's witness (Actually I do this quite a lot and find it very interesting). He said that to understand the Bible I would have to sit down and study it for 4 years, and then I would be enlightened. I turned to him and said "Well if I spent 4 years reading any book, I'm hardly going to turn around and say 'Well that was a load of Cr*p!'". What I'm trying to say: Is the current infrastructure (SDL, etc.) a viable solution and assuming your answer is yes, why should I take you seriously? I'm thinking one alternative would be a larger version of Allegro or something.
  • I once talked to a Jehovah's witness (Actually I do this quite a lot and find it very interesting).

    He said that to understand the Bible I would have to sit down and study it for 4 years, and then I would be enlightened.

    I turned to him and said "Well if I spent 4 years reading any book, I'm hardly going to turn around and say 'Well that was a load of Cr*p!'".

    What I'm trying to say: Is the current infrastructure (SDL, etc.) a viable solution and assuming your answer is yes, why should I take you seriously?

    I'm thinking one alternative would be a larger version of Allegro or something.
  • Don't need to 'reboot', use init.

    Distro instalation cds already do the detecting and the results can be cached if the game is 'installed'.

    Plus, windows needs rebooting between games, so it's not much of a concept leap. In terms on tech support and long term stability, a dedicated OS is the best solution.

    My only problem with it is letting untrusted software write to the disc directly.

    By skeleton, I meant in terms of included system applications.
  • yeah ok, it would have to be installed to a partition (as above). It was just an idea.
  • 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
  • ...and yet open source games projects get little to no interest from developers. Go figure.
  • Yeah, but Mac owners dont mind buying things.

    The typical Linux only person:
    1. into it because its free
    2. linux actually fulfills eveything they care to use
    3. they hate microsoft enough, or champion the Linux idea enough to be exclusive, or both or something like that, i.e. linux biggot, microsoft snob

    for user type 1 they wont buy anything, only want free stuff. user type 2 probably wont buy, because if the current linux has everything they need, then they probably arent into games much.

    User type 3 is the only maybe category. What are the percentages? And how many in the last category would actually care about games or care enough to pay money?

  • by ikekrull ( 59661 ) on Friday June 29, 2001 @07:27PM (#118746) Homepage
    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.

  • If only I had the time...
  • bad Mongoose. Quit humping oc's leg.
  • by treke ( 62626 ) on Friday June 29, 2001 @08:39PM (#118749)
    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.
  • by treke ( 62626 ) on Friday June 29, 2001 @10:37PM (#118750)
    Your right, it is card specific. G450s, Rage 128, and Radeons can now function in 32 bit mode.

  • 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"
  • what, no xtris? what's the matter with you?
  • Now maybe someone will create an xbill 2!
  • Could it be they think of Linux as still a `hobbyish' operating system not worthy of creating games for?

    I really don't think so. I for one am not a Linux zealot. I think it's a cool OS that has lots of advantages. I think what they are exploring is that it is becoming quite a player in the global arena, mainly China and the east. If they can niche out a gaming market in any one of these verticles, then porting to others will be easy because all the DBCS or double byte enablement will be done already, trhis make global prting reguardless of OS easier. I think it's much more a P&L delvelopment effort, rather than technical choice.

  • Congratulations,

    As a writer of technical books myself I can say that any book written and on the shelves is an accomplishment.

    Just so you guys know writing is NOT at all about the money. Hell writing this book represents the fact that someone with very specalized knowledge had the courage to try and share that with the rest of the world. It is not an easy task and writing a good book takes a huge amount of skill and dedication to the craft.

    After writing myself I have a newfound apprecation for books such as Bruce Eckels because not only is it a good book to have but the admiration goes even deeper and down to the writing style.

    A well written book is truly art.

    Props to you for sharing with the world, I know what thankless task writing can be.

    Jeremy

  • by donglekey ( 124433 ) on Friday June 29, 2001 @06:11PM (#118757) Homepage
    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!
  • Why is allegro "highly deficient"? It seems to be good enough for MAME and many others.
  • 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.
    --
  • by istartedi ( 132515 ) on Friday June 29, 2001 @07:08PM (#118760) Journal

    Fingers? You had fingers?

  • 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
  • The day Linux beats Windows as gaming environment (more fps ant things like that) will be the day when Linux starts to push itself to desktop.
  • 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.
  • 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.

  • 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.

  • and I'm going to read it, too. Maybe twice.
  • What the hell does this have to do with linux games?

    Now, if this is a true bug and occurs during Tribes or Civ, then I see the relevance. The fact that the kernel list had no response makes me suspect.

  • xtris is a FAR more recent program than those others. xtris wasn't really included until you included X, and that wasn't until you actually got the distributions on CDs. It was a pain in the pre-1.0.86 days to get X working, much less a game in X.

    and that's my 3 sentances worth
  • Eh, I still prefered the hack and slash approach I had to use to program on my C64(actually it was the vic-20 clone)

    Finally, writing a LONG text adventure prog, I ran out of memory :-(

  • by garett_spencley ( 193892 ) on Friday June 29, 2001 @07:46PM (#118770) Journal
    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

  • Release a game on a bootable CD that won't have any installation issues and driver incompatibilities and I'll believe you. - Daniel Vogel, Programmer, Epic Games Inc.
  • by vogel ( 196253 ) on Friday June 29, 2001 @08:42PM (#118772) Homepage
    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.
  • I think it was more a matter of "Loki releases $PRODUCT", not "New book on Linux programming". I thumbed through your book at the bookstore, and it looks very good. I hope to have a chance to read it sometime.

    -John
  • SDL has quite a lot going for it:

    a) it doesn't try to do multimedia IO itself; it serves as a common interface between DirectX, xlib, fbdev, etc. So you have all the support base of the platform's native toolkit, with a cross platform API.

    b) it's free software (in the RMS sense). If you don't like it, you can change it.

    c) it was developed for porting commercial games, and it has a proven track record. Every Loki title uses SDL.

    d) it is simple and intuitive. This is largely subjective, of course; give it a try and decide for yourself.

    -John
  • 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
  • No. I wrote this book. It is not deliberately obfuscated. But by all means have a look and decide that for yourself.

    -John
  • 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
  • I just bought a new game that uses OpenAL.
  • by wrinkledshirt ( 228541 ) on Friday June 29, 2001 @06:32PM (#118779) Homepage
    Start here... SDL site [libsdl.org]

    Here's the SDL doc project [csn.ul.ie].

    Here's an article [ibm.com] comparing X-based programming to SDL-based programming.

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

    This NeHe page [libsdl.org] comes complete with a version of the infamous Gears [libsdl.org] 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 [redhat.com] 7.1 and Mandrake [mandrake.com] 8.0 do 3d out of the box), or use the source, luke [sourceforge.net].

  • 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.
  • Because the Linux is community is how large? And when a new app comes out there are how many CD burning parties? And there are how many companies that have made money off Linux? There are some new exciting desktop initiatives looking to change all this. Look for a new desktop focused distribution coming out late summer and a real office suite to be released in a few months. These will hopefully be combined with a successful business team.
  • for this since May. I really need to learn SDL (well 'really need' meaning really want to) for my amateur game development. there is just not enough documentation online as to how to use SDL. even allegro - a highly deficient SDL-like game SDK - has tutorials up the wazzo. i couldn't (at the time) find a single one for SDL! so, i figured i should wait for THE book by THE SDL and linux game people. i can't wait to pick it up!

  • Congrats on finally getting it finished Jon...

    Now I'm wondering why they ignored my submission about my one, Linux Game Programming [primagamedev.com], was ignored when it came out 2 months ago...

    Grrr... and Hemos even had the nerve to ask for a free copy... and I was stupid enough to send him one... again, grrr....

    (rant over)
  • 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.
  • Hmmm... UT, SOF, Myth2, HG2, Heroes III, Heretic 2, Rune, and SC3K all work at 24 bit for me... Apparently CivCTP, Tribes 2, and SMAC also work at 24 bit. How did this get modded up to Score 2, Interesting? Dinivin

  • Plus the G400s and Voodoo4/5.

    Dinivin
  • by JBowz15 ( 451573 ) on Friday June 29, 2001 @06:06PM (#118787)
    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!
  • I'm talking about the package(the resources it provides such as the api calls ect.) as a whole as being a fun toy to play around with. and if you use it you might end up with something intersting, or you might learn something under its instructions. Aka the bonus.

    -------------------
  • Never looked in /usr/games, eh? Whatta newbie. Let's see, we've got trek, battlestar, mille, paranoia, and cribbage, just for starters. Plus, the mother of them all, wargames.

    I think the position we are in is known as a "fool's mate".

  • well I'm not sure about SDL but my X server (4.1.0) in 2d is still much slower then Windows when it comes to dragging windows around, etc.. (the windows in X take a while to be redrawn while in Windows this is unnoticeable). All this using a Geforce 2 MX. I'm hoping this will get faster under X as it's quite annoying
  • I have gotten some games to run well using the win4linux application found here [netraverse.com].

    There's a trial version available, so you can test some games with it without buying it right away.

    --
  • NVidia cards in general do not match competitors' in terms of 2d acceleration (matrox for example).

    I wouldn't put all (if any) of the blame on the X server.

    --

"If it ain't broke, don't fix it." - Bert Lantz

Working...